/* ================================================================
   CHARMS ACCESSORIES — UI/UX Enhancements v2
   Layered on top of app.css for non-breaking improvements
   ================================================================ */

/* ── 1. LOGO SIZE ───────────────────────────────────────────────── */
.site-logo img {
  height: 84px !important;
  width: auto !important;
}

@media (max-width: 768px) {
  .site-logo img { height: 60px !important; }
}

/* ── 2. HEADER ───────────────────────────────────────────────────── */
.site-header {
  box-shadow: 0 1px 0 rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
}

/* Header top bar — scrollable text on small screens */
.header-top {
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.header-top::-webkit-scrollbar { display: none; }

/* ── MOBILE HEADER: strip text labels, shrink gap ─────────────────
   This is the primary fix for horizontal overflow on mobile.
   On ≤768px we hide the text labels inside header-action-btn
   so only the SVG icons remain — saving ~120px of width.       */
@media (max-width: 768px) {
  .header-main { padding: 10px 0; gap: 8px; }

  /* Hide text spans inside header action buttons */
  .header-action-btn > span:last-child {
    display: none !important;
  }

  /* Tighter icon buttons */
  .header-actions { gap: 2px; margin-left: auto; }
  .header-action-btn { padding: 8px 6px; min-width: 36px; }
  .header-action-btn svg { width: 20px; height: 20px; }

  /* Prevent any horizontal bleed from the header */
  .site-header { overflow: hidden; }
}

/* ── Global overflow fix for mobile ─────────────────────────────── */
@media (max-width: 768px) {
  body { overflow-x: hidden; }
}

/* ── 3. TABLET NAV — scrollable rather than hidden ───────────────── */
@media (min-width: 769px) and (max-width: 1080px) {
  .nav-list {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav-link { padding: 14px 10px; font-size: 0.76rem; white-space: nowrap; }
}

/* ── 4. HERO — show image on tablet, overlay on mobile ──────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr 1fr !important;
    min-height: 480px;
    height: 70vh;
  }
  .hero-image { display: block !important; min-height: 480px; }
  .hero-content { padding: var(--space-10) var(--space-6); }
  .hero-title { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
}

@media (max-width: 768px) {
  .hero {
    position: relative;
    min-height: auto;
    height: auto;
    overflow: hidden;
    grid-template-columns: 1fr !important;
  }
  .hero-image {
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    height: 100% !important;
    opacity: 0.22;
    z-index: 0;
    min-height: unset !important;
  }
  /* Darken the faint background image so overlaid text stays legible */
  .hero::before { z-index: 0; }
  .hero-image::after { display: none; }
  .hero-image img { height: 100%; object-fit: cover; }
  .hero-content {
    position: relative;
    z-index: 1;
    padding: 48px 22px 52px !important;
    text-align: center;
  }
  .hero-badge,
  .hero-eyebrow { justify-content: center; }
  .hero-actions { justify-content: center; }
  .hero-title,
  .hero h1 { text-align: center; }
  .hero-desc { text-align: center; margin-left: auto; margin-right: auto; }

  /* Clean, evenly-spaced 3-up stat row with subtle dividers */
  .hero-stats {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 0 !important;
    margin: 36px auto 0 !important;
    padding-top: 24px !important;
    width: 100%;
    max-width: 420px;
  }
  .hero-stat {
    position: relative;
    padding: 0 6px;
    text-align: center;
  }
  .hero-stat + .hero-stat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 64%;
    background: rgba(255,255,255,.14);
  }
  .hero-stat-value { font-size: 1.35rem; }
  .hero-stat-label {
    display: block;
    margin-top: 3px;
    font-size: 0.6rem;
    letter-spacing: 0.07em;
    line-height: 1.3;
  }
}

/* ── 5. PRODUCT CARD IMPROVEMENTS ───────────────────────────────── */

/* Equal-height cards: pin Add-to-Cart to bottom regardless of content length */
.product-card { display: flex; flex-direction: column; }
.product-card-body { flex: 1; }

/* Portrait aspect ratio better for jewelry */
.product-card-image { aspect-ratio: 4 / 5; }

/* Always-visible quick-actions on touch (non-hover) devices */
@media (hover: none) {
  .product-card-actions {
    opacity: 1 !important;
    transform: translateX(0) !important;
    flex-direction: row;
    top: auto;
    bottom: var(--space-3);
    right: var(--space-3);
  }
}

/* Touch feedback */
@media (hover: none) {
  .product-card:active { transform: scale(0.985); box-shadow: var(--shadow-sm); }
}

/* Larger touch target for Add to Cart */
.btn-add-cart {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
}

/* Tighter card body on small screens */
@media (max-width: 480px) {
  .product-card-body  { padding: 10px 12px; }
  .product-card-footer { padding: 6px 12px 12px; }
  .product-name { font-size: 0.88rem; }
  .price-current { font-size: 1rem; }
  .card-action-btn { width: 32px; height: 32px; }
  .product-advance { font-size: 0.7rem; padding: 3px 8px; }
}

/* ── 6. CATEGORY GRID ────────────────────────────────────────────── */
.categories-grid {
  grid-template-columns: repeat(7, 1fr) !important;
}
@media (max-width: 1100px) {
  .categories-grid { grid-template-columns: repeat(4, 1fr) !important; }
}
@media (max-width: 768px) {
  .categories-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 10px !important; }
  .category-card { aspect-ratio: 3 / 4; }
}
@media (max-width: 400px) {
  .categories-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
  .category-card  { aspect-ratio: 2 / 3; }
  .category-name  { font-size: 0.75rem; }
  .category-count { font-size: 0.62rem; }
  .category-card-overlay { padding: var(--space-3); }
}

