/* ============================================
   SAMA CIPHER PERFUMES — Responsive Styles
   ============================================ */

/* -------------------------------------------
   Tablet (768px - 1024px)
   ------------------------------------------- */
@media (max-width: 1024px) {
  .collection-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .brand-story .story-grid {
    gap: var(--space-2xl);
  }

  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Carousel — tablet */
  .carousel-container {
    max-width: 640px;
    --img-h: 360px; /* used by pages that key image height off this var */
  }

  .carousel-image {
    height: 360px;
  }
}

/* -------------------------------------------
   Large Mobile / Small Tablet (480px - 767px)
   ------------------------------------------- */
@media (max-width: 767px) {
  :root {
    --header-height: 64px;
  }

  /* Raise navbar above the nav-overlay so mobile menu links are clickable.
     The navbar is position:fixed (z-index:200) which creates its own stacking
     context, but .nav-overlay is appended to <body> at z-index:399 — so unless
     the navbar itself is raised above 399, the overlay covers the links. */
  .navbar {
    z-index: var(--z-modal); /* 400 > overlay 399 */
  }

  .navbar .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 340px;
    height: 100vh;
    background: var(--color-bg-alt);
    flex-direction: column;
    justify-content: center;
    gap: var(--space-xl);
    padding: var(--space-4xl) var(--space-2xl);
    transition: right var(--transition-base);
    border-left: 1px solid var(--color-glass-border);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
    z-index: var(--z-modal);
    margin-right: 0;
  }

  .navbar .nav-menu .nav-link {
    color: var(--color-cream);
    font-size: var(--text-sm);
    text-align: center;
  }

  .navbar .nav-menu.open {
    right: 0;
  }

  .hamburger {
    display: flex;
  }

  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: calc(var(--z-modal) - 1);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
  }

  .nav-overlay.show {
    opacity: 1;
    visibility: visible;
  }

  /* Hero */
  .hero h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero .bottle-container {
    width: 160px;
    height: 220px;
  }

  /* Brand Story */
  .brand-story .story-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .brand-story .story-image {
    height: 300px;
  }

  /* Collection */
  .collection-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
  }

  /* Hair Mists */
  .mists-grid {
    grid-template-columns: 1fr;
  }

  .mist-card {
    flex-direction: column;
    text-align: center;
  }

  .mist-card .mist-image {
    width: 100px;
    height: 140px;
  }

  /* Attar */
  .attar-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .attar-image {
    height: 280px;
  }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
  }

  /* Newsletter */
  .newsletter-form .form-row {
    grid-template-columns: 1fr;
  }

  /* Contact */
  .contact-links {
    flex-direction: column;
    align-items: center;
  }

  .contact-link {
    width: 100%;
    max-width: 300px;
  }

  /* Section spacing */
  .section {
    padding: var(--space-4xl) 0;
  }

  /* -----------------------------------------
     Carousel — large mobile / small tablet
     ----------------------------------------- */
  .carousel-container {
    max-width: 100%;
    --img-h: 300px;
  }

  .carousel-slide {
    padding: 0 var(--space-md);
  }

  .carousel-image {
    height: 300px;
    max-width: 320px;
  }

  /* Arrows: pull in from the edges and shrink slightly so they
     stay clear of the viewport edge on narrow screens */
  .carousel-nav-arrows {
    left: 8px;
    right: 8px;
  }

  .carousel-btn {
    width: 44px;
    height: 44px;
    font-size: var(--text-base);
  }

  .carousel-prev {
    left: 4px;
  }

  .carousel-next {
    right: 4px;
  }

  /* Stack size options instead of squeezing them side by side */
  .carousel-sizes {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .carousel-size-option {
    min-width: 90px;
    padding: var(--space-sm) var(--space-lg);
  }

  .carousel-name {
    font-size: clamp(1.5rem, 5vw, var(--text-2xl));
  }

  .carousel-desc {
    font-size: var(--text-sm);
  }

  .navbar .logo {
    margin-left: var(--space-md); /* keep it near the left edge on mobile instead of 4rem in */
  }

  .hamburger {
    display: flex;
    position: absolute;
    top: 50%;
    right: var(--space-lg);
    transform: translateY(-50%);
    margin-left: 0;
  }
}

/* -------------------------------------------
   Small Mobile (< 480px)
   ------------------------------------------- */
@media (max-width: 479px) {
  .hero .bottle-container {
    width: 120px;
    height: 180px;
  }

  .perfume-card .card-image {
    height: 200px;
  }

  .perfume-card .card-image img {
    max-height: 160px;
  }

  .brand-story .story-image {
    height: 300px;
    margin-bottom: var(--space-lg);
    margin-top: var(--space-lg);
  }

  .container {
    padding: 0 var(--space-lg);
  }

  /* -----------------------------------------
     Carousel — small mobile
     ----------------------------------------- */
  .carousel-container {
    --img-h: 240px;
  }

  .carousel-image {
    height: 240px;
    max-width: 100%;
  }

  .carousel-slide {
    padding: 0 var(--space-sm);
  }

  .carousel-nav-arrows {
    left: 2px;
    right: 2px;
  }

  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .carousel-sizes {
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
  }

  .carousel-size-option {
    width: 100%;
    max-width: 200px;
    min-width: 0;
    padding: var(--space-sm) var(--space-md);
  }

  .carousel-notes {
    gap: 6px;
  }

  .carousel-notes span {
    font-size: 0.65rem;
    padding: 3px 8px;
  }

  .carousel-dots {
    gap: var(--space-xs);
  }
}

/* -------------------------------------------
   Ultra-wide (1920px+)
   ------------------------------------------- */
@media (min-width: 1920px) {
  .hero h1 {
    font-size: var(--text-8xl);
  }

  .hero .bottle-container {
    width: 260px;
    height: 360px;
  }

  /* Carousel — ultra-wide */
  .carousel-container {
    max-width: 960px;
    --img-h: 460px;
  }

  .carousel-image {
    height: 460px;
    max-width: 420px;
  }

  .carousel-name {
    font-size: var(--text-4xl);
  }
}