@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* ==========================================================================
   1. Brand tokens
   Injected at runtime by BrandingService from "Branding" in appsettings.json.
   Fallbacks keep the storefront correct before the WASM host starts.
   ========================================================================== */
:root {
    --brand-primary: #f5c518;
    --brand-primary-deep: #e0b000;
    --brand-accent: #2e7d32;
    --brand-ink: #101112;
    --brand-ink-soft: #3d4043;
    --brand-muted: #6b7075;
    --brand-surface: #ffffff;
    --brand-wash: #faf9f6;
    --brand-line: #e7e7e5;

    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 26px;
    --shadow-sm: 0 1px 2px rgba(16, 17, 18, .05);
    --shadow: 0 2px 6px rgba(16, 17, 18, .05), 0 18px 40px rgba(16, 17, 18, .09);
    --shadow-lift: 0 4px 10px rgba(16, 17, 18, .06), 0 26px 60px rgba(16, 17, 18, .13);
    --container: 1180px;
    --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

html, body {
    margin: 0;
    background: var(--brand-surface);
    color: var(--brand-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 { color: var(--brand-ink); letter-spacing: -.025em; margin: 0; }
h1:focus { outline: none; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--brand-primary); color: var(--brand-ink); }

/* ==========================================================================
   2. Shell
   ========================================================================== */
.shop-shell { display: flex; flex-direction: column; min-height: 100vh; }

.shop-container,
.shop-header .header-inner,
.shop-nav .nav-inner,
.shop-main,
.shop-footer .footer-inner {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 24px;
}

.shop-main { flex: 1; padding-bottom: 88px; }

/* ==========================================================================
   3. Header
   ========================================================================== */
.shop-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--brand-line);
    transition: box-shadow .2s ease;
}

.shop-header.is-stuck { box-shadow: 0 6px 24px rgba(16, 17, 18, .07); }

.shop-header .header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: var(--header-h);
    padding-block: 10px;
}

/* Brand / wordmark — generous padding so the logo never looks cramped */
.shop-brand {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px 8px 4px;
    margin-right: auto;
    border-radius: 12px;
    flex-shrink: 0;
    transition: background-color .16s ease;
}

.shop-brand:hover { background: var(--brand-wash); }

.shop-brand img {
    height: 36px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    display: block;
}

.shop-brand .brand-name {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -.03em;
    white-space: nowrap;
}

.shop-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Search */
.shop-tools .input-group { display: flex; align-items: stretch; }

.shop-tools .input-group .form-control {
    width: 240px;
    border: 1px solid var(--brand-line);
    border-right: 0;
    border-radius: 999px 0 0 999px;
    padding: 10px 18px;
    font-size: .92rem;
    background: var(--brand-wash);
    color: var(--brand-ink);
    transition: width .2s ease, background-color .16s ease;
}

.shop-tools .input-group .form-control:focus {
    outline: none;
    box-shadow: none;
    border-color: var(--brand-primary-deep);
    background: var(--brand-surface);
    width: 290px;
}

.shop-tools .input-group-append { display: flex; }

.shop-tools .input-group .btn {
    border-radius: 0 999px 999px 0;
    padding-inline: 18px;
}

.shop-tools select.form-control {
    border: 1px solid var(--brand-line);
    border-radius: 999px;
    padding: 9px 14px;
    font-size: .86rem;
    background: var(--brand-surface);
    color: var(--brand-muted);
    max-width: 132px;
}

/* ==========================================================================
   4. Buttons
   ========================================================================== */
.btn {
    border-radius: 999px;
    font-weight: 650;
    letter-spacing: -.01em;
    transition: transform .14s ease, box-shadow .18s ease, background-color .16s ease, color .16s ease, border-color .16s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--brand-primary);
    border: 1px solid var(--brand-primary);
    color: var(--brand-ink);
    box-shadow: 0 8px 22px rgba(245, 197, 24, .32);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: var(--brand-primary-deep) !important;
    border-color: var(--brand-primary-deep) !important;
    color: var(--brand-ink) !important;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(245, 197, 24, .42);
}

