/*
 * Storefront colour-contrast fixes (WCAG AA: 4.5:1 text, 3:1 large text).
 * Loaded last in frontend/layout/app.blade.php so it wins over the legacy
 * template (style.min.css uses a yellow #FFD333 "primary" and #F5F5F5
 * "secondary") and page-local styles. Ratios in comments are text on its
 * actual background.
 */

/* ── Bootstrap template colours → storefront palette ───────────────── */
.text-primary { color: #1f2b6c !important; }                  /* 12.9 on white */
a.text-primary:hover, a.text-primary:focus { color: #3f5aa9 !important; }
.btn-outline-primary { color: #1f2b6c; border-color: #1f2b6c; }
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-primary:not(:disabled):not(.disabled).active { color: #fff; background-color: #1f2b6c; border-color: #1f2b6c; }
.btn-outline-secondary { color: #475569; border-color: #cbd5e1; }   /* 7.6 */
.btn-outline-secondary:hover { color: #1f2937; background-color: #f1f5f9; border-color: #94a3b8; }
.text-secondary { color: #475569 !important; }
.text-success { color: #15803d !important; }                  /* 5.0 */
.text-warning { color: #b45309 !important; }                  /* 5.0 */
.text-danger { color: #dc2626 !important; }                   /* 4.8 */
.text-muted { color: #5b6472 !important; }                    /* 5.6 on #f6f7fb page bg */
.badge-success { background-color: #15803d; color: #fff; }    /* 5.0 */
.badge-info { background-color: #0e7490; color: #fff; }       /* 5.4 */

/* ── Header & search ───────────────────────────────────────────────── */
.doshop-search-btn.amz-search-btn { background: #c2410c !important; }   /* white 5.2 */
.doshop-search-btn.amz-search-btn:hover { background: #9a3412 !important; }
/* "Flash Sale" link sits on the dark category bar in both themes */
.amz-header-bottom .amz-bottom-item.text-danger { color: #fca5a5 !important; } /* 7.7 on #1e293b */

/* ── Prices & badges ───────────────────────────────────────────────── */
del, .original-price { color: #6b7280; }                      /* 4.8 */
.price-flash { color: #dc2626; }
.hero-side-badge { background: #dc2626; }                     /* white 4.8 */

/* ── Muted labels that used #9ca3af (2.5:1) ────────────────────────── */
.acc-balance-label,
.acc-welcome-member,
.vendor-card-desc,
.contact-info-label { color: #6b7280; }

/* ── Flash sales page ──────────────────────────────────────────────── */
.fs-timer-label { color: #6b7280; }
.fs-discount-tag { color: #9a3412; }                          /* 6.7 on #fff3e0 */
.fs-badge-live { background: #dc2626; }
.fs-badge-upcoming { background: #2563eb; }                   /* white 5.2 */
.fs-badge-ended { background: #6b7280; color: #fff; }         /* 4.8 */
.fs-card-meta { color: #5b6472; }

/* ── Product detail: orange accents (#ff6f00 was 2.8:1 with white) ── */
.price-tag { color: #c2410c; }
.variant-pill-input:checked + .variant-pill-label { background-color: #c2410c; border-color: #c2410c; color: #fff; }
.variant-pill-input:checked + .variant-pill-label span { color: #fff; opacity: 1 !important; }
.btn-add-to-cart { background-color: #c2410c; border-color: #c2410c; color: #fff; }
.btn-add-to-cart:hover { background-color: #9a3412; border-color: #9a3412; color: #fff; }
.pd-lb-thumb.is-active { border-color: #c2410c; }

/* ── Home: shop-by-category widget ─────────────────────────────────── */
.sbc-scope { --sbc-muted: #6f6152; }                          /* 5.9 on cream */

/* ══ Dark mode ═════════════════════════════════════════════════════ */
[data-theme="dark"] .text-primary { color: #a5b4fc !important; }
[data-theme="dark"] .btn-outline-primary { color: #a5b4fc; border-color: #6d7fd1; }
[data-theme="dark"] .btn-outline-primary:hover { color: #0f172a; background-color: #a5b4fc; border-color: #a5b4fc; }
[data-theme="dark"] .text-success { color: #6ee7b7 !important; }
[data-theme="dark"] .text-warning { color: #fbbf24 !important; }
[data-theme="dark"] .text-danger { color: #f87171 !important; }   /* 5.6–6.4 on dark surfaces */
[data-theme="dark"] .price-tag,
[data-theme="dark"] .pd-price-wrap .price-tag { color: #fb923c !important; }
[data-theme="dark"] .flash-sale-green-card .prod-price { color: #f87171; }
[data-theme="dark"] .acc-balance-label,
[data-theme="dark"] .acc-welcome-member,
[data-theme="dark"] .contact-info-label,
[data-theme="dark"] .fs-timer-label,
[data-theme="dark"] .fs-card-meta { color: var(--theme-text-muted); }
[data-theme="dark"] .fs-discount-tag { background: #3a2b13; color: #fdba74; }
[data-theme="dark"] .vendor-band__cta,
[data-theme="dark"] .vendor-band__cta:hover { color: #172033 !important; }

/* Shop-by-category cards had white backgrounds with light dark-mode text */
[data-theme="dark"] .sbc-scope {
    --sbc-cream: var(--theme-surface-muted);
    --sbc-line: var(--theme-border);
    --sbc-ink: #f1f5f9;
    --sbc-muted: #aab6c8;
    --sbc-accent: #fb923c;
}
[data-theme="dark"] .sbc-grouped-card { background: var(--theme-surface); }

/* ── 404 page (was inline navy-on-dark in dark mode) ──────────────── */
.err-code { font-size: clamp(4rem, 12vw, 8rem); font-weight: 800; line-height: 1; color: #1f2b6c; }
.err-title { color: #1f2b6c; }
.err-text { color: #5b6472; max-width: 480px; }
.err-search { border-radius: 10px; overflow: hidden; border: 1px solid #dee2e6; }
.err-search-btn { background: #1f2b6c; color: #fff; padding: 10px 20px; }
.err-btn { border-radius: 10px; padding: 12px 32px; font-weight: 600; text-decoration: none; }
.err-btn--primary, .err-btn--primary:hover { background: #1f2b6c; color: #fff; }
.err-btn--secondary, .err-btn--secondary:hover { background: #eef1fa; color: #1f2b6c; }
[data-theme="dark"] .err-code,
[data-theme="dark"] .err-title { color: #e2e8f0; }
[data-theme="dark"] .err-text { color: var(--theme-text-muted); }
[data-theme="dark"] .err-search { border-color: var(--theme-border); }
[data-theme="dark"] .err-search-btn,
[data-theme="dark"] .err-btn--primary { background: #8ea3f0; color: #0f172a; }
[data-theme="dark"] .err-btn--secondary { background: var(--theme-surface-raised); color: #e2e8f0; }

/* ── Follow-up fixes from the second audit pass ───────────────────── */
/* Search button: a dark-mode header rule darkened its label */
.amz-header .doshop-search-btn.amz-search-btn,
.amz-header .doshop-search-btn .doshop-search-btn-text,
[data-theme="dark"] .amz-header .doshop-search-btn.amz-search-btn,
[data-theme="dark"] .amz-header .doshop-search-btn .doshop-search-btn-text { color: #fff !important; }
[data-theme="dark"] a.err-btn--primary { color: #0f172a !important; }
[data-theme="dark"] a.err-btn--secondary { color: #e2e8f0 !important; }
.pd-sp-viewers { color: #15803d; }                            /* 4.7 on its tint */
[data-theme="dark"] .pd-sp-viewers { color: #6ee7b7; }
/* Ended flash sales: dim the banner, not the text (opacity made text 3:1) */
.fs-card--ended .fs-card-header { filter: grayscale(.7); }
.fs-btn-disabled { color: #4b5563; background: #e5e7eb; }    /* 6.4 */
[data-theme="dark"] .fs-btn-disabled { color: #cbd5e1; background: #334155; }
[data-theme="dark"] .fs-badge-ended { background: #475569; color: #fff; }
