/* Moriveda Mobile & Responsive Adjustments */

/* Floating sticky mobile bottom CTA bar */
.sticky-mobile-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-navbar);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  display: none;
  justify-content: space-between;
  align-items: center;
  z-index: 990;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
}

.sticky-mobile-price {
  display: flex;
  flex-direction: column;
}

.sticky-mobile-price span:first-child {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.sticky-mobile-price span:last-child {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--green-deep);
}

[data-theme="dark"] .sticky-mobile-price span:last-child {
  color: var(--white);
}

.sticky-mobile-cta .btn {
  padding: 0.65rem 1.25rem;
  font-size: 0.8rem;
}

/* Media Queries */
@media (max-width: 992px) {
  /* Scrollytelling content adjusts for tablet */
  .scrolly-text {
    font-size: 2.2rem;
    padding: 0 1.5rem;
  }
  
  .grid-2, .grid-3, .grid-4 {
    gap: 2rem !important;
  }
}

@media (max-width: 768px) {
  /* General resets to prevent horizontal overflow */
  .container {
    padding: 0 1.25rem !important;
  }
  
  section {
    padding: 4rem 0 !important; /* Smaller paddings for mobile sections */
  }

  header {
    padding: 120px 0 2.5rem 0 !important; /* Spacing for mobile page headers with navbar clearance */
  }

  main {
    padding: 2.5rem 0 !important; /* Default padding for main elements on mobile */
  }

  /* Spacing between header and main for pages with headers (about, blog, faq, contact) */
  header + main {
    padding-top: 2.5rem !important;
  }

  /* Main when it is the first content container on the page (e.g. shop.html) - needs navbar clearance */
  main:first-of-type:not(header + main) {
    padding-top: 120px !important;
  }

  /* Reset horizontal slide heights to stack vertically */
  .horizontal-scroll-container {
    height: auto !important;
    display: flex;
    flex-direction: column;
    width: 100% !important;
    transform: none !important;
  }
  
  .horizontal-slide {
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    padding: 2.5rem 1rem !important;
  }
  
  .horizontal-slide .grid-2 {
    display: flex;
    flex-direction: column;
    gap: 2rem !important;
  }

  .slide-content {
    text-align: center;
    order: 1;
  }

  .slide-visual {
    order: 2;
    display: flex;
    justify-content: center;
    width: 100% !important;
  }

  .slide-visual img {
    width: 100% !important;
    max-width: 340px !important;
    height: auto !important;
    max-height: 280px !important;
    object-fit: cover;
    border-radius: 16px !important;
  }

  .slide-content h2 {
    font-size: 2.2rem !important;
    margin-bottom: 1rem !important;
  }
  
  /* Show sticky bottom bar on details/shop page */
  .shop-detail-page .sticky-mobile-cta {
    display: flex;
  }
  
  /* Mobile padding and headings */
  h1 { font-size: 2.4rem !important; }
  h2 { font-size: 2rem !important; }
  h3 { font-size: 1.5rem !important; }
  
  .logo {
    font-size: 1.4rem;
  }
  
  /* Homepage Hero section styling */
  #hero {
    text-align: center;
    padding-top: 120px !important;
    padding-bottom: 4rem !important;
    min-height: auto !important;
  }

  #hero .grid-2 {
    display: flex;
    flex-direction: column;
    gap: 3rem !important;
  }

  #hero .hero-title {
    font-size: 2.6rem !important;
  }

  #hero .hero-subtitle {
    font-size: 1.1rem !important;
    margin-bottom: 2rem !important;
  }

  #hero .hero-cta-group {
    justify-content: center;
    flex-direction: column;
    gap: 1rem !important;
  }

  #hero .hero-cta-group .btn {
    width: 100%;
    margin-left: 0 !important;
  }

  #hero .hero-visual {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
  }

  /* Trust badges strip — compact on phones.
     Previously this rendered at 0.75rem in a 2-column grid, which made
     "Lab Tested (COA Free)" and "Pan India Shipping" wrap onto two lines and
     left the strip taking up a big slab of the screen under the banner.
     Smaller type + tighter gaps keep every badge on a single line. */
  .hero-trust-strip {
    padding: 0.7rem 0 !important;
  }

  .hero-trust-strip .container {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.45rem 0.5rem !important;
    text-align: center;
    padding: 0 0.75rem !important;
  }

  .trust-badge {
    font-size: 0.58rem !important;
    letter-spacing: 0 !important;
    gap: 0.3rem !important;
    justify-content: center !important;
    white-space: nowrap;
  }

  .trust-badge i {
    font-size: 0.75rem !important;
  }

  /* Scrollytelling mobile adjustments */
  .scrollytelling-sticky {
    position: relative !important;
    top: 0 !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    padding: 0 !important;
    background-color: var(--bg-primary) !important;
  }

  .scrollytelling-visual {
    position: sticky !important;
    top: 80px !important;
    height: 280px !important;
    width: 100% !important;
    border-radius: 16px;
    margin-bottom: 3rem !important;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
  }

  .scrollytelling-visual img {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
  }

  .scrollytelling-visual img.active {
    opacity: 1 !important;
  }

  .scrollytelling-container {
    height: auto !important;
    padding: 3rem 0 !important;
    background-color: var(--bg-primary) !important;
  }

  .scrollytelling-content-layer {
    position: relative !important;
    height: auto !important;
    padding: 0 1rem !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }

  .scrolly-text {
    position: relative !important;
    display: block !important;
    opacity: 0.25 !important;
    transform: none !important;
    margin-bottom: 6rem !important; /* Reduced from 12rem for tighter scrolling */
    font-size: 1.5rem !important;
    text-align: center !important;
    width: 100% !important;
    transition: opacity 0.3s ease;
    color: var(--text-primary) !important;
  }

  .scrolly-text span {
    color: var(--text-secondary) !important;
    font-size: 1.1rem !important;
    display: block;
    margin-top: 0.75rem;
  }

  .scrolly-text:last-child {
    margin-bottom: 3rem !important; /* Reduced from 6rem */
  }

  .scrolly-text.active {
    opacity: 1 !important;
  }

  /* Product Selector / Shop Page Details */
  .product-gallery {
    position: relative !important;
    top: 0 !important;
    margin-bottom: 2.5rem;
    width: 100%;
  }

  .main-gallery-image {
    padding: 1rem !important;
    border-radius: 16px !important;
  }

  .main-gallery-image img {
    max-height: 280px !important;
  }

  .gallery-thumbs {
    gap: 0.5rem !important;
  }

  .gallery-thumb {
    width: 60px !important;
    height: 60px !important;
  }

  .product-details-pane {
    text-align: center;
  }

  .product-details-pane .review-stars-strip {
    justify-content: center;
  }

  .product-details-pane .size-selector {
    margin-bottom: 1.5rem;
  }

  .product-details-pane .price-display {
    justify-content: center !important;
  }

  .product-details-pane #buy-button {
    max-width: 100% !important;
  }

  .product-details-pane .checkpoint {
    justify-content: center;
    font-size: 0.85rem !important;
  }

  /* Sourcing Map & Grade Comparison */
  .comparison-table-wrapper {
    overflow-x: auto;
    margin: 0 -1.25rem;
    padding: 0 1.25rem;
    -webkit-overflow-scrolling: touch;
  }
  
  table.comparison-table {
    width: 600px !important; /* Force min width for scroll */
  }

  /* Footer layout */
  .footer {
    /* The 5rem bottom padding that used to live here was clearance for the
       sticky mobile CTA bar — but that bar only renders on .shop-detail-page
       (see the rule earlier in this file). On the other six pages it was just
       ~80px of dead footer background below the last line of text, which read
       as a big empty slab at the end of the page. Clearance is now scoped to
       the one page that actually needs it. */
    padding: 3rem 0 2rem 0 !important;
    text-align: center;
  }

  /* Only shop.html shows the sticky Add-to-Cart bar, so only it needs room. */
  .shop-detail-page .footer {
    padding-bottom: 5rem !important;
  }

  .footer-brand {
    align-items: center;
  }

  .footer .grid-4 {
    display: flex;
    flex-direction: column;
    gap: 2.5rem !important;
  }

  .footer-bottom {
    margin-top: 2rem;
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 1rem;
  }
}

