/* 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 */
  .hero-trust-strip {
    padding: 1.5rem 0 !important;
  }

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

  .trust-badge {
    font-size: 0.75rem !important;
    justify-content: center !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 {
    padding: 3rem 0 5rem 0 !important; /* Extra bottom padding for sticky CTA */
    text-align: center;
  }

  .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;
  }
}