/* ── 7. TRUST BAR ────────────────────────────────────────────────── */

/* Strong gold divider so the trust bar reads as its own band, not merged
   with the hero (both share the charcoal background). */
.trust-bar {
  border-top: 3px solid var(--gold);
  background: #211814;
}

@media (max-width: 560px) {
  .trust-bar  { padding: 30px 0; }
  .trust-items { grid-template-columns: 1fr 1fr; gap: 30px 14px; }
  .trust-item  { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
  .trust-icon  { width: 46px; height: 46px; }
  .trust-label { font-size: 0.85rem; margin-bottom: 0; }
  .trust-sub   { font-size: 0.72rem; line-height: 1.35; }
}

/* ── 8. TESTIMONIALS — horizontal scroll on mobile ───────────────── */
@media (max-width: 768px) {
  .testimonials-grid {
    display: flex !important;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .testimonials-grid::-webkit-scrollbar { display: none; }
  .testimonial-card {
    min-width: 88vw;
    max-width: 340px;
    scroll-snap-align: start;
    padding: 24px;
  }
}

/* ── 9. DEAL BANNER ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .deal-banner { padding: 40px 0; }
  .countdown   { gap: 12px; }
  .countdown-value { width: 60px; height: 60px; font-size: 1.8rem; }
}

/* ── 10. NEWSLETTER ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .newsletter-form {
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
    gap: 12px;
  }
  .newsletter-form input {
    border-radius: var(--radius);
    border: 1.5px solid var(--gold-light);
    background: white;
    padding: 14px 20px;
    box-shadow: var(--shadow-sm);
  }
  .newsletter-form button {
    border-radius: var(--radius);
    padding: 14px 28px;
    width: 100%;
  }
}

/* ── 11. FOOTER ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .footer-grid  { gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  /* Push footer content above mobile sticky bar */
  .site-footer { padding-bottom: 88px !important; }
}

/* ── 12. MOBILE STICKY BOTTOM BAR ───────────────────────────────── */
.mobile-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 990;
  background: var(--white);
  border-top: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  padding: 10px 16px 10px;
  gap: 10px;
  align-items: center;
  /* Bottom safe-area for notch phones */
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
@media (max-width: 768px) {
  .mobile-sticky-bar { display: flex; }
  body.storefront { padding-bottom: 72px; }
}
/* Don't show on admin pages */
body.admin-body .mobile-sticky-bar { display: none !important; }

.msb-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  text-decoration: none;
  min-height: 46px;
  transition: transform 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.msb-btn:active { transform: scale(0.96); opacity: 0.85; }

.msb-shop {
  background: var(--white);
  color: var(--charcoal);
  border: 2px solid var(--charcoal) !important;
}
.msb-cart {
  background: var(--gold);
  color: var(--white);
  position: relative;
}
.msb-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--charcoal);
  color: white;
  font-size: 0.58rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.msb-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ── 13. PRODUCT DETAIL — MOBILE STICKY ADD TO CART ──────────────── */
.pdp-sticky-bar {
  display: none;
  position: fixed;
  bottom: 72px;
  left: 0;
  right: 0;
  z-index: 980;
  background: white;
  border-top: 1px solid var(--charcoal-20);
  padding: 10px 16px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.14);
  gap: 10px;
  align-items: center;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