.btn-secondary, .btn-info {
    background: var(--brand-surface);
    border: 1px solid var(--brand-line);
    color: var(--brand-ink-soft);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover, .btn-info:hover {
    border-color: #d5d5d1;
    color: var(--brand-ink);
    transform: translateY(-1px);
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--brand-line);
    color: var(--brand-ink);
}

.btn-outline-primary:hover { background: var(--brand-wash); border-color: #d5d5d1; color: var(--brand-ink); }

.btn-warning { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--brand-ink); }

.btn-lg { padding: 16px 34px; font-size: 1rem; }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 50%, transparent);
}

/* Cart pill */
.shop-tools .btn-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    position: relative;
}

.shop-tools .btn-info .badge {
    background: var(--brand-ink);
    color: #fff;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 8px;
    line-height: 1.5;
}

/* Account dropdown */
.shop-tools .dropdown { position: relative; }

.shop-tools .dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 200px;
    background: var(--brand-surface);
    border: 1px solid var(--brand-line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 8px;
    display: none;
    z-index: 120;
}

.shop-tools .dropdown-menu.show-menu { display: block; animation: pop .14s ease-out; }

@keyframes pop {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to { opacity: 1; transform: none; }
}

.shop-tools .dropdown-menu .dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border-radius: 9px;
    border: 0;
    background: transparent;
    color: var(--brand-ink-soft);
    font-size: .92rem;
    cursor: pointer;
}

.shop-tools .dropdown-menu .dropdown-item:hover { background: var(--brand-wash); color: var(--brand-ink); }

.shop-tools .dropdown-menu hr { margin: 6px 0; border-color: var(--brand-line); }

.dropdown-toggle::after { display: none; }

/* ==========================================================================
   5. Category nav
   ========================================================================== */
.shop-nav { border-bottom: 1px solid var(--brand-line); background: var(--brand-surface); }

.shop-nav .nav-inner { display: flex; align-items: center; padding-block: 8px; }

.shop-nav .flex-nav { display: flex; align-items: center; gap: 6px; width: 100%; overflow-x: auto; scrollbar-width: none; }
.shop-nav .flex-nav::-webkit-scrollbar { display: none; }

.shop-nav .nav-item { padding: 0 !important; flex-shrink: 0; }

.shop-nav .nav-link {
    display: inline-flex;
    align-items: center;
    color: var(--brand-ink-soft) !important;
    font-size: .93rem;
    font-weight: 650;
    letter-spacing: -.01em;
    padding: 10px 18px !important;
    border-radius: 999px;
    white-space: nowrap;
    transition: background-color .16s ease, color .16s ease;
}

.shop-nav .nav-link:hover { background: var(--brand-wash); color: var(--brand-ink) !important; }

.shop-nav .nav-link.active { background: var(--brand-ink); color: #fff !important; }

.shop-nav .navbar-toggler-wrapper { display: none; }

/* ==========================================================================
   6. Hero
   ========================================================================== */
.shop-hero {
    position: relative;
    overflow: hidden;
    margin: 0 0 8px;
    padding: 72px 0 84px;
    background:
        radial-gradient(circle at 82% 18%, rgba(245, 197, 24, .30), transparent 46%),
        radial-gradient(circle at 8% 92%, rgba(245, 197, 24, .16), transparent 42%),
        var(--brand-ink);
    color: #fff;
}

.shop-hero .hero-inner {
    position: relative;
    z-index: 1;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 24px;
}

.shop-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--brand-primary);
    margin: 0 0 22px;
}

.shop-hero .eyebrow::before {
    content: "";
    width: 26px;
    height: 2px;
    background: var(--brand-primary);
}

.shop-hero h1 {
    color: #fff;
    font-size: clamp(2.4rem, 5.6vw, 4.15rem);
    line-height: 1.02;
    letter-spacing: -.04em;
    font-weight: 800;
    max-width: 20ch;
    margin: 0 0 22px;
}

