/* ==========================================================
   Sri Krishna Fireworks - UI Polish Layer
   Loaded AFTER style.css / animations.css to refine spacing,
   touch targets, and layout behaviour on real mobile & desktop
   viewports without disturbing the existing design tokens.
   ========================================================== */

/* ---- Global safe-area & tap target baseline ---- */
:root {
  --polish-radius: 14px;
}

* , *::before, *::after { -webkit-tap-highlight-color: transparent; }

html, body { overflow-x: hidden; }

a, button, .btn, .nav-item, .mobile-links-list a {
  -webkit-user-select: none;
}

/* Every interactive control gets a comfortable minimum touch target on touch devices */
@media (pointer: coarse) {
  .btn, button, .nav-item, .mobile-menu-toggle, .theme-toggle-btn,
  .form-control, .form-select, select, input[type="text"], input[type="tel"],
  input[type="email"], input[type="number"] {
    min-height: 44px;
  }
  /* Exclude banner controls and small floating icons from bloated touch targets */
  .slider-arrow, .slider-dot {
    min-height: unset !important;
    min-width: unset !important;
  }
}

/* ---- Top utility bar: continuous ticker container ---- */
.top-utility-bar {
  overflow: hidden !important;
}
.top-utility-bar::-webkit-scrollbar { display: none; }

/* ---- Header: tighten on mobile, keep logo/brand legible ---- */
@media (max-width: 991px) {
  .main-site-header .header-inner { padding-top: 0.5rem; padding-bottom: 0.5rem; }
  .brand-title { font-size: 1.05rem; }
  .brand-sub { font-size: 0.68rem; }
  .btn-cta-calculate span { display: none; } /* icon-only CTA on small screens to save space */
  .btn-cta-calculate { padding: 0.6rem 0.8rem; }
}

@media (max-width: 400px) {
  .logo-icon { display: none; }
}

/* ---- Mobile nav drawer: ensure it's above everything and scrollable ---- */
.mobile-nav-drawer {
  max-width: 82vw;
  overflow-y: auto;
  padding-bottom: 2rem;
}
.mobile-links-list a {
  padding: 0.9rem 1rem;
  display: block;
  border-radius: 10px;
}

/* ---- Container fluid breathing room on small screens ---- */
@media (max-width: 480px) {
  .container, .container-nav { padding-left: 0.75rem; padding-right: 0.75rem; }
}

/* ---- Cards & grids: fluid columns instead of fixed widths ---- */
.categories-grid, .category-grid, .product-grid, .cracker-grid, .cards-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 768px) {
  .categories-grid, .category-grid, .product-grid, .cracker-grid, .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .category-card {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0.85rem 0.5rem !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
}
@media (max-width: 380px) {
  .categories-grid, .category-grid, .product-grid, .cracker-grid, .cards-grid {
    gap: 0.45rem !important;
  }
  .category-card {
    padding: 0.7rem 0.35rem !important;
  }
}

/* ---- Any wide table (pricelist etc.) becomes horizontally scrollable
       inside its own box instead of breaking page layout ---- */
.table-responsive, .pricelist-table-wrap, table.pricelist-table {
  -webkit-overflow-scrolling: touch;
}
table {
  max-width: 100%;
}

/* ---- Forms: full-width, comfortably spaced fields on phones ---- */
@media (max-width: 576px) {
  .form-label { font-size: 0.85rem; }
  .form-control, .form-select, input, textarea, select {
    font-size: 1rem !important; /* prevents iOS Safari auto-zoom on focus */
  }
  .row.g-3 > *, .row.g-4 > * { margin-bottom: 0.25rem; }
}

/* ---- Buttons stack cleanly on small screens instead of overflowing ---- */
@media (max-width: 480px) {
  .btn-group-responsive, .d-flex.gap-2:not(.utility-left):not(.utility-right) {
    flex-wrap: wrap;
  }
}

/* ---- Sticky/fixed elements respect device safe areas (notches, home bar) ---- */
.main-site-header {
  padding-top: env(safe-area-inset-top, 0px);
}
.mobile-nav-drawer {
  padding-top: calc(1rem + env(safe-area-inset-top, 0px));
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
}

/* ---- Footer: compact, readable and naturally stacked on mobile ---- */
@media (max-width: 768px) {
  .site-footer {
    padding: 1.75rem 0 calc(1.75rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  .site-footer .container, .site-footer .container-nav {
    text-align: left !important;
  }
  .site-footer .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.25rem !important;
    margin-bottom: 1.5rem !important;
  }
  .footer-brand {
    grid-column: 1 / -1 !important;
  }
  .footer-brand p {
    font-size: 0.84rem !important;
    line-height: 1.5 !important;
    margin-bottom: 0.5rem;
  }
  .footer-col-title {
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-bottom: 0.5rem !important;
  }
  .footer-links {
    gap: 0.4rem !important;
  }
  .footer-links a {
    font-size: 0.82rem !important;
    padding: 3px 0 !important;
    display: inline-block;
  }
  .footer-grid > div:last-child {
    grid-column: 1 / -1 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1rem;
  }
  .footer-bottom {
    padding-top: 1rem !important;
    font-size: 0.75rem !important;
    text-align: center !important;
  }
}

/* ---- Desktop refinement: cap hero/content width so ultra-wide screens
       don't stretch text into unreadable full-bleed lines ---- */
@media (min-width: 1400px) {
  .container, .container-nav { max-width: 1320px; }
}

/* ---- Images: avoid layout shift / oversized banners ---- */
.hero-banner img, .banner-slide img, .promo-banner img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ---- Focus visibility for accessibility & keyboard users ---- */
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold-primary, #f59e0b);
  outline-offset: 2px;
}

/* ---- Reduce motion for users who prefer it (fireworks canvas etc.) ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---- Prevent horizontal scroll from oversized fixed-width elements ---- */
.fireworks-canvas, #fireworks {
  max-width: 100vw;
}

