/* ================================================================
   DECOR GALLERY — Fully Mobile-First Responsive CSS
   Breakpoints: 320px | 480px | 768px | 1024px | 1280px
   This file overrides all fixed widths and hard-coded layouts
   ================================================================ */

/* ── 1. Universal Box Model & Overflow Lock ── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
*, *::before, *::after {
  box-sizing: border-box;
}
body {
  overflow-x: hidden;
  min-width: 0;
  width: 100%;
}
img, video, iframe, svg, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── 2. Container — fluid padding on small screens ── */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 480px)  { .container { padding: 0 20px; } }
@media (min-width: 768px)  { .container { padding: 0 28px; } }
@media (min-width: 1024px) { .container { padding: 0 40px; } }
@media (min-width: 1280px) { .container { padding: 0 48px; } }

/* ── 3. Section spacing ── */
.section     { padding: 60px 0; }
.section-sm  { padding: 36px 0; }
.section-header { margin-bottom: 36px; }
@media (max-width: 768px) {
  .section    { padding: 44px 0; }
  .section-sm { padding: 28px 0; }
  .section-header { margin-bottom: 28px; }
  .section-header p { font-size: 0.9rem; }
}
@media (max-width: 480px) {
  .section    { padding: 36px 0; }
  .section-sm { padding: 20px 0; }
}

/* ── 4. Fluid typography with clamp ── */
h1 { font-size: clamp(1.75rem, 6vw, 3.8rem); }
h2 { font-size: clamp(1.35rem, 4vw, 2.4rem); }
h3 { font-size: clamp(1rem, 2.5vw, 1.25rem); }
p  { font-size: clamp(0.875rem, 2vw, 1.05rem); line-height: 1.65; }

@media (max-width: 480px) {
  h1 { font-size: clamp(1.6rem, 8vw, 2.2rem); }
  h2 { font-size: clamp(1.2rem, 6vw, 1.7rem); }
}