@media (max-width: 768px) {
  .pdp-sticky-bar { display: flex; }
  .pdp-sticky-bar.visible { transform: translateY(0); }
}
.pdp-sticky-name {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--charcoal);
}
.pdp-sticky-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  flex-shrink: 0;
}
.pdp-sticky-btn {
  background: var(--gold);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 11px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.pdp-sticky-btn:hover  { background: var(--gold-dark); }
.pdp-sticky-btn:active { transform: scale(0.97); }

/* ── 14. WHATSAPP BUTTON — above sticky bar on mobile ────────────── */
@media (max-width: 768px) {
  .whatsapp-btn { bottom: 90px; right: 14px; width: 48px; height: 48px; }
  .whatsapp-btn svg { width: 24px; height: 24px; }
}

/* ── 15. SECTION SPACING ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .section    { padding-top: 48px; padding-bottom: 48px; }
  .section-sm { padding-top: 36px; padding-bottom: 36px; }
  .section-header { margin-bottom: 32px; }
}

/* ── 16. CART — complete redesign (all screen sizes) ────────────── */

/* ── Hide old table header (new layout is self-labelled) ── */
.cart-table-head { display: none !important; }

/* ── Cart item: clean horizontal card ───────────────────────────── */
.cart-item {
  display: flex !important;
  flex-direction: row !important;
  gap: 16px !important;
  padding: 20px 24px !important;
  border-bottom: 1px solid var(--off-white) !important;
  align-items: flex-start !important;
  background: var(--white);
  grid-template-columns: unset !important;   /* kill app.css 5-col grid */
}
.cart-item:last-child { border-bottom: none !important; }

/* ── Product image ── */
.cart-product-img {
  width: 80px !important;
  height: 80px !important;
  min-width: 80px !important;
  object-fit: cover !important;
  border-radius: 10px !important;
  background: var(--off-white);
  display: block;
}

/* Fallback emoji shown when image fails */
.cart-img-fallback {
  display: none;
  width: 80px;
  min-width: 80px;
  height: 80px;
  border-radius: 10px;
  background: var(--off-white);
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

/* ── Item body (everything to the right of image) ── */
.cart-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Top row: product info + remove button ── */
.cart-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

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

.cart-product-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 3px;
  line-height: 1.35;
}

.cart-sku {
  font-size: 0.74rem;
  color: var(--charcoal-50);
  margin-top: 2px;
}

/* ── Remove button ── */
.cart-remove {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px !important;
  height: 30px !important;
  border-radius: 6px !important;
  color: var(--charcoal-40) !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.cart-remove:hover { color: var(--error) !important; background: #FEF2F2 !important; }

/* ── Bottom row: qty + pricing ── */
.cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Compact qty controls */
.cart-item-bottom .qty-selector { height: 36px; width: auto !important; }
.cart-item-bottom .qty-btn { width: 32px !important; height: 34px !important; font-size: 1rem !important; }
.cart-item-bottom .qty-input { width: 40px !important; height: 34px !important; font-size: 0.88rem !important; }

/* ── Pricing block (right side of bottom row) ── */
.cart-item-pricing { text-align: right; }

.cart-unit-price {
  font-size: 0.75rem;
  color: var(--charcoal-50);
  margin-bottom: 2px;
}

.cart-line-total {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

/* ── Cart layout: stack on tablet ── */
@media (max-width: 1024px) {
  .cart-layout {
    display: flex !important;
    flex-direction: column;
    gap: 20px;
  }
  .cart-layout > * { width: 100%; min-width: 0; }
  .cart-layout .cart-summary { position: static; }
  .cart-summary .summary-row { gap: 8px; }
  .cart-summary .summary-row span:last-child { text-align: right; flex-shrink: 0; }
}

/* ── Mobile refinements ── */
@media (max-width: 768px) {
  .cart-item { padding: 14px 16px !important; gap: 12px !important; }
  .cart-product-img { width: 68px !important; height: 68px !important; min-width: 68px !important; }
  .cart-img-fallback { width: 68px; min-width: 68px; height: 68px; }
  .cart-product-name { font-size: 0.88rem; }
  .cart-line-total { font-size: 0.95rem; }
  .cart-unit-price { font-size: 0.7rem; }

  /* Actions row: stacked full-width on mobile */
  .cart-actions-row {
    flex-direction: column !important;
    gap: 8px !important;
    margin-top: 12px !important;
  }
  .cart-actions-row > * { width: 100%; }
  .cart-actions-row .btn { display: block; text-align: center; width: 100%; }

  /* Cart summary */
  .cart-summary { padding: 20px 16px !important; }
  .coupon-form input { font-size: 16px; } /* prevent iOS zoom */
}

/* ── 17. CHECKOUT ────────────────────────────────────────────────── */

/* Desktop sticky order summary (class replaces inline style) */
.cart-summary-sticky { position: sticky; top: 100px; }

/* ── Checkout mobile overhaul ──────────────────────────────────── */
@media (max-width: 1024px) {
  /* Layout: summary card on top, form below — stacked single column */
  .checkout-layout {
    display: flex !important;
    flex-direction: column-reverse;
    gap: 16px;
  }

  /* Both columns must be full-width — no leftover grid sizing */
  .checkout-layout > * {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  /* Summary card: static, full-width, no overflow clipping */
  .cart-summary-sticky {
    position: static !important;
    width: 100%;
    max-width: 100%;
  }

  /* Hide the redundant sidebar submit button on mobile —
     the inline button at the bottom of Section 5 serves this role */
  .cart-summary-sticky #checkout-btn {
    display: none !important;
  }

  /* Summary rows: never let price overflow right edge */
  .summary-row {
    gap: 8px;
  }
  .summary-row span:last-child {
    text-align: right;
    word-break: break-word;
    min-width: 0;
    flex-shrink: 0;
  }

  /* Cart item rows in summary */
  .cart-summary > div[style*="display:flex"] {
    max-width: 100%;
    overflow: hidden;
  }
}

@media (max-width: 768px) {
  /* Tighter section padding */
  .checkout-section { padding: 16px; margin-bottom: 12px; }
  .checkout-section-title { font-size: 0.95rem; gap: 8px; padding-bottom: 12px; margin-bottom: 16px; }

  /* Form grid single column + prevent blowout */
  .form-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .form-group { min-width: 0; }
  .form-group.full { grid-column: 1 !important; }

  /* Payment type cards stack */
  .payment-type-options { grid-template-columns: 1fr !important; gap: 10px; }
  .payment-type-card { padding: 14px; }

  /* Payment type card: cleaner selected state with visible checkmark */
  .payment-type-card.selected {
    border-width: 2px;
  }
  .payment-type-card.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 12px;
    width: 22px;
    height: 22px;
    background: var(--gold);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  .payment-type-card { position: relative; }

  /* Payment method grid — 3 compact columns that actually fit */
  .pm-grid-3 { grid-template-columns: repeat(3, 1fr) !important; gap: 8px; }
  .pm-card { padding: 12px 8px 10px; min-width: 0; overflow: hidden; }
  .pm-icon { font-size: 1.4rem; }
  .pm-name { font-size: 0.72rem; word-break: break-word; }
  .pm-number { font-size: 0.6rem; word-break: break-all; }

  /* Upload area smaller on mobile */
  .upload-area { padding: 24px 16px; }

  /* Ensure all inputs don't overflow */
  .form-input, .form-select, .form-textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Payment detail panel: prevent account number overflow */
  .pm-detail-field-value {
    font-size: 0.88rem;
    word-break: break-all;
    overflow-wrap: anywhere;
  }

  /* Submit button: allow text to wrap so it never clips */
  #checkout-form .btn-primary[type=submit] {
    white-space: normal;
    line-height: 1.3;
    font-size: 0.88rem;
    padding: 14px 16px;
    height: auto;
    min-height: 52px;
  }
}

/* Extra-small phones */
@media (max-width: 480px) {
  .pm-grid-3 { grid-template-columns: repeat(3, 1fr) !important; }
  .pm-grid-2 { grid-template-columns: 1fr !important; }
}
@media (max-width: 360px) {
  .pm-grid-3 { grid-template-columns: 1fr !important; }
}

/* ── 17b. CHECKOUT — section completion ticks & upload preview ───── */

/* Step-number badge: done state */
.step-number.done {
  background: var(--gold) !important;
  color: white !important;
  border-color: var(--gold) !important;
  position: relative;
  transition: background 0.25s, color 0.25s;
}
.step-number.done::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7em;
  font-weight: 700;
}
/* Hide the number digit when done */
.step-number.done > * { visibility: hidden; }
.step-number.done { font-size: 0; }
.step-number.done::after { font-size: 0.72rem; }

/* Upload preview image */
.upload-preview-img {
  display: block;
  max-width: 100%;
  max-height: 180px;
  border-radius: var(--radius);
  margin: 12px auto 0;
  object-fit: contain;
  border: 1.5px solid var(--charcoal-20);
}

/* Upload area: hide placeholder content when preview is shown */
.upload-area.has-preview .upload-icon,
.upload-area.has-preview .upload-text,
.upload-area.has-preview .upload-hint {
  display: none;
}

/* Upload area: PDF name display */
.upload-filename {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--charcoal-50);
  text-align: center;
}

/* Spinner for button loading state */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 18. SHOP SIDEBAR — collapsible filter on mobile ────────────── */

/* Mobile filter toggle button (injected by shop/index.php) */
.mobile-filter-btn {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--white);
  border: 1.5px solid var(--charcoal-20);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--charcoal);
  margin-bottom: 16px;
  transition: all 0.2s;
}
.mobile-filter-btn:active { background: var(--off-white); }
.mobile-filter-btn svg { width: 16px; height: 16px; }
.mobile-filter-btn .mfb-count {
  background: var(--gold);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

/* Hide filter panel header on desktop — only needed inside mobile drawer */
.filter-panel-header { display: none; }
.filter-panel-actions { display: none; }

@media (max-width: 1024px) {
  /* Show mobile filter toggle button */
  .mobile-filter-btn { display: flex; }

  /* Shop layout: single column */
  .shop-layout { display: block !important; }

  /* Sidebar: hidden by default on mobile, shown as bottom sheet */
  .shop-sidebar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    max-height: 82vh;
    max-height: 82dvh;
    z-index: 1200;
    background: var(--white);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 16px 16px 0 0;
    padding: 0;
    border: none;
    will-change: transform;
    /* slide up from bottom */
    transform: translateY(100%);
    transition: transform 0.3s ease, bottom 0.15s ease;
  }

  .shop-sidebar.filter-open {
    display: block;
    transform: translateY(0);
  }

  /* Sidebar inner padding */
  .shop-sidebar form {
    padding: 16px 16px 16px;
  }

  /* Tighter filter option rows on mobile */
  .filter-option {
    padding: 6px 0;
  }

  .filter-section {
    margin-bottom: 14px;
  }

  /* Sticky header inside filter panel */
  .filter-panel-header {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--white);
    border-bottom: 1px solid var(--charcoal-20);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
  }

  .filter-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--charcoal);
    display: flex;
    align-items: center;
  }

  /* Filter overlay backdrop */
  .filter-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1199;
  }
  .filter-backdrop.open { display: block; }

  /* Sticky apply/close button at bottom of sheet */
  .filter-panel-actions {
    position: sticky;
    bottom: 0;
    background: var(--white);
    border-top: 1px solid var(--charcoal-20);
    padding: 12px 16px;
    display: none;
    gap: 10px;
    z-index: 1201;
  }
  .filter-panel-actions.open { display: flex; }
  .filter-panel-actions .btn { flex: 1; min-height: 46px; }

  /* Drag handle pill */
  .filter-drag-handle {
    display: flex;
    justify-content: center;
    padding: 10px 0 6px;
    touch-action: none;
    cursor: grab;
    user-select: none;
  }
  .filter-drag-pill {
    width: 40px;
    height: 4px;
    background: var(--charcoal-20, #ccc);
    border-radius: 2px;
    flex-shrink: 0;
  }
}