/* ==========================================================================
   Phone-width pass (375px–768px): announcement bar, navbar, cart, checkout
   ========================================================================== */

@media (max-width: 768px) {
  /* Announcement bar: tighter, controls stay inside the bar */
  .announcement-bar {
    padding: 0.25rem 0.5rem;
    gap: 0.25rem;
  }

  .announcement-prev,
  .announcement-next,
  .announcement-close {
    width: 30px;   /* slightly wider tap targets */
    height: 30px;
  }

  /* Checkout modal: comfortable tap targets (>=44px) */
  .checkout-modal .btn {
    min-height: 44px;
  }

  .checkout-modal .form-input {
    min-height: 44px;
  }

  .checkout-modal .step-indicator {
    padding: 1rem 0.75rem 0.25rem;
    gap: 0.35rem;
  }

  .checkout-modal .step-line {
    flex-basis: 12px;
    max-width: 28px;
  }
}

@media (max-width: 480px) {
  /* Announcement bar: room for two-line messages, arrows hidden (swipe +
     auto-rotate still work), close button always reachable */
  .announcement-bar {
    min-height: 50px;
  }

  .announcement-prev,
  .announcement-next {
    display: none;
  }

  /* Cart drawer: full width */
  .cart-drawer {
    max-width: 100%;
  }

  /* Checkout modal: full-screen with scrollable body */
  .checkout-modal-overlay {
    padding: 0;
    align-items: stretch;
  }

  .checkout-modal {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }

  .checkout-modal-header {
    padding: 1.1rem 1.25rem 0.9rem;
  }

  .checkout-body {
    padding: 1.25rem 1.1rem 2.5rem;
  }

  .checkout-modal .form-input,
  .checkout-modal select.form-input {
    font-size: 16px; /* prevents iOS auto-zoom on focus */
  }
}