/* No text overflow anywhere */
h1, h2, h3, h4, h5, h6, p, span, a, li {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ================================================================
   5. NAVBAR
   ================================================================ */
.navbar {
  width: 100%;
  max-width: 100%;
}
.nav-inner {
  width: 100%;
  gap: 12px;
}

/* Hide desktop links on mobile, show hamburger */
@media (max-width: 900px) {
  :root { --nav-height: 62px; }

  .nav-links      { display: none !important; }
  .nav-hamburger  { display: flex !important; }

  .site-logo-img  { height: 36px; }

  .nav-icon-btn {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
  .nav-actions {
    gap: 6px;
  }
}

/* Full-width slide-down mobile menu */
.mobile-menu {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  width: 100%;
  background: var(--white);
  box-shadow: 0 12px 40px rgba(44,24,16,0.14);
  z-index: 998;
  flex-direction: column;
  gap: 2px;
  padding: 16px 16px 24px;
  transform: translateY(-10px);
  opacity: 0;
  display: none;
  max-height: calc(100dvh - var(--nav-height));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.mobile-menu.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}
.mobile-menu a {
  width: 100%;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--charcoal);
  transition: background 0.2s, color 0.2s;
}
.mobile-menu a:hover,
.mobile-menu a.active {
  background: var(--beige);
  color: var(--wood);
}

/* iOS safe area notch support */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-menu      { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .toast-container  { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* ================================================================
   6. BUTTONS — Minimum 44px tap target + full-width on mobile
   ================================================================ */
.btn {
  min-height: 44px;
  padding: 12px 28px;
  white-space: nowrap;
  touch-action: manipulation;
  max-width: 100%;
}
.btn-sm  { min-height: 38px; padding: 9px 18px; }
.btn-lg  { min-height: 52px; padding: 15px 36px; }

@media (max-width: 480px) {
  .btn-lg { padding: 14px 24px; font-size: 0.95rem; }

  /* Hero CTAs stack full-width on small mobile */
  .hero-cta { flex-direction: column; align-items: stretch; gap: 12px; width: 100%; }
  .hero-cta .btn { width: 100%; justify-content: center; }

  /* Product full-width buttons on mobile pages */
  .product-action-group .btn { width: 100%; justify-content: center; }
}

/* ================================================================
   7. HERO SECTION
   ================================================================ */
.hero {
  min-height: 100svh;
  padding-top: var(--nav-height);
}
.hero-content {
  max-width: 100%;
  padding: 24px 0;
}
.hero-desc { font-size: clamp(0.9rem, 2.5vw, 1.1rem); }

@media (max-width: 900px) {
  .hero { min-height: 90svh; }
  .hero-stats  { display: none; }
  .hero-scroll { display: none; }
}
@media (max-width: 768px) {
  .hero { min-height: 85svh; }
  .hero-content { max-width: 100%; }
  .hero-cta { gap: 12px; }
}
@media (max-width: 480px) {
  .hero { min-height: 92svh; }
  .hero-eyebrow { font-size: 0.68rem; }
}

/* ================================================================
   8. PRODUCT GRID — 1 → 2 → 3 → 4 columns
   ================================================================ */
.products-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, 1fr); /* mobile default = 2 col */
}
@media (min-width: 600px)  { .products-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (min-width: 900px)  { .products-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
@media (min-width: 1200px) { .products-grid { grid-template-columns: repeat(4, 1fr); gap: 28px; } }

/* Single column on very small phones */
@media (max-width: 360px) {
  .products-grid { grid-template-columns: 1fr; }
}

/* Product card mobile polish */
@media (max-width: 600px) {
  .product-card-body      { padding: 12px 14px 14px; }
  .product-card-body h3   { font-size: 0.875rem; line-height: 1.35; }
  .price                  { font-size: 1rem; }
  .price-old              { font-size: 0.75rem; }
  .product-card-footer    { gap: 6px; margin-top: 8px; }
  .add-cart-btn           { width: 40px; height: 40px; font-size: 0.9rem; flex-shrink: 0; }
  .stars i                { font-size: 0.65rem; }
  .stars span             { font-size: 0.72rem; }
}
@media (max-width: 360px) {
  .product-card-body h3 { font-size: 0.8rem; }
}

/* Always show action buttons on touch (no hover) */
@media (hover: none) {
  .product-card-actions {
    transform: translateX(0);
    opacity: 1;
  }
  .product-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }
  .btn:hover,
  .btn-primary:hover,
  .btn-gold:hover,
  .btn-secondary:hover,
  .btn-white:hover {
    transform: none;
  }
  .category-card:hover img  { transform: none; }
  .social-link:hover        { transform: none; }
  .testimonial-card:hover   { transform: none; }
}

/* ================================================================
   9. CATEGORIES GRID
   ================================================================ */
.categories-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 768px) {
  .category-card       { aspect-ratio: 4/3; }
  .category-card:first-child { grid-row: auto; aspect-ratio: 4/3; }
}
@media (max-width: 400px) {
  .categories-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   10. SHOP LAYOUT (Products Page) — Sidebar + Grid
   ================================================================ */
.shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 900px) {
  .shop-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Collapsible filter sidebar on mobile */
  .filter-sidebar {
    position: static !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    border: none;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border-radius: var(--radius-md);
  }
  .filter-sidebar.filter-open {
    max-height: 1000px;
    border: 1.5px solid var(--beige-dark);
    background: var(--white);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
  }

  /* Filter toggle button — shown by JS on mobile */
  .filter-toggle-btn {
    display: flex !important;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--white);
    border: 1.5px solid var(--beige-dark);
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--brown-dark);
    margin-bottom: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    min-height: 48px;
    box-shadow: var(--shadow-sm);
  }
}
.filter-toggle-btn { display: none; } /* hidden on desktop */

/* Sort bar */
@media (max-width: 600px) {
  .shop-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .shop-sort {
    width: 100%;
    padding: 12px 14px;
    min-height: 44px;
  }
}

/* ================================================================
   11. PRODUCT DETAIL PAGE
   ================================================================ */
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 900px) {
  .product-detail-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}
