/* ==========================================================================
   GOLDEN THREADS — RESPONSIVE ADAPTATIONS
   Mobile-First & Fluid Layout Breakpoints
   Breakpoints: 1200px, 992px, 768px, 480px, 360px
   ========================================================================== */

/* Universal Flex & Grid Safeguards to prevent horizontal overflow */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

/* Ensure all flex and grid children can shrink below their content size */
.container,
.site-header,
.hero-editorial,
.feature-strip,
.collections-split,
.product-grid,
.story-block,
.newsletter-card,
.footer-top,
.footer-bottom,
.pdp-grid,
.pdp-gallery,
.pdp-details,
.contact-grid,
.contact-info-card,
.craft-pillars-grid,
.craft-notes-list,
.form-row,
.shop-toolbar {
  min-width: 0;
}

.collections-split > *,
.product-grid > *,
.story-block > *,
.newsletter-card > *,
.footer-top > *,
.pdp-grid > *,
.contact-grid > *,
.craft-pillars-grid > *,
.craft-notes-list > *,
.form-row > * {
  min-width: 0;
}

/* Buttons default fluid behavior */
.btn {
  max-width: 100%;
}

/* Small Desktops & Landscape Tablets */
@media (max-width: 1200px) {
  :root {
    --container-padding: 24px;
  }
  
  .footer-top {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 2.5rem 2rem !important;
  }
  
  .feature-strip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1.5rem;
  }

  .feature-item {
    border-left: none;
    padding-left: 0;
  }
}

/* Medium Tablets & Narrow Laptops */
@media (max-width: 992px) {
  .header-nav {
    display: none;
  }
  
  .mobile-toggle {
    display: flex;
  }
  
  .collections-split {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }
  
  .collection-card {
    height: 440px;
    padding: 2.25rem;
  }
  
  .story-block, .story-block.reverse {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    direction: ltr;
  }
  
  .story-badge-seal {
    width: 90px;
    height: 90px;
    bottom: -15px;
    right: 15px;
  }
  
  .newsletter-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding: 2.5rem 2rem;
  }
  
  .pdp-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }
  
  .pdp-gallery {
    position: static;
  }
  
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }
  
  .craft-pillars-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
}

/* Tablets & Large Phones (768px) */
@media (max-width: 768px) {
  :root {
    --container-padding: 20px;
  }
  
  .announcement-bar {
    font-size: 0.74rem;
    padding: 0.5rem 0.75rem;
    line-height: 1.35;
  }
  
  .announcement-secondary {
    display: none !important;
  }
  
  .header-inner {
    height: 68px;
  }
  
  .site-logo img {
    height: 38px;
  }
  
  /* Accessible 44px+ touch targets on touch headers */
  .mobile-toggle {
    width: 44px;
    height: 44px;
    padding: 10px 8px;
  }
  
  .action-btn {
    width: 42px;
    height: 42px;
  }
  
  .cart-close-btn {
    width: 42px;
    height: 42px;
  }
  
  .hero-editorial {
    height: auto;
    min-height: 520px;
  }
  
  .hero-content {
    padding: 3rem 0;
  }
  
  .hero-content p {
    font-size: 1.05rem;
    margin-bottom: 1.75rem;
    max-width: 100%;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }
  .hero-actions .btn {
    width: 100%;
    padding: 0.9rem 1.5rem;
  }
  
  .btn {
    white-space: normal !important;
    text-align: center;
  }
  
  .collection-card {
    height: auto !important;
    min-height: 380px;
    padding: 2rem 1.5rem !important;
  }
  
  .collection-card-content {
    max-width: 100% !important;
    width: 100% !important;
  }
  
  .collection-card-content .btn {
    width: 100%;
  }
  
  .feature-strip-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }
  
  .feature-item {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
  }
  .feature-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
  }
  
  .product-quick-actions {
    opacity: 1;
    transform: translateY(0);
  }
  
  .product-info {
    padding: 1.25rem;
  }

  .craft-notes-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  
  .newsletter-form {
    flex-direction: column;
  }
  
  .shop-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .shop-sort-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .sort-select {
    width: 100%;
  }
  
  .footer-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .footer-bottom-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
  }
  
  .cart-drawer {
    max-width: 100%;
    width: 100%;
  }
  
  .form-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }

  .about-hero {
    height: auto;
    min-height: 380px;
  }
}

/* Standard Mobile (480px and below) */
@media (max-width: 480px) {
  :root {
    --container-padding: 16px;
  }
  
  .hero-content h1 {
    font-size: 2.2rem !important;
    line-height: 1.15 !important;
  }
  
  .section-header h2 {
    font-size: 1.85rem !important;
  }
  
  .collection-card {
    height: auto !important;
    min-height: 360px;
    padding: 1.75rem 1.25rem !important;
  }
  
  .collection-card-content h3 {
    font-size: 1.6rem !important;
  }
  
  .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  
  .contact-info-card {
    padding: 1.75rem 1.25rem !important;
  }
  
  .contact-info-card + div {
    padding: 1.75rem 1.25rem !important;
  }
  
  .btn {
    padding: 0.85rem 1.25rem !important;
    font-size: 0.76rem !important;
  }
  
  .pdp-title {
    font-size: 1.85rem !important;
  }
  
  .pdp-thumbs {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }
  
  .pdp-actions-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .pdp-qty-selector {
    justify-content: center;
  }
  
  .toast-notification {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    font-size: 0.82rem;
  }
  
  .cart-drawer {
    width: 100vw !important;
    max-width: 100vw !important;
  }
  
  .mobile-nav-drawer {
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 1.5rem 1.25rem !important;
  }
}

/* Compact Mobile (360px down to 320px) */
@media (max-width: 360px) {
  :root {
    --container-padding: 12px;
  }
  
  .hero-content h1 {
    font-size: 1.9rem !important;
    line-height: 1.15 !important;
  }
  
  .section-header h2 {
    font-size: 1.6rem !important;
  }
  
  .btn {
    padding: 0.75rem 1rem !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.1em !important;
  }
  
  .header-actions {
    gap: 0.4rem !important;
  }
  
  .contact-info-card {
    padding: 1.25rem 0.9rem !important;
  }
  
  .contact-info-card + div {
    padding: 1.25rem 0.9rem !important;
  }
  
  .story-quote {
    padding-left: 1rem !important;
    font-size: 1rem !important;
  }
  
  .editorial-quote-wrap blockquote {
    font-size: 1.25rem !important;
  }
}