/* ---- Floating Quick Action Buttons: compact, touch-friendly, positioned safely above sticky dock ---- */
.floating-actions-left {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 12px;
  z-index: 1030;
  display: flex;
  flex-direction: column-reverse; /* WhatsApp at bottom, then Call, then Map */
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  transition: bottom 0.25s ease;
}

/* Hero Action Buttons - Clean separation and touch spacing */
.hero-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 1.25rem !important;
  flex-wrap: wrap !important;
  margin: 1.75rem auto 2.25rem auto !important;
}

@media (max-width: 640px) {
  .hero-actions {
    flex-direction: column !important;
    gap: 0.95rem !important;
    margin-top: 1.5rem !important;
    margin-bottom: 2.25rem !important;
    width: 100% !important;
  }

  .hero-actions .btn {
    width: 100% !important;
    max-width: 320px !important;
    justify-content: center !important;
  }
}

body.has-calc-dock .floating-actions-left,
body:has(.sticky-calc-dock) .floating-actions-left,
body:has(.pricelist-calc-dock) .floating-actions-left {
  bottom: calc(var(--calc-dock-height, 125px) + 12px + env(safe-area-inset-bottom, 0px)) !important;
}

.floating-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  border-radius: 50% !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.floating-btn svg {
  width: 20px !important;
  height: 20px !important;
}

/* Back to Top Modern Floating Button (Neat Circular UI) */
.scroll-top-btn,
#scroll-top-btn {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 1030;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(26, 32, 53, 0.94) 0%, rgba(11, 15, 25, 0.98) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.55);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 14px rgba(245, 158, 11, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0;
  outline: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.85);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s,
              background 0.25s,
              border-color 0.25s,
              box-shadow 0.25s,
              color 0.25s,
              bottom 0.25s ease;
}

.scroll-top-btn.visible,
#scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.scroll-top-btn:hover,
#scroll-top-btn:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  border-color: #fef08a;
  color: #ffffff;
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.55), 0 0 20px rgba(239, 68, 68, 0.4);
}

.scroll-top-btn:active,
#scroll-top-btn:active {
  transform: translateY(-1px) scale(0.96);
}

.scroll-top-btn svg,
#scroll-top-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  transition: transform 0.2s ease;
}

.scroll-top-btn:hover svg,
#scroll-top-btn:hover svg {
  transform: translateY(-2px);
}

/* Light Theme */
[data-theme="light"] .scroll-top-btn,
[data-theme="light"] #scroll-top-btn {
  background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
  border: 1.5px solid rgba(217, 119, 6, 0.55);
  color: #d97706;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12), 0 0 12px rgba(245, 158, 11, 0.2);
}

[data-theme="light"] .scroll-top-btn:hover,
[data-theme="light"] #scroll-top-btn:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  border-color: #d97706;
  color: #ffffff;
}