@media (max-width: 768px) {
  .product-detail-info h1   { font-size: clamp(1.3rem, 5vw, 1.8rem); }
  .product-price-block .price { font-size: 1.5rem; }
  .gallery-thumbs { gap: 8px; flex-wrap: wrap; }
  .thumb          { width: 64px; height: 64px; }
  .product-qty-group,
  .qty-block      { flex-wrap: wrap; gap: 10px; }
  .product-action-group { flex-direction: column; }
  .product-action-group .btn { width: 100%; justify-content: center; }
}

/* ================================================================
   12. CART PAGE
   ================================================================ */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 1024px) {
  .cart-layout { grid-template-columns: 1fr 300px; gap: 24px; }
}
@media (max-width: 900px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; margin-top: 0; }
}

/* Cart item row */
.cart-item {
  display: grid;
  grid-template-columns: 100px 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.cart-item-img {
  width: 100px;
  height: 88px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--grey-light);
  flex-shrink: 0;
}
.cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 768px) {
  .cart-item {
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto auto;
    gap: 10px;
    padding: 14px;
  }
  .cart-item-img  { width: 80px; height: 70px; grid-row: span 3; }
  .cart-item-info { grid-column: 2; }
  .qty-control    { grid-column: 2; }
  .cart-item-price { grid-column: 2; }
  .cart-item-remove {
    position: absolute;
    top: 10px;
    right: 10px;
  }
  .cart-item { position: relative; }
}
@media (max-width: 480px) {
  .qty-input { width: 40px; font-size: 0.9rem; }
}

/* ================================================================
   13. CHECKOUT PAGE
   ================================================================ */
.checkout-grid,
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 1024px) {
  .checkout-grid,
  .checkout-layout { grid-template-columns: 1fr 320px; gap: 24px; }
}
@media (max-width: 900px) {
  .checkout-grid,
  .checkout-layout {
    grid-template-columns: 1fr;
  }
  .order-summary-card,
  .checkout-sidebar { position: static !important; }
}
@media (max-width: 480px) {
  .checkout-card { padding: 18px 16px; }
  .checkout-wrapper { padding: 20px 0 60px; }
  .form-row { grid-template-columns: 1fr !important; }
  .pay-btn  { padding: 16px; font-size: 1rem; }
  .checkout-steps { gap: 0; overflow-x: auto; padding-bottom: 8px; }
  .checkout-steps::-webkit-scrollbar { display: none; }
}

/* ================================================================
   14. FORMS — Full width, prevent iOS zoom
   ================================================================ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; gap: 12px; }
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  font-size: 16px; /* prevents iOS Safari auto-zoom on focus */
}
@media (min-width: 769px) {
  /* Allow normal size on desktop */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  select,
  textarea { font-size: inherit; }
}

/* Input minimum height for tap targets */
input, select, textarea {
  min-height: 44px;
}
textarea { min-height: auto; }

/* Newsletter form */
.newsletter-form {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}
@media (max-width: 600px) {
  .newsletter-form {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .newsletter-form input  { width: 100%; border-radius: var(--radius-md) !important; }
  .newsletter-form .btn   { width: 100%; justify-content: center; border-radius: var(--radius-md) !important; }
}

/* ================================================================
   15. FOOTER
   ================================================================ */
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
}
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-brand { grid-column: auto; }
  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  .footer-bottom-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
}

/* ================================================================
   16. TESTIMONIALS
   ================================================================ */
.testimonials-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .testimonials-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .testimonial-card { padding: 20px; }
}

/* ================================================================
   17. ABOUT PAGE
   ================================================================ */
.about-story-grid,
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.mission-grid,
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) {
  .about-story-grid,
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .mission-grid { grid-template-columns: repeat(2, 1fr); }
  .values-grid  { grid-template-columns: repeat(2, 1fr); }
  .about-hero   { min-height: 50vh; }
}
@media (max-width: 600px) {
  .mission-grid,
  .values-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   18. CONTACT PAGE
   ================================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .map-wrap     { height: 260px; }
}

/* ================================================================
   19. AUTH PAGES (Login / Signup)
   ================================================================ */