/* ── 19. FORMS — prevent iOS zoom, bigger touch targets ──────────── */
.form-input,
.form-select,
.form-textarea {
  min-height: 44px;
  font-size: 16px !important;
}
@media (max-width: 768px) {
  .coupon-form input { font-size: 16px !important; }
  /* Prevent iOS auto-zoom on price-range inputs (no .form-input class) */
  .price-inputs input { font-size: 16px !important; }
}

/* ── 20. BUTTONS — minimum touch targets ────────────────────────── */
.btn { min-height: 44px; }
.btn-sm { min-height: 36px; }
.btn:active:not(:disabled) { transform: scale(0.97); }

/* ── 21. PRODUCT DETAIL ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .product-price-block  { padding: 16px; }
  .product-main-price   { font-size: 1.65rem; }
  .product-info-title   { font-size: 1.4rem; }
  .product-add-actions  { grid-template-columns: 1fr auto; gap: 10px; }
  .gallery-main         { border-radius: var(--radius); }
  .gallery-thumb        { width: 60px; height: 60px; }
}

/* ── 22. BREADCRUMB — scrollable on mobile ───────────────────────── */
@media (max-width: 768px) {
  .breadcrumb {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .breadcrumb::-webkit-scrollbar { display: none; }
}

/* ── 23. TABS — scrollable on mobile ────────────────────────────── */
@media (max-width: 768px) {
  .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { white-space: nowrap; font-size: 0.82rem; padding: var(--space-3) var(--space-4); }
}

/* ── 24. CONTAINER PADDING ───────────────────────────────────────── */
@media (max-width: 480px) {
  .container { padding-left: 14px; padding-right: 14px; }
}

/* ── 25. PRODUCT GRID ────────────────────────────────────────────── */
@media (max-width: 360px) {
  .products-grid { grid-template-columns: 1fr !important; }
}

/* ── 26. SUCCESS & AUTH PAGES ────────────────────────────────────── */
@media (max-width: 480px) {
  .success-card { margin: 0 12px; padding: 32px 20px; }
  .auth-form-side { padding: 32px 20px; }
  .auth-title { font-size: 1.5rem; }
}

/* ── 27. PAGINATION ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .pagination { gap: 6px; }
  .page-btn { width: 36px; height: 36px; font-size: 0.8rem; }
}

/* ── 28. ADMIN RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .admin-content { padding: 14px; }
  .admin-card-body { padding: 14px; }
  .stat-value { font-size: 1.4rem; }
}

/* ── 29. ACCESSIBILITY & FOCUS ───────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── 30. SORT SELECT ARROW ───────────────────────────────────────── */
.sort-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 24 24' stroke='%23888888'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ── 31. CATEGORY PAGE MOBILE ────────────────────────────────────── */
@media (max-width: 768px) {
  .category-page-header--hero { padding: 48px 0 40px; }
}

/* ── 32. STARS — always amber ────────────────────────────────────── */
.stars { color: #F59E0B; }

/* ── 33. PREVENT BODY SCROLL WHEN MOBILE NAV OPEN ───────────────── */
body.nav-open { overflow: hidden; }

/* ── 34. SMOOTH SCROLL ───────────────────────────────────────────── */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ── 35. IMAGE LOADING PLACEHOLDER ──────────────────────────────── */
.product-card-image {
  background: linear-gradient(135deg, #f5f5f5, #ececec);
}

/* ── 36. DEAL BANNER PRODUCT IMAGE — hide on mobile ─────────────── */
@media (max-width: 768px) {
  .deal-banner-inner .deal-image { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   COMPREHENSIVE UI/UX POLISH — v3
   ═══════════════════════════════════════════════════════════════════ */

/* ── 37. INNER PAGE HEADERS — tighten the gap above content ──────── */

/* Slimmer bottom padding on page title bars */
.category-page-header {
  padding-top:    var(--space-8);
  padding-bottom: var(--space-5);
  border-bottom:  1px solid rgba(201,168,76,.15); /* warm gold tint instead of cold gray */
}

/* Reduce top padding of the first container that follows a page header */
.category-page-header + .container {
  padding-top: var(--space-6);
}

/* Mobile: even tighter */
@media (max-width: 768px) {
  .category-page-header { padding: var(--space-6) 0 var(--space-4); }
  .category-page-header + .container { padding-top: var(--space-4); }
  .category-page-title  { font-size: 1.5rem; }
  .category-page-desc   { font-size: 0.875rem; }
}

/* ── 38. BREADCRUMB BAR — lighter, blends with white pages ───────── */
.breadcrumb-bar {
  background:    var(--white);
  border-bottom: 1px solid rgba(0,0,0,.05);
}
.breadcrumb { font-size: 0.78rem; }

/* ── 39. HOMEPAGE SECTION SPACING — less vertical sprawl ─────────── */
.section    { padding-top: var(--space-16); padding-bottom: var(--space-16); }
.section-sm { padding-top: var(--space-10); padding-bottom: var(--space-10); }

@media (max-width: 768px) {
  .section    { padding-top: 44px; padding-bottom: 44px; }
  .section-sm { padding-top: 28px; padding-bottom: 28px; }
  .section-header { margin-bottom: 28px; }
}

/* ── 40. SECTION HEADER — tighter margin below, wider on large screens */
.section-header { margin-bottom: var(--space-10); }

/* ── 41. PRODUCT GRID — better column sizing on large screens ─────── */
.products-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--space-5);
}
@media (max-width: 768px) {
  .products-grid { gap: var(--space-3); }
}

/* ── 42. SHOP TOOLBAR — cleaner results / sort row ───────────────── */
.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--off-white);
}
.shop-results-count { font-size: 0.85rem; color: var(--charcoal-50); }
.shop-results-count strong { color: var(--charcoal); }

/* ── 43. EMPTY STATES — polished SVG-based layouts ───────────────── */
.empty-state-box {
  text-align: center;
  padding: 56px 20px 64px;
}
.empty-state-icon-ring {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--gold-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}
.empty-state-icon-ring svg { width: 36px; height: 36px; }

/* ── 44. FILTER SIDEBAR — desktop polish ─────────────────────────── */
@media (min-width: 1025px) {
  .shop-sidebar {
    background: var(--white);
    border: 1px solid rgba(0,0,0,.07);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
  }
  .filter-title {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: var(--space-3);
  }
  .filter-section {
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--off-white);
    margin-bottom: var(--space-4);
  }
  .filter-section:last-child { border-bottom: none; margin-bottom: 0; }
}