@media (max-width: 768px) {
  .scroll-top-btn,
  #scroll-top-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    right: 14px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .scroll-top-btn svg,
  #scroll-top-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* Safe clearance above pricelist dock */
body.has-calc-dock .scroll-top-btn,
body:has(.sticky-calc-dock) .scroll-top-btn,
body:has(.pricelist-calc-dock) .scroll-top-btn,
body.has-calc-dock #scroll-top-btn,
body:has(.sticky-calc-dock) #scroll-top-btn,
body:has(.pricelist-calc-dock) #scroll-top-btn {
  bottom: calc(var(--calc-dock-height, 125px) + 14px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ==========================================================
   Storefront Specific Polish & Contrast Enforcement
   ========================================================== */

/* Category Tabs Toolbar */
.pricelist-toolbar {
  position: sticky;
  top: 72px;
  z-index: 100;
  background-color: rgba(7, 11, 20, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.85rem 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.toolbar-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Search Box & Clear Button Polish */
.search-box {
  display: flex;
  align-items: center;
  position: relative;
  background: var(--bg-input, #0b1120);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill, 9999px);
  padding: 0 10px 0 14px;
  flex: 1;
  max-width: 480px;
  min-width: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--primary-accent, #f59e0b);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
  background: rgba(15, 23, 42, 0.95);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  color: var(--text-primary, #ffffff) !important;
  font-size: 0.9rem;
  padding: 0.65rem 0.5rem 0.65rem 2.4rem !important;
  outline: none !important;
  box-shadow: none !important;
}

.search-box input::placeholder {
  color: var(--text-muted, #94a3b8);
  opacity: 0.85;
}

.search-box .search-icon {
  width: 18px;
  height: 18px;
  fill: var(--text-muted, #94a3b8);
  flex-shrink: 0;
  transition: fill 0.2s ease;
}

.search-box:focus-within .search-icon {
  fill: var(--primary-accent, #f59e0b);
}

/* Clear Search Button - Modern Pill Badge UI */
.search-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  margin-left: 6px;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.search-clear svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.5;
  display: block;
  transition: stroke 0.2s ease, transform 0.2s ease;
}

.search-clear:hover,
.search-clear:focus-visible {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fbbf24;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.search-clear:active {
  transform: scale(0.92);
  background: rgba(245, 158, 11, 0.4);
}

[data-theme="light"] .search-box {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .search-box:focus-within {
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

[data-theme="light"] .search-clear {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

[data-theme="light"] .search-clear:hover,
[data-theme="light"] .search-clear:focus-visible {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}

.category-tabs-wrapper {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-top: 0.5rem;
}
.category-tabs-wrapper::-webkit-scrollbar { display: none; }

.category-tabs {
  display: flex;
  gap: 0.5rem;
  padding-bottom: 4px;
}

.tab-btn {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #ffffff;
  border-color: var(--primary-accent);
  background: var(--bg-elevated);
}

.tab-btn.active {
  background: var(--primary-accent) !important;
  color: #070b14 !important;
  border-color: var(--primary-accent) !important;
  font-weight: 700;
}

/* ==========================================================
   Product Grid & Responsive Catalogue (Section 8 & 9)
   ========================================================== */
.products-grid, .product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

.product-row {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.product-row:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.discount-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--emerald-primary, #10b981);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.product-left {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 0.85rem;
  width: 100%;
}

.product-thumb {
  width: 100%;
  height: 220px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(180deg, #0f172a 0%, #070b14 100%);
  position: relative;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s ease;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  display: block;
  padding: 4px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-row:hover .product-thumb img {
  transform: scale(1.06);
}

.thumb-zoom-icon {
  position: absolute;
  bottom: 8px;
  right: 8px;
  left: auto;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fbbf24;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 3px;
  transition: all 0.2s ease;
}

.product-thumb:hover .thumb-zoom-icon {
  background: #f59e0b;
  color: #070b14;
  border-color: #f59e0b;
}

[data-theme="light"] .product-thumb {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .thumb-zoom-icon {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #cbd5e1;
  color: #d97706;
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-code {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-title {
  font-size: 0.98rem !important;
  font-weight: 700;
  color: var(--text-primary) !important;
  margin: 0.15rem 0 0.35rem 0;
  line-height: 1.3;
  word-break: break-word;
}

.product-pack {
  font-size: 0.8rem;
  color: var(--text-muted) !important;
}

.product-pricing {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.price-actual {
  font-size: 0.85rem;
  color: #94a3b8;
  text-decoration: line-through;
}

.price-discount {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-gold-highlight) !important;
}

.product-actions-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.product-qty-ctrl {
  display: inline-flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-btn {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: none;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}

.qty-btn:hover {
  background: var(--primary-accent);
  color: #070b14;
}

.qty-input {
  width: 44px !important;
  height: 36px !important;
  text-align: center;
  background: transparent !important;
  border: none !important;
  color: var(--text-primary) !important;
  font-weight: 700;
  padding: 0 !important;
  font-size: 1rem !important;
}

.product-subtotal-box {
  text-align: right;
}

.product-subtotal-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* 2-Column Mobile Catalog (361px to 768px: compact, clean touch-friendly browsing) */
@media (min-width: 361px) and (max-width: 768px) {
  .products-grid, .product-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
  }
  .product-row {
    padding: 0.75rem 0.6rem !important;
    border-radius: 12px;
  }
  .discount-badge {
    top: 6px;
    right: 6px;
    font-size: 0.65rem;
    padding: 2px 5px;
  }
  .product-left {
    flex-direction: column !important;
    gap: 0.45rem !important;
    margin-bottom: 0.45rem !important;
  }
  .product-thumb {
    width: 100% !important;
    height: 165px !important;
    border-radius: 8px;
  }
  .product-thumb img {
    padding: 3px !important;
  }
  .product-title {
    font-size: 0.86rem !important;
    line-height: 1.25;
    margin: 0.15rem 0 0.25rem 0;
    min-height: 2.2em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .product-code, .product-pack {
    font-size: 0.72rem;
  }
  .product-pricing {
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
  }
  .price-actual {
    font-size: 0.78rem;
  }
  .price-discount {
    font-size: 1.1rem !important;
  }
  .product-actions-wrapper {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.4rem !important;
    padding-top: 0.5rem !important;
  }
  .product-qty-ctrl {
    width: 100%;
    justify-content: space-between;
    height: 36px;
  }
  .qty-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
  }
  .qty-input {
    flex: 1;
    width: auto !important;
    height: 36px !important;
  }
  .product-subtotal-box {
    text-align: center !important;
  }
  .product-subtotal-val {
    font-size: 0.92rem !important;
  }
}

/* 1-Column Very Small Screen Catalog (<= 360px: 320px & 360px prioritize readability) */
@media (max-width: 360px) {
  .products-grid, .product-list {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
  .product-row {
    padding: 0.85rem !important;
  }
  .product-left {
    flex-direction: column !important;
    gap: 0.5rem !important;
    margin-bottom: 0.65rem !important;
  }
  .product-thumb {
    width: 100% !important;
    height: 180px !important;
  }
  .product-thumb img {
    padding: 4px !important;
  }
  .product-title {
    font-size: 0.92rem !important;
  }
  .product-actions-wrapper {
    padding-top: 0.6rem !important;
  }
}

/* ==========================================================
   Mobile Bottom Cart / Order Summary (Section 4)
   ========================================================== */
.sticky-calc-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1035;
  background: rgba(7, 11, 20, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.75);
  padding: 0.65rem 0 calc(0.65rem + env(safe-area-inset-bottom, 0px));
}

.calc-dock-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.calc-metrics {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 2rem);
  flex-wrap: wrap;
}

.calc-metric-item {
  display: flex;
  flex-direction: column;
}

.calc-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted) !important;
  font-weight: 600;
}

.calc-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-heading);
}

.calc-value.savings {
  color: #10b981 !important;
}

.calc-value.net-amount {
  color: var(--text-gold-highlight) !important;
  font-size: 1.3rem;
}

[data-theme="light"] .sticky-calc-dock {
  background: rgba(255, 255, 255, 0.96) !important;
  border-top: 1px solid rgba(217, 119, 6, 0.4) !important;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.1) !important;
}

/* Mobile Compact Summary Dock (<= 680px) */
@media (max-width: 680px) {
  .sticky-calc-dock {
    padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  .calc-dock-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.4rem !important;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }
  .calc-metrics {
    display: grid !important;
    grid-template-columns: 1fr 1.25fr 1.25fr !important;
    text-align: center;
    gap: 4px !important;
    width: 100% !important;
  }
  .calc-metric-item:nth-child(2) {
    display: none !important; /* Hide Total MRP on mobile to keep QTY, YOU SAVE, TOTAL clean */
  }
  .calc-metric-item {
    padding: 2px 4px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
  }
  .calc-label {
    font-size: 0.65rem !important;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-muted);
  }
  .calc-value {
    font-size: 1.05rem !important;
    font-weight: 800;
    line-height: 1.2;
  }
  .calc-value.savings {
    color: #10b981 !important;
  }
  .calc-value.net-amount {
    color: var(--text-gold-highlight) !important;
    font-size: 1.15rem !important;
  }
  .calc-dock-action {
    width: 100%;
  }
  .btn-calc-order-now, #btn-open-order-modal {
    width: 100% !important;
    min-height: 48px !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.98rem !important;
    font-weight: 700;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  }
}

/* Ensure Page Content Never Hides Under Sticky Dock */
main.products-wrapper,
body.has-calc-dock main,
body:has(.sticky-calc-dock) main {
  padding-bottom: calc(var(--calc-dock-height, 125px) + 24px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ==========================================================
   Order Review & Invoicing Modal (Section 2, 3 & 13)
   ========================================================== */
.order-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 10px calc(10px + env(safe-area-inset-bottom, 0px)) 10px;
  box-sizing: border-box;
}

.order-modal-dialog {
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 20px);
  max-height: calc(100dvh - 20px);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  margin: auto;
  position: relative;
}

.order-modal-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.15rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.order-modal-header h3 {
  font-size: clamp(1rem, 4vw, 1.25rem) !important;
  line-height: 1.25;
}

.order-modal-header small {
  display: block;
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.3;
  margin-top: 2px;
}

.modal-close-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s, background-color 0.2s;
  flex-shrink: 0;
  margin-left: 0.5rem;
  padding: 0;
}

.modal-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.order-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 1rem 1.15rem 0.5rem;
  box-sizing: border-box;
}

/* Modal Table Wrapper & Table */
.table-wrapper {
  max-height: 160px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm, 8px);
  background: rgba(0, 0, 0, 0.25);
  margin-bottom: 0.85rem;
}

.modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  min-width: 320px;
}

.modal-table th {
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  z-index: 2;
  padding: 0.45rem 0.6rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.modal-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

/* Modal Financial Strip */
.modal-summary-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm, 8px);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  font-size: 0.84rem;
}

.modal-summary-strip .summary-item {
  white-space: nowrap;
}

/* Modal Form Fields */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (max-width: 540px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
  padding: 0.6rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

textarea.form-input {
  min-height: 64px;
  max-height: 110px;
  resize: vertical;
  line-height: 1.4;
}

/* Form Submit Button Spacing */
#quick-inquiry-form button[type="submit"],
.contact-card form button[type="submit"] {
  margin-top: 1.5rem !important;
}

/* In-Flow Alert Box (Section 3: Never overlay form fields, takes normal space) */
.modal-alert-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  padding: 11px 14px;
  margin: 12px 0 6px 0;
  font-size: 0.86rem;
  line-height: 1.45;
  animation: alertFadeIn 0.2s ease;
}

.modal-alert-box.alert-danger {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.modal-alert-box.alert-warning {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}

.modal-alert-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  line-height: 1.2;
}

.modal-alert-content {
  flex: 1;
  word-break: break-word;
}

.modal-alert-close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  opacity: 0.8;
  border-radius: 4px;
  flex-shrink: 0;
}

.modal-alert-close:hover {
  opacity: 1;
}

@keyframes alertFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modal Sticky Footer Actions (Section 2: Always visible, never covering content) */
.modal-footer-actions {
  position: sticky;
  bottom: 0;
  z-index: 15;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 0.85rem 1.15rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  margin: 1rem -1.15rem 0 -1.15rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.5);
}

@media (max-width: 600px) {
  .order-modal-dialog {
    width: 95vw !important;
    max-height: calc(100vh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    border-radius: 14px;
  }
  .order-modal-body {
    padding: 0.85rem 1rem 0.5rem;
  }
  .modal-footer-actions {
    flex-direction: column-reverse;
    gap: 0.5rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    margin: 0.85rem -1rem 0 -1rem;
  }
  .modal-footer-actions .btn {
    width: 100% !important;
    min-height: 48px;
    justify-content: center;
  }
  .modal-footer-actions .btn-modal-confirm {
    font-size: 1rem;
    font-weight: 700;
  }
}

/* Global Toast Positioning: Top Centered on Mobile to prevent obscuring forms */
.order-toast-container {
  position: fixed;
  top: calc(70px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  bottom: auto !important;
  right: auto !important;
  z-index: 1070;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: calc(100vw - 28px);
  max-width: 420px;
  pointer-events: none;
}

.order-toast {
  pointer-events: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

/* ==========================================================
   Compliance & Legal Banner Styling (Section 6)
   ========================================================== */
.compliance-banner {
  background: rgba(245, 158, 11, 0.04);
  border-top: 1px solid rgba(245, 158, 11, 0.15);
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
  padding: 1.25rem 0;
}

.compliance-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.compliance-inner p {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* ==========================================================
   Contact Page Mobile Fixes (No squeezed columns)
   ========================================================== */
@media (max-width: 600px) {
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  .contact-card form div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
}