.shop-hero h1 .accent {
    color: var(--brand-primary);
    font-style: italic;
}

.shop-hero .hero-sub {
    color: rgba(255, 255, 255, .74);
    font-size: 1.06rem;
    max-width: 52ch;
    margin: 0 0 34px;
}

.shop-hero .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.shop-hero .btn-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff;
}

.shop-hero .btn-ghost:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .5); color: #fff; }

/* ==========================================================================
   7. Trust strip
   ========================================================================== */
.trust-strip {
    border-bottom: 1px solid var(--brand-line);
    background: var(--brand-wash);
}

.trust-strip .trust-inner {
    max-width: var(--container);
    margin-inline: auto;
    padding: 16px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 40px;
    justify-content: space-between;
}

.trust-strip .trust-item {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: .87rem;
    font-weight: 650;
    color: var(--brand-ink-soft);
}

.trust-strip svg { color: var(--brand-primary-deep); flex-shrink: 0; }

/* ==========================================================================
   8. Sections
   ========================================================================== */
.shop-section { padding-top: 64px; }

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 30px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--brand-line);
    flex-wrap: wrap;
}

.section-heading h2 {
    font-size: clamp(1.45rem, 2.6vw, 1.95rem);
    font-weight: 800;
    letter-spacing: -.03em;
}

.section-heading .hint { color: var(--brand-muted); font-size: .88rem; }

/* ==========================================================================
   9. Product cards
   ========================================================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px 26px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--brand-surface);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .22s cubic-bezier(.2, .7, .3, 1), box-shadow .22s ease;
}

.product-card:hover { transform: translateY(-5px); }

.product-card .card-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    background: var(--brand-wash);
    border: 1px solid var(--brand-line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .22s ease;
}

.product-card:hover .card-media { border-color: transparent; box-shadow: var(--shadow-lift); }

.product-card .card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s cubic-bezier(.2, .7, .3, 1);
}

.product-card:hover .card-media img { transform: scale(1.055); }

/* sale / featured chips */
.product-card .chip {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--brand-ink);
    color: #fff;
}

.product-card .chip.chip-sale { background: var(--brand-primary); color: var(--brand-ink); }

.product-card .card-body {
    padding: 16px 4px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.product-card .product-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -.015em;
    color: var(--brand-ink);
    transition: color .15s ease;
}

.product-card:hover .product-title { color: var(--brand-primary-deep); }