@media (max-width: 900px) {
  .auth-panel-left  { display: none; }
  .auth-panel-right { width: 100% !important; padding: 48px 28px; }
}
@media (max-width: 480px) {
  .auth-panel-right { padding: 36px 18px !important; }
  .auth-form-header h1 { font-size: 1.6rem; }
}

/* ================================================================
   20. TOAST NOTIFICATIONS
   ================================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 40px);
}
@media (max-width: 600px) {
  .toast-container {
    right: 12px;
    left: 12px;
    bottom: 16px;
    max-width: 100%;
  }
  .toast {
    min-width: auto;
    width: 100%;
    font-size: 0.85rem;
    padding: 12px 16px;
  }
}

/* ================================================================
   21. USER DROPDOWN
   ================================================================ */
.wc-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  display: none;
  overflow: hidden;
  border: 1px solid rgba(196,149,106,0.12);
}
.wc-dropdown.open { display: block; animation: toastSlideIn 0.2s ease; }
@media (max-width: 768px) {
  .wc-dropdown {
    position: fixed;
    top: var(--nav-height);
    right: 0;
    left: 0;
    width: 100%;
    min-width: unset;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border-top: 1px solid var(--beige);
    max-height: calc(100dvh - var(--nav-height));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .wc-uname { display: none; }
}

/* ================================================================
   22. ORDERS MODAL
   ================================================================ */
.wc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44,24,16,0.5);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.wc-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
@media (max-width: 600px) {
  .wc-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .wc-modal {
    max-height: 92dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-width: 100%;
  }
  .wc-modal-body   { padding: 16px 18px 28px; -webkit-overflow-scrolling: touch; }
  .wc-modal-header { padding: 18px 18px 14px; }
}

/* ================================================================
   23. ADMIN PANEL
   ================================================================ */
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr !important; }
  .admin-sidebar {
    position: fixed;
    left: -280px;
    top: 0; bottom: 0;
    width: 260px;
    z-index: 1100;
    transition: left 0.28s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  }
  .admin-sidebar.open { left: 0; }
  .admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1099;
  }
  .admin-sidebar.open + .admin-sidebar-overlay { display: block; }
  .admin-main { padding: 16px; }
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
}
@media (max-width: 480px) {
  .admin-stats-grid { grid-template-columns: 1fr !important; }
}

/* ================================================================
   24. TABLES — Horizontal scroll on mobile
   ================================================================ */
.admin-table-wrap,
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
table { min-width: 500px; width: 100%; }

/* ================================================================
   25. TOUCH TARGETS — All interactive elements ≥ 44px
   ================================================================ */
.qty-btn,
.cart-item-remove,
.product-action-btn,
.add-cart-btn,
.nav-icon-btn,
.nav-hamburger,
.wc-modal-close,
.filter-toggle-btn,
.wc-user-btn,
.thumb,
.social-link,
.wc-dropdown-item {
  min-width:  44px;
  min-height: 44px;
}

@media (max-width: 480px) {
  .qty-btn      { width: 44px; height: 44px; font-size: 1rem; }
  .qty-input    { width: 44px; text-align: center; }
  .add-cart-btn { width: 44px; height: 44px; }
  .filter-option { min-height: 44px; display: flex; align-items: center; }
}

/* ================================================================
   26. iOS SMOOTH SCROLL on scrollable containers
   ================================================================ */