/* ── 45. PRODUCT CARD — slightly softer shadow, better hover ─────── */
.product-card {
  border: 1px solid rgba(0,0,0,.05);
}
.product-card:hover {
  border-color: rgba(201,168,76,.25);
}

/* ── 46. DEAL PAGE EYEBROW — gold decorative ────────────────────── */
.deals-eyebrow {
  color: var(--gold);
  letter-spacing: 0.2em;
}

/* ── 47. PAGE TITLE TYPOGRAPHY — stronger hierarchy ──────────────── */
.category-page-title {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  letter-spacing: -0.01em;
}

/* ── 48. FOOTER — better column gap, divider line ────────────────── */
.site-footer {
  border-top: 2px solid rgba(201,168,76,.2);
}
.footer-col-title {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: var(--space-4);
}

/* ── 49. HEADER NAV — active indicator ───────────────────────────── */
.nav-link.active {
  color: var(--gold) !important;
  position: relative;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}

/* ── 50. HERO BUTTONS — more prominent on mobile ─────────────────── */
@media (max-width: 768px) {
  .hero-actions .btn { padding: 12px 24px; font-size: 0.78rem; }
  .hero-actions .btn-outline { border-color: rgba(255,255,255,.5); color: white; }
}

/* ── 51. TRUST BAR — layout on tablet ───────────────────────────── */
@media (min-width: 561px) and (max-width: 900px) {
  .trust-items { grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
}

/* ── 52. CART HEADER — brand-consistent eyebrow ─────────────────── */
.cart-header-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ── 53. TRACK ORDER — card refinement ──────────────────────────── */
.track-form-wrap {
  background: var(--white);
  border: 1px solid rgba(0,0,0,.07);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 480px) {
  .track-form-wrap { padding: var(--space-6); }
}

/* ── 54. BUTTONS — outline gold variant ──────────────────────────── */
.btn-outline-gold {
  background: transparent;
  border-color: var(--gold);
  color: var(--gold);
}
.btn-outline-gold:hover {
  background: var(--gold);
  color: var(--white);
}

/* ── 55. IMAGE QUALITY — sharper rendering ───────────────────────── */
img {
  image-rendering: -webkit-optimize-contrast;
}
.product-card-image img,
.gallery-main img,
.category-card img {
  image-rendering: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE AUDIT FIXES — v4  (all devices: admin + customer-facing)
   Many views set grid-template-columns / widths inline. External CSS
   cannot override inline styles without matching them, so we target the
   exact inline value via [style*=] and force a mobile-friendly reflow.
   ═══════════════════════════════════════════════════════════════════ */

/* ── 56. STACK TWO-COLUMN SIDEBAR LAYOUTS ON TABLET/MOBILE ──────────── */
@media (max-width: 1024px) {
  [style*="grid-template-columns:300px 1fr"],
  [style*="grid-template-columns:1fr 340px"],
  [style*="grid-template-columns:1fr 320px"],
  [style*="grid-template-columns:1fr 360px"],
  [style*="grid-template-columns:1fr 380px"],
  [style*="grid-template-columns:1fr 280px"] {
    grid-template-columns: 1fr !important;
  }
}

/* Account pages use a 240px sidebar — stack a touch earlier */
@media (max-width: 880px) {
  [style*="grid-template-columns:240px 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── 57. COLLAPSE MULTI-COLUMN INNER GRIDS ON PHONES ───────────────── */
@media (max-width: 640px) {
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
  }
}
@media (max-width: 460px) {
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns:1fr 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── 58. ADMIN MOBILE MENU BUTTON — robust on resize ───────────────── */
/* Inline style="display:none" + load-time JS is brittle; let CSS own it */
@media (max-width: 1024px) {
  .mobile-menu-btn { display: flex !important; }
}
@media (min-width: 1025px) {
  .mobile-menu-btn { display: none !important; }
}

/* ── 59. ERROR PAGES — giant number must not overflow phones ────────── */
[style*="font-size:8rem"] {
  font-size: clamp(4.5rem, 20vw, 8rem) !important;
}

/* ── 60. ADMIN FILTER FIELDS — full width on small phones ───────────── */
@media (max-width: 600px) {
  .admin-input[style*="width:"],
  .admin-select[style*="width:"] {
    width: 100% !important;
  }
}

/* ── 61. ADMIN TABLES — clearer horizontal-scroll affordance ───────── */
.admin-table-wrap {
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
  .admin-table-wrap {
    border: 1px solid rgba(0,0,0,.06);
    border-radius: var(--radius);
  }
  .admin-table th,
  .admin-table td { white-space: nowrap; }
}

/* ── 62. ADMIN CONTENT — comfortable padding on phones ─────────────── */
@media (max-width: 768px) {
  .admin-page-title { font-size: 1.35rem; }
  .admin-card { border-radius: var(--radius); }
}

/* ── 63. ACCOUNT SIDEBAR — full width card when stacked ────────────── */
@media (max-width: 880px) {
  .account-nav,
  .account-sidebar { width: 100%; }
}

/* ── 64. CHECKOUT — single column summary on phones ────────────────── */
@media (max-width: 600px) {
  .checkout-summary { position: static !important; }
}

/* ── 65. FORMS GRID — inputs never overflow their container ─────────── */
.admin-input,
.admin-select,
.admin-textarea,
.form-input,
.form-select,
.form-textarea { max-width: 100%; }

/* ── 66. IMAGES — never overflow their column ──────────────────────── */
img { max-width: 100%; }

/* ── 67. TABLES — prevent layout-breaking on tiny phones ──────────── */
@media (max-width: 480px) {
  .container { overflow-x: hidden; }
}

/* ── 68. ADMIN PAYMENT VERIFICATION CARD ─────────────────────────── */
@media (max-width: 640px) {
  .proof-verify-card { grid-template-columns: 1fr !important; }
  .proof-verify-card > div:first-child img,
  .proof-verify-card > div:first-child a[href] { max-width: 220px; }
}

/* ── 19. PRODUCT DETAIL — ASSURANCE / TRUST STRIP ───────────────── */
.pdp-assurance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 22px 0 26px;
  padding: 16px;
  background: var(--gold-pale, #FAF3E0);
  border: 1px solid var(--gold-light, #E8D5A3);
  border-radius: 14px;
}
.pdp-assurance-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 6px 4px;
  text-decoration: none;
  color: inherit;
}
.pdp-assurance-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  stroke-width: 1.8;
  color: var(--gold-dark, #A07830);
  margin-top: 1px;
}
.pdp-assurance-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--charcoal, #1A1A1A);
  line-height: 1.3;
}
.pdp-assurance-sub {
  font-size: .76rem;
  color: var(--charcoal-50, #888);
  line-height: 1.35;
  margin-top: 2px;
}
.pdp-assurance-link {
  border-radius: 10px;
  transition: background .15s ease;
}
.pdp-assurance-link:hover { background: rgba(160,120,48,.10); }

@media (max-width: 600px) {
  .pdp-assurance { grid-template-columns: 1fr; gap: 4px; padding: 14px; }
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE ALIGNMENT FIXES — v5  (storefront small-device polish)
   ═══════════════════════════════════════════════════════════════════ */

/* ── 69. HOME CATEGORY-SHOWCASE HEADER — stack title + "View All" ────
   The home page repeats a .flex-between header (section title on the
   left, "View All" button on the right) for every category. On phones
   these two cramp against each other. Stack them and left-align the
   link so each showcase reads cleanly. Targeted via the exact inline
   margin so it only affects this pattern. */
@media (max-width: 600px) {
  body.storefront .flex-between[style*="margin-bottom:48px"] {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px !important;
  }
  body.storefront .flex-between[style*="margin-bottom:48px"] .btn {
    align-self: flex-start;
  }
}

/* ── 70. PAGES CMS — rendered page typography (storefront) ───────────
   Frontend static pages (/page/{slug}) previously dumped raw HTML into
   a bare div, so headings, lists and links had no rhythm. Give the
   .page-content wrapper proper editorial typography. */
body.storefront .page-content {
  line-height: 1.85;
  color: var(--charcoal-80, #3a3a3a);
  font-size: 1.02rem;
}
body.storefront .page-content > *:first-child { margin-top: 0; }
body.storefront .page-content h2 {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.6rem;
  line-height: 1.25;
  color: var(--charcoal, #1f1f1f);
  margin: 2em 0 .6em;
}
body.storefront .page-content h3 {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.28rem;
  line-height: 1.3;
  color: var(--charcoal, #1f1f1f);
  margin: 1.6em 0 .5em;
}
body.storefront .page-content p { margin: 0 0 1.15em; }
body.storefront .page-content ul,
body.storefront .page-content ol { margin: 0 0 1.2em; padding-left: 1.4em; }
body.storefront .page-content li { margin-bottom: .5em; }
body.storefront .page-content a {
  color: var(--gold-dark, #a07830);
  text-decoration: underline;
  text-underline-offset: 2px;
}
body.storefront .page-content a:hover { color: var(--gold, #C9A84C); }
body.storefront .page-content blockquote {
  margin: 1.6em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--gold, #C9A84C);
  background: var(--gold-pale, #faf3e0);
  border-radius: 0 10px 10px 0;
  font-style: italic;
  color: var(--charcoal, #1f1f1f);
}
body.storefront .page-content img { max-width: 100%; height: auto; border-radius: 12px; margin: 1.2em 0; }
body.storefront .page-content strong { font-weight: 700; }
body.storefront .page-content hr { border: none; border-top: 1px solid rgba(0,0,0,.1); margin: 2em 0; }

/* ── 71. ADMIN — Rich text editor + form hints (Pages CMS) ───────────
   Enhances <textarea data-rte> (see admin-editor.js) into a WYSIWYG
   editor. Admin-only classes, so no storefront scope needed. */
.rte {
  border: 1.5px solid #d9dee6;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  padding: 7px 8px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.rte-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 30px;
  padding: 0 9px;
  font-size: .8rem;
  font-weight: 600;
  color: #334155;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
  transition: background .12s, color .12s, border-color .12s, transform .06s;
}
.rte-btn:hover { background: var(--gold, #C9A84C); color: #fff; border-color: var(--gold, #C9A84C); }
.rte-btn:active { transform: scale(.94); }
.rte-sep { width: 1px; height: 20px; background: #e2e8f0; margin: 0 3px; }
.rte-editor {
  min-height: 320px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 16px 18px;
  font-size: .95rem;
  line-height: 1.7;
  color: #1e293b;
  outline: none;
}
.rte-editor:focus { box-shadow: inset 0 0 0 2px rgba(201,168,76,.28); }
.rte-editor h2 { font-size: 1.4rem; font-weight: 700; margin: .8em 0 .4em; }
.rte-editor h3 { font-size: 1.15rem; font-weight: 700; margin: .8em 0 .4em; }
.rte-editor p { margin: 0 0 .8em; }
.rte-editor ul, .rte-editor ol { margin: 0 0 .8em; padding-left: 1.5em; }
.rte-editor blockquote {
  margin: .8em 0;
  padding: 8px 16px;
  border-left: 3px solid var(--gold, #C9A84C);
  background: #faf3e0;
  color: #57534e;
  font-style: italic;
}
.rte-editor a { color: #a07830; text-decoration: underline; }
.rte-editor:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}
.rte .rte-source {
  display: none;
  width: 100%;
  min-height: 320px;
  max-height: 62vh;
  margin: 0;
  padding: 16px 18px;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.6;
  resize: vertical;
}
.rte.rte-html-mode .rte-editor { display: none; }
.rte.rte-html-mode .rte-source { display: block; }
.admin-field-hint { font-size: .76rem; color: #64748B; margin-top: 6px; line-height: 1.5; }
.admin-field-link { font-size: .82rem; color: var(--gold, #C9A84C); font-weight: 600; word-break: break-all; }

/* Clickable footer contact links (call / WhatsApp / email) */
.footer-contact-item a {
  color: inherit;
  text-decoration: none;
  transition: color .15s ease;
}
.footer-contact-item a:hover { color: var(--gold, #C9A84C); }

/* ==========================================================================
   Admin UX polish (accessibility, form feedback, mobile) — additive layer
   ========================================================================== */

/* Keyboard focus: a clear, consistent gold ring for anyone tabbing through
   the admin (buttons, links, inputs). Mouse clicks stay clean via :focus-visible. */
.admin-main a:focus-visible,
.admin-main button:focus-visible,
.admin-main .btn:focus-visible,
.admin-main input:focus-visible,
.admin-main select:focus-visible,
.admin-main textarea:focus-visible,
.admin-sidebar a:focus-visible {
  outline: 2px solid var(--gold, #C9A84C);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Inline validation feedback — only after the user has interacted with a field
   (:user-invalid), so forms don't look angry before they're filled in. */
.admin-main input:user-invalid,
.admin-main select:user-invalid,
.admin-main textarea:user-invalid {
  border-color: #EF4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}

/* Slightly darker helper/empty text for better contrast (WCAG AA). */
.admin-field-hint { color: #556070; }

/* Consistent disabled state for admin buttons. */
.admin-main .btn:disabled,
.admin-main .btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Tables: smoother horizontal scroll on small screens + subtle edge cue so it's
   obvious there's more to scroll. Keeps the existing scroll pattern, just nicer. */
.admin-table-wrap {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
@media (max-width: 700px) {
  .admin-table th,
  .admin-table td { white-space: nowrap; }
  /* Keep row action buttons on one compact line instead of exploding row height. */
  .admin-table td form { display: inline-block; margin: 0; }
  .admin-table td .btn.btn-sm { padding: 5px 9px; }
}

/* ── 71. STOREFRONT FORM VALIDATION FEEDBACK ─────────────────────────
   Live inline feedback on customer forms (login, register, checkout,
   profile, contact). :user-invalid only fires after the visitor has
   interacted with a field, so pristine forms never look "angry". The
   server-side .error class stays supported for post-submit highlighting. */
body.storefront .form-input:user-invalid,
body.storefront .form-select:user-invalid,
body.storefront textarea.form-input:user-invalid {
  border-color: var(--error, #DC2626);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}
body.storefront .form-input.error,
body.storefront .form-select.error {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}

/* ── 72. BRANDED IMAGE PLACEHOLDER (replaces the old 💎 emoji) ────────
   Any missing/failed product, category, cart or order image now renders
   an elegant gold faceted-diamond line icon (Helpers::imagePlaceholder())
   that scales to whatever container it sits in — from 40px admin thumbs
   to the full product gallery — instead of a raw blue emoji. currentColor
   drives the stroke so each context can tune the tone. */
.img-ph-svg {
  width: clamp(26px, 42%, 150px);
  height: auto;
  color: var(--gold, #C9A24B);
  opacity: .5;
  display: block;
  flex-shrink: 0;
}
.category-card-placeholder .img-ph-svg { color: var(--gold-dark, #A07830); opacity: .6; }
.gallery-ph .img-ph-svg { opacity: .45; }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE AUDIT FIXES — v6  (mobile/tablet polish pass)
   ═══════════════════════════════════════════════════════════════════ */

/* ── 73. TOASTS — clear the mobile sticky bottom bar ─────────────────
   On phones the storefront shows a fixed bottom bar (~72px tall), but
   #toast-container sits at bottom:24px, so success/error toasts landed
   on top of the bar's buttons. Lift them above it (plus notch safe-area)
   so feedback never covers the primary actions. Scoped to storefront —
   admin/auth have no sticky bar. */
@media (max-width: 768px) {
  body.storefront #toast-container {
    bottom: calc(92px + env(safe-area-inset-bottom));
  }
  /* PDP: when the sticky add-to-cart bar is shown (bottom:72px, ~66px
     tall), lift toasts above it too — .toast has pointer-events:all, so
     a toast sitting on the button would block re-taps while visible. */
  body.storefront:has(.pdp-sticky-bar.visible) #toast-container {
    bottom: calc(158px + env(safe-area-inset-bottom));
  }
}

/* ── 74. ACCOUNT PAGE HEADERS — wrap instead of cramping ─────────────
   Account pages (dashboard etc.) render an inline flex header with a
   title on the left and an action button on the right. On small phones
   the two collide and the button squashes. Let the row wrap with a
   comfortable gap. Scoped to the account 240px-sidebar layout so cart /
   checkout summary rows are unaffected. */
@media (max-width: 480px) {
  body.storefront [style*="grid-template-columns:240px 1fr"] div[style*="justify-content:space-between"] {
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* ── 75. ACCOUNT ORDER TABLES — visible swipe cue on phones ──────────
   The "My Orders" / dashboard tables scroll horizontally on mobile, but
   nothing signalled that more columns exist. Classic scroll-shadow: soft
   edge shadows appear only while there is hidden content on that side
   (background-attachment local/scroll trick — cells are transparent so
   the cue shows through). */
@media (max-width: 768px) {
  body.storefront .admin-table-wrap {
    background:
      linear-gradient(to right, #fff 30%, rgba(255,255,255,0)),
      linear-gradient(to left,  #fff 30%, rgba(255,255,255,0)) 100% 0,
      linear-gradient(to right, rgba(0,0,0,.10), rgba(0,0,0,0)),
      linear-gradient(to left,  rgba(0,0,0,.10), rgba(0,0,0,0)) 100% 0;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-repeat: no-repeat;
    background-attachment: local, local, scroll, scroll;
  }
  /* th has an opaque #F8FAFC background that would hide the cue in the
     header strip — let it show through on phones. */
  body.storefront .admin-table-wrap .admin-table th {
    background: transparent;
  }
}