.product-card .product-desc {
    margin: 0;
    color: var(--brand-muted);
    font-size: .855rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .price-row {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    align-items: baseline;
    gap: 9px;
}

.product-card .price {
    font-weight: 800;
    font-size: 1.06rem;
    letter-spacing: -.02em;
    color: var(--brand-ink);
}

.product-card .price-was {
    font-size: .87rem;
    color: var(--brand-muted);
    text-decoration: line-through;
}

/* Empty state */
.empty-state {
    border: 1px dashed var(--brand-line);
    border-radius: var(--radius);
    padding: 56px 24px;
    text-align: center;
    color: var(--brand-muted);
    background: var(--brand-wash);
}

/* Pagination */
.page-selection { margin-right: 8px; margin-top: 34px; }
.page-selection.btn-info { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.page-selection.btn-outline-info { border-color: var(--brand-line); color: var(--brand-ink-soft); background: transparent; }

.content { padding-top: 0; }

/* ==========================================================================
   10. Footer
   ========================================================================== */
.shop-footer {
    background: var(--brand-ink);
    color: rgba(255, 255, 255, .72);
    padding: 64px 0 32px;
}

.shop-footer .footer-inner {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 44px;
    align-items: start;
}

.shop-footer .footer-brand img {
    height: 34px;
    width: auto;
    margin: 0 0 18px;
    /* keep the dark wordmark readable on ink */
    filter: brightness(0) invert(1);
    opacity: .95;
}

.shop-footer .footer-brand strong { color: #fff; font-size: 1.15rem; letter-spacing: -.02em; display: block; margin-bottom: 14px; }

.shop-footer .footer-brand p { margin: 0; font-size: .92rem; line-height: 1.6; max-width: 40ch; }

.shop-footer h4 {
    color: #fff;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .13em;
    margin: 0 0 16px;
}

.shop-footer nav { display: flex; flex-direction: column; gap: 11px; }

.shop-footer nav a { color: rgba(255, 255, 255, .72); font-size: .93rem; transition: color .15s ease; }
.shop-footer nav a:hover { color: var(--brand-primary); }

.shop-footer .footer-legal {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding-top: 22px;
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    font-size: .84rem;
    color: rgba(255, 255, 255, .5);
}

.shop-footer .footer-credit {
    color: rgba(255, 255, 255, .5);
    transition: color .15s ease;
}

.shop-footer .footer-credit:hover { color: var(--brand-primary); text-decoration: underline; }

/* ==========================================================================
   11. Forms & shared content pages
   ========================================================================== */
.form-control {
    border-radius: var(--radius-sm);
    border: 1px solid var(--brand-line);
    padding: 11px 14px;
    font-size: .95rem;
    background: var(--brand-surface);
    color: var(--brand-ink);
}

.form-control:focus { border-color: var(--brand-primary-deep); }

.valid.modified:not([type=checkbox]) { outline: 1px solid var(--brand-accent); }
.invalid { outline: 1px solid #d32f2f; }
.validation-message { color: #d32f2f; font-size: .86rem; }

/* ==========================================================================
   12. Errors & loading
   ========================================================================== */
#blazor-error-ui {
    background: #fffdf2;
    border-top: 1px solid var(--brand-line);
    bottom: 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .08);
    display: none;
    left: 0;
    padding: .8rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: .92rem;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; top: .65rem; }

.blazor-error-boundary {
    background: #fff5f5;
    border: 1px solid #f0cccc;
    border-radius: var(--radius);
    padding: 1.1rem 1.4rem;
    color: #8a1f1f;
}

.blazor-error-boundary::after { content: "An error has occurred."; }
.error-message { color: #8a1f1f; }

.loading-progress {
    position: relative;
    display: block;
    width: 7rem;
    height: 7rem;
    margin: 22vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: var(--brand-line);
    stroke-width: .5rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--brand-primary);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray .05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-size: .78rem;
    color: var(--brand-muted);
    inset: calc(22vh + 3rem) 0 auto 0;
}

.loading-progress-text::after { content: var(--blazor-load-percentage-text, "Loading"); }

/* ==========================================================================
   13. Responsive
   ========================================================================== */
@media (max-width: 1000px) {
    .shop-footer .footer-inner { grid-template-columns: 1fr 1fr; }
    .shop-tools .input-group .form-control { width: 180px; }
}

@media (max-width: 820px) {
    :root { --header-h: auto; }

    .shop-header .header-inner { flex-wrap: wrap; padding-block: 10px; gap: 12px; }
    .shop-brand { margin-right: 0; }
    .shop-tools { width: 100%; order: 3; }
    .shop-tools .input-group { flex: 1; }
    .shop-tools .input-group .form-control,
    .shop-tools .input-group .form-control:focus { width: 100%; }

    .shop-hero { padding: 52px 0 60px; }
    .shop-hero h1 { max-width: none; }

    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 22px 14px; }
    .product-card .product-desc { display: none; }
    .shop-section { padding-top: 44px; }
    .trust-strip .trust-inner { gap: 8px 22px; }
    .trust-strip .trust-item { font-size: .8rem; }
}

@media (max-width: 560px) {
    html, body { font-size: 16px; }
    .shop-brand img { height: 30px; }
    .shop-main { padding-bottom: 56px; }
    .shop-footer { padding-top: 48px; }
    .shop-footer .footer-inner { grid-template-columns: 1fr; gap: 30px; }
    .shop-hero { padding: 44px 0 52px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

:focus-visible { outline: 3px solid var(--brand-primary-deep); outline-offset: 3px; border-radius: 8px; }