.wc-modal-body,
.wc-dropdown,
.mobile-menu,
.table-responsive,
.admin-table-wrap,
.cart-list,
.gallery-thumbs,
.checkout-steps {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ================================================================
   27. PERFORMANCE — Reduce paint on coarse-pointer (touch) devices
   ================================================================ */
@media (pointer: coarse) {
  .product-card         { box-shadow: 0 2px 8px rgba(44,24,16,0.07); }
  .product-card:hover   { box-shadow: 0 4px 16px rgba(44,24,16,0.10); }
}

/* ================================================================
   28. PREFERS-REDUCED-MOTION — Disable all animations
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration:        0.01ms !important;
    animation-iteration-count: 1      !important;
    transition-duration:       0.01ms !important;
    scroll-behavior:           auto   !important;
  }
  .skeleton {
    animation: none;
    background: var(--beige);
  }
  .reveal,
  .reveal.visible {
    opacity:   1 !important;
    transform: none !important;
    transition: none !important;
  }
  .btn-primary::after,
  .btn-gold::after { display: none; }
  .hero-bg { transition: none !important; }
}

/* ================================================================
   29. IMAGE UTILITIES
   ================================================================ */
.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.img-contain {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Brand logo */
.site-logo-img {
  height: 44px;
  width: auto;
  display: block;
  object-fit: contain;
  max-width: 140px;
}
@media (max-width: 480px) { .site-logo-img { height: 34px; } }
.footer-logo-text {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ================================================================
   30. VISIBILITY UTILITIES
   ================================================================ */
.mobile-only    { display: none !important; }
.desktop-only   { display: block; }
.mobile-flex    { display: none !important; }
.mobile-hidden  { display: block; }

@media (max-width: 768px) {
  .mobile-only   { display: block  !important; }
  .desktop-only  { display: none   !important; }
  .mobile-flex   { display: flex   !important; }
  .mobile-hidden { display: none   !important; }
}

/* ================================================================
   31. HERO STATS (hidden on mobile, visible on desktop)
   ================================================================ */
.hero-stats  { display: none; }
@media (min-width: 1024px) {
  .hero-stats {
    display: flex;
    position: absolute;
    bottom: 60px;
    right: 60px;
    z-index: 2;
    gap: 32px;
  }
}

/* ================================================================
   32. WHY-US / FEATURES GRID
   ================================================================ */
.features-grid,
.why-us-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (min-width: 900px) {
  .features-grid,
  .why-us-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
  .features-grid,
  .why-us-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   33. PAGE HERO (banner at top of inner pages)
   ================================================================ */
.page-hero {
  margin-top: var(--nav-height);
  padding: clamp(36px, 6vw, 72px) 0;
  overflow: hidden;
}
.page-hero h1 {
  font-size: clamp(1.5rem, 5vw, 2.8rem);
}

/* ================================================================
   34. STAR RATINGS row
   ================================================================ */
.product-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ================================================================
   35. OVERFLOW GUARD — prevent any element from escaping viewport
   ================================================================ */
html {
  overflow-x: hidden;
}
body {
  max-width: 100%;
  overflow-x: hidden;
}

.hero,
.footer,
.page-hero,
.section,
.products-grid,
.categories-grid,
.footer-grid,
.cart-layout,
.checkout-grid,
.shop-layout {
  max-width: 100%;
  overflow-x: hidden;
}

.container {
  max-width: 100%;
}

/* ================================================================
   36. MOBILE-SPECIFIC HARD OVERRIDES (≤ 600px)
   Catches ANY inline-style grids that may overflow
   ================================================================ */
@media (max-width: 600px) {

  /* Force all grids to single column if they would overflow */
  [style*="grid-template-columns:repeat(4"] ,
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  [style*="grid-template-columns:repeat(3"] ,
  [style*="grid-template-columns: repeat(3"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Products grid = 2 cols on mobile, 1 on tiny */
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  /* Categories = 2 cols */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  /* Category cards — uniform on small screens */
  .category-card,
  .category-card:first-child {
    aspect-ratio: 4/3 !important;
    grid-row: auto !important;
  }

  /* Detail grid */
  .detail-grid,
  .product-detail-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Thumbnails wrap don't overflow */
  .gallery-thumbs {
    flex-wrap: wrap;
    gap: 8px;
  }
  .thumb { width: 60px !important; height: 60px !important; }

  /* Reviews grid stack */
  .reviews-grid {
    grid-template-columns: 1fr !important;
  }

  /* Misc containers */
  .checkout-card { padding: 16px 14px !important; }
  .section { padding: 32px 0 !important; }
  .container { padding: 0 14px !important; }

  /* Ensure fluid media elements don't overflow */
  img, picture, video, iframe, embed, object, svg, canvas,
  .responsive-media, .prevent-overflow {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 360px) {
  .products-grid   { grid-template-columns: 1fr !important; }
  .categories-grid { grid-template-columns: 1fr !important; }
}