/* ==========================================================================
   Hero slider — the promo text ("Pure. Plant-Based. Powerful.", "Shop Now",
   etc.) is baked directly into the slide JPGs, not separate HTML. On narrow
   mobile viewports `background-size: cover` crops the sides of these wide,
   desktop-oriented images and cuts the text off. Switching to `contain` on
   mobile guarantees the full image (and all its text) is always visible,
   at the cost of some letterboxing above/below.
   ========================================================================== */
/* Hero: swap the 4:1 desktop artwork for purpose-built 1:1 artwork.
   Because the square container ratio matches the square images exactly,
   `cover` fills the frame edge-to-edge with zero cropping — no more
   letterboxing (the old `contain` rule) and no more cut-off headlines. */
@media (max-width: 768px) {
  .hero-slider-container {
    aspect-ratio: 1 / 1;
  }

  .hero-slide {
    background-size: cover;
    background-position: center center;
    background-color: var(--bg-secondary);
  }

  /* Mobile shows ONLY artwork drawn natively at 1:1 (1254x1254). Slides 1
     and 3 are marked data-desktop-only in index.html and removed from the
     rotation by js/main.js, so they need no mobile background here — the
     generated, edge-extended _sq fallbacks are gone for good. */
  .hs-2 { background-image: url('../assets/images/m_value_packs.jpg'); }
  .hs-4 { background-image: url('../assets/images/m_daily_diet.jpg'); }
  .hs-5 { background-image: url('../assets/images/m_nutrients.jpg'); }
  .hs-6 { background-image: url('../assets/images/m_single_pouch.jpg'); }

  /* Match the desktop tightening of the gap under the banner. Needs to come
     after (and match the !important of) the blanket `section { padding: 4rem 0 }
     rule earlier in this file, which would otherwise win. */
  .direct-products-section {
    padding: 2rem 0 4rem !important;
  }

  /* Shrink the slider controls so they don't crowd the square frame. */
  .slider-arrows {
    bottom: 1rem;
    left: 1rem;
    gap: 0.6rem;
  }
  .slider-arrow {
    width: 38px;
    height: 38px;
    font-size: 0.8rem;
  }
  .slider-dots {
    bottom: 1.35rem;
  }
}
