/* ============================================================================
   SiteTemplate base stylesheet — STRUCTURE ONLY.
   Every color, font, and background comes from the CSS variables emitted from
   sitecontent/siteconfig.json (see App.razor) plus the active theme in
   wwwroot/themes/{ThemeId}/theme.css. Themes restyle; this file lays out.
   ========================================================================== */

:root {
    /* Fallbacks — siteconfig.json values override these at runtime */
    --brand-primary: #3b6ea5;
    --brand-secondary: #22303c;
    --brand-accent: #e0a458;
    --brand-bg: #ffffff;
    --brand-surface: #f5f6f8;
    --brand-text: #1b2530;
    --brand-text-on-primary: #ffffff;
    --brand-text-muted: #5c6b7a;
    --font-heading: system-ui, sans-serif;
    --font-body: system-ui, sans-serif;
    --hero-overlay-opacity: 0.5;
    --page-background: var(--brand-bg);

    /* Structural tokens themes may tune */
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.09);
    --border-color: color-mix(in srgb, var(--brand-text) 12%, transparent);
    --section-pad: 4.5rem;
    --header-h: 68px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--brand-text);
    background: var(--page-background);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    line-height: 1.15;
    margin: 0 0 0.6em;
    color: var(--brand-text);
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 1.25rem; }
.container.narrow { max-width: 780px; }
.center { text-align: center; }
.text-muted { color: var(--brand-text-muted); }
.text-danger { color: #c0392b; font-size: 0.875rem; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font: 600 0.95rem var(--font-body);
    cursor: pointer;
    text-align: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand-primary); color: var(--brand-text-on-primary); }
.btn-primary:hover { box-shadow: 0 6px 18px color-mix(in srgb, var(--brand-primary) 45%, transparent); color: var(--brand-text-on-primary); }
.btn-outline { background: transparent; color: var(--brand-text); border-color: var(--border-color); }
.btn-outline:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger-armed { background: #c0392b !important; color: #fff !important; border-color: #c0392b !important; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; }
.btn-link { background: none; border: none; color: var(--brand-primary); cursor: pointer; padding: 0; font: inherit; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- Badges / alerts ---------- */
.badge {
    display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
    margin-left: 0.3rem;
}
.badge-success { background: #e6f6ec; color: #1c7c3f; }
.badge-danger { background: #fdebe9; color: #b03024; }
.badge-warning { background: #fdf3d8; color: #93690e; }
.badge-muted { background: color-mix(in srgb, var(--brand-text) 8%, transparent); color: var(--brand-text-muted); }

.alert { padding: 0.85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: #e6f6ec; color: #1c7c3f; border-color: #bfe7cd; }
.alert-danger { background: #fdebe9; color: #b03024; border-color: #f5c8c2; }
.alert-warning { background: #fdf3d8; color: #93690e; border-color: #f1dfae; }

/* ---------- Forms ---------- */
.form-field { margin-bottom: 1rem; }
.form-field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }
.form-control {
    width: 100%; padding: 0.6rem 0.8rem; border-radius: var(--radius-sm);
    border: 1px solid var(--border-color); background: var(--brand-bg);
    color: var(--brand-text); font: inherit;
}
.form-control:focus { outline: 2px solid color-mix(in srgb, var(--brand-primary) 55%, transparent); border-color: var(--brand-primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.form-check-row { display: flex; justify-content: space-between; align-items: center; }
.action-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.75rem; }

/* ---------- Announcement / header / nav ---------- */
/* Solid brand-text ink at 0.95rem/600: the accent-tinted 0.85rem text read as low-contrast on pale
   accent backgrounds (Emma Salon QA review, 2026-09-05). */
.announcement-bar {
    background: color-mix(in srgb, var(--brand-accent) 12%, var(--brand-bg));
    color: var(--brand-text);
    border-bottom: 1px solid color-mix(in srgb, var(--brand-accent) 28%, transparent);
    text-align: center; padding: 0.5rem 1rem; font-size: 0.95rem; font-weight: 600;
    letter-spacing: 0.01em;
}
.announcement-bar a { color: color-mix(in srgb, var(--brand-accent) 55%, var(--brand-text)); font-weight: 700; }
.announcement-bar a { color: inherit; text-decoration: none; }
.announcement-bar a:hover { text-decoration: underline; text-underline-offset: 3px; }

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--brand-bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand:hover { text-decoration: none; }
/* 52px: at 40px the mark disappeared next to the wordmark (Emma Salon QA review, 2026-09-05).
   Width is auto + contain, never a square cover crop: a wide lockup was clipped to a partial glyph
   ("OMO") at the header edge (ICON Automotive QA review, 2026-09-06). */
.brand-logo { height: 52px; width: auto; max-width: min(240px, 42vw); object-fit: contain; object-position: left center; border-radius: 10px; flex-shrink: 0; }
@media (max-width: 480px) { .brand .brand-text { font-size: 1.05rem; } .brand-logo { height: 42px; max-width: 150px; } }
/* Image-only mode (the lockup already carries the wordmark): let it use the header's full brand width. */
.brand-logo-solo { max-width: min(320px, 60vw); }
.brand-text { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 800; color: var(--brand-text); letter-spacing: 0.02em; }

.site-nav { display: flex; align-items: center; gap: 1.1rem; }
.nav-link { color: var(--brand-text); font-weight: 600; font-size: 0.95rem; }
.nav-link:hover { color: var(--brand-primary); text-decoration: none; }
.nav-cta { margin-left: 0.4rem; }
.nav-logout-form { display: inline; }
.nav-logout { background: none; border: none; cursor: pointer; padding: 0; font: 600 0.95rem var(--font-body); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.4rem; }
.nav-toggle span { display: block; width: 24px; height: 2.5px; background: var(--brand-text); margin: 5px 0; border-radius: 2px; transition: 0.2s; }

@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .site-nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; padding: 1rem 1.25rem 1.4rem;
        background: var(--brand-bg); border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow);
    }
    .site-nav.open { display: flex; }
    .form-row { grid-template-columns: 1fr; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; display: grid; }
.hero-full { min-height: min(78vh, 720px); }
.hero-minimal { min-height: 320px; }
.hero-media, .hero-media img, .hero-media video {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.hero-media .ai-placeholder { position: absolute; inset: 0; }
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(rgba(0,0,0,var(--hero-overlay-opacity)), rgba(0,0,0,var(--hero-overlay-opacity)));
}
/* A playing clip needs a darker scrim than a still so the headline and buttons stay readable. */
.hero.has-video { --hero-overlay-opacity: 0.5; }
.hero-content {
    position: relative; z-index: 2; align-self: center;
    padding-top: 5rem; padding-bottom: 5rem; color: #fff; text-align: center;
}
/* Routes.razor's <FocusOnNavigate Selector="h1"> moves keyboard focus to the page headline after every
   navigation and on first load (screen-reader landmark). With no prior pointer interaction the browser
   treats that programmatic focus as :focus-visible and paints its focus ring around the multi-line
   headline — the "decorative frame that the second line overruns" QA flagged on every site. The
   headline is not interactive, so it never needs a visible ring. */
h1[tabindex="-1"]:focus, h1[tabindex="-1"]:focus-visible, .hero-headline:focus, .hero-headline:focus-visible { outline: none; box-shadow: none; }
.hero-headline {
    font-size: clamp(2.2rem, 5.5vw, 4rem); color: #fff;
    margin-bottom: 0.4em; text-wrap: balance;
}
.hero-subheadline { font-size: clamp(1rem, 2vw, 1.3rem); max-width: 640px; margin: 0 auto 1.8rem; color: rgba(255,255,255,0.92); }
.hero-ctas { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }
/* Frosted outline so the secondary CTA reads on a dark photo instead of vanishing next to the primary
   button (ICON Automotive QA review, 2026-09-06). */
.hero .btn-outline { color: #fff; border-color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.12); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); text-shadow: 0 1px 2px rgba(0,0,0,0.35); }
.hero .btn-outline:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.24); }

.hero-split { grid-template-columns: 1fr 1fr; min-height: 540px; }
.hero-split .hero-media { position: relative; order: 2; }
.hero-split .hero-overlay { display: none; }
.hero-split .hero-content { color: var(--brand-text); text-align: left; padding: 3rem 2rem; }
.hero-split .hero-headline, .hero-split .hero-subheadline { color: inherit; }
.hero-split .hero-ctas { justify-content: flex-start; }
@media (max-width: 860px) { .hero-split { grid-template-columns: 1fr; } .hero-split .hero-media { min-height: 260px; } }

/* ---------- Sections ---------- */
.page-section { padding: var(--section-pad) 0; }
.section-alt { background: var(--brand-surface); }
.section-heading { max-width: 720px; margin-bottom: 2.4rem; }
.section-heading.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-eyebrow {
    display: inline-block; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--brand-accent); margin-bottom: 0.5rem;
}
.section-title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.section-subtitle { color: var(--brand-text-muted); font-size: 1.05rem; }
.section-cta { margin-top: 2rem; }

/* ---------- Cards ---------- */
.surface-card {
    background: var(--brand-surface); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 1.5rem;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; }

.service-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.service-card-img { width: 100%; height: 190px; object-fit: cover; }
.service-card-body { padding: 1.25rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.service-card-body p { color: var(--brand-text-muted); margin: 0; flex: 1; }
.service-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.9rem; }
.price-tag { font-weight: 800; color: var(--brand-accent); }
.duration-tag { color: var(--brand-text-muted); font-size: 0.85rem; margin-left: 0.6rem; }

.service-list { display: flex; flex-direction: column; gap: 1.4rem; }
.service-row { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; overflow: hidden; padding: 0; }
.service-row-media img { width: 100%; height: 100%; object-fit: cover; }
.service-row-media .ai-placeholder { height: 100%; border-radius: 0; }
.service-row-body { padding: 1.4rem 1.6rem 1.6rem 0; }
.service-row-meta { margin: 0.5rem 0 1rem; }
@media (max-width: 720px) { .service-row { grid-template-columns: 1fr; } .service-row-body { padding: 0 1.4rem 1.4rem; } }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.gallery-item { margin: 0; border-radius: var(--radius); overflow: hidden; position: relative; background: var(--brand-surface); border: 1px solid var(--border-color); }
.gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; transition: transform 0.25s ease; }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item figcaption {
    position: absolute; inset: auto 0 0 0; padding: 0.7rem 0.9rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.78)); color: #fff; font-size: 0.85rem;
}
.gallery-item figcaption span { display: block; opacity: 0.8; }
.tag-filter { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tag-chip {
    padding: 0.35rem 0.95rem; border-radius: 999px; border: 1px solid var(--border-color);
    background: transparent; color: var(--brand-text); cursor: pointer; font: 600 0.85rem var(--font-body);
}
.tag-chip.active { background: var(--brand-primary); color: var(--brand-text-on-primary); border-color: var(--brand-primary); }

/* ---------- Testimonials / team ---------- */
.testimonial-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.testimonial-card { margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.testimonial-quote { font-size: 0.98rem; font-style: italic; flex: 1; }
.testimonial-card footer { color: var(--brand-text-muted); font-size: 0.9rem; }
.testimonial-footer { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.2rem; }
.testimonial-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid color-mix(in srgb, var(--brand-accent) 45%, transparent); background: var(--brand-surface); }
.testimonial-avatar-initials { display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; color: var(--brand-text); }
.testimonial-who { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.testimonial-who strong { color: var(--brand-text); }
.testimonial-detail { display: block; font-size: 0.82rem; }
.testimonial-sample-note { text-align: center; margin: -1.4rem auto 1.6rem; font-size: 0.82rem; color: var(--brand-text-muted); }
.testimonial-sample-badge { display: inline-block; padding: 0.15rem 0.55rem; margin-right: 0.35rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-accent); border: 1px solid color-mix(in srgb, var(--brand-accent) 55%, transparent); background: color-mix(in srgb, var(--brand-accent) 10%, transparent); }

/* Stars: a muted base glyph with an accent-coloured glyph clipped to the fractional width on top. */
.star-rating { display: inline-flex; align-items: center; gap: 0.05rem; }
.star-rating .star { position: relative; display: inline-block; line-height: 1; color: color-mix(in srgb, var(--brand-text) 22%, transparent); }
.star-rating .star.filled { color: var(--brand-accent); }
.star-rating .star-fill { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: var(--brand-accent); }
.star-rating .star-value { margin-left: 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--brand-text-muted); }

/* Team member reads as a media object: a contained portrait on the left, the story on
   the right. The photo used to be a full-width square on top of the card, which on a
   wide About page rendered as an enormous hero-sized image before any text. */
.team-grid { grid-template-columns: 1fr; }

.team-card {
    padding: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    align-items: stretch;
}

.team-photo { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; object-position: top center; }

.team-card-body {
    padding: 1.6rem 1.8rem;
    align-self: center;
}

/* Stack on narrow screens, and cap the portrait so it never dominates the fold. */
@media (max-width: 760px) {
    .team-card { grid-template-columns: 1fr; }
    .team-photo { max-height: 340px; aspect-ratio: 4 / 3; }
    .team-card-body { padding: 1.2rem 1.4rem 1.4rem; }
}
.team-role { color: var(--brand-accent); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }

.hours-panel { max-width: 460px; margin: 2.5rem auto 0; }
.hours-list { margin: 0; }
.hours-list div { display: flex; justify-content: space-between; padding: 0.3rem 0; border-bottom: 1px dashed var(--border-color); }
.hours-list dt { font-weight: 600; }
.hours-list dd { margin: 0; color: var(--brand-text-muted); }

/* ---------- Plans ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; align-items: stretch; }
.plan-card { display: flex; flex-direction: column; position: relative; }
.plan-highlight { border-color: var(--brand-accent); box-shadow: 0 0 0 1px var(--brand-accent), var(--shadow); }
.plan-badge {
    position: absolute; top: -0.8rem; left: 50%; transform: translateX(-50%);
    background: var(--brand-accent); color: var(--brand-secondary);
    padding: 0.2rem 0.9rem; border-radius: 999px; font-size: 0.75rem; font-weight: 800; white-space: nowrap;
}
.plan-price { margin: 0.4rem 0 0.6rem; }
.plan-amount { font: 800 2rem var(--font-heading); }
.plan-interval { color: var(--brand-text-muted); }
.plan-description { color: var(--brand-text-muted); }
.plan-features { list-style: none; padding: 0; margin: 0 0 1.4rem; flex: 1; }
.plan-features li { padding: 0.35rem 0 0.35rem 1.5rem; position: relative; }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: var(--brand-accent); font-weight: 800; }
.checkout-note { margin-top: 1.6rem; font-size: 0.85rem; }

/* ---------- CTA band ---------- */
.cta-band {
    background:
        radial-gradient(120% 160% at 15% 0%, color-mix(in srgb, var(--brand-primary) 16%, transparent), transparent 55%),
        radial-gradient(120% 160% at 85% 100%, color-mix(in srgb, var(--brand-secondary) 14%, transparent), transparent 55%),
        color-mix(in srgb, var(--brand-surface) 55%, var(--brand-bg));
    color: var(--brand-text);
    border-top: 1px solid var(--border-color);
    padding: 3.5rem 0;
}
.cta-band-title { color: inherit; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.cta-band-subtitle { color: var(--brand-text-muted); margin-bottom: 1.6rem; }
.cta-band .btn-outline { color: var(--brand-text); border-color: var(--border-color); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.6rem; align-items: start; }
.contact-info-panel { display: flex; flex-direction: column; gap: 1.2rem; }
.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-color); }
.map-frame iframe { width: 100%; height: 300px; border: 0; display: block; }
.map-directions { align-self: flex-start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Booking ---------- */
.booking-widget { display: flex; flex-direction: column; gap: 1rem; }
.booking-step-title { display: flex; align-items: center; gap: 0.6rem; font-size: 1.05rem; margin: 0.6rem 0 0.2rem; }
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--brand-primary); color: var(--brand-text-on-primary); font-size: 0.85rem; font-weight: 800;
}
.option-chips { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.option-chip {
    padding: 0.55rem 1rem; border-radius: var(--radius-sm); cursor: pointer;
    border: 1px solid var(--border-color); background: var(--brand-bg); color: var(--brand-text);
    font: 600 0.9rem var(--font-body); transition: 0.12s;
}
.option-chip:hover { border-color: var(--brand-primary); }
.option-chip.active { background: var(--brand-primary); color: var(--brand-text-on-primary); border-color: var(--brand-primary); }
.chip-meta { opacity: 0.65; font-weight: 500; margin-left: 0.3rem; font-size: 0.8rem; }
.day-chip { display: flex; flex-direction: column; min-width: 74px; text-align: center; }
.day-name { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.75; }
.day-date { font-weight: 700; }
.success-mark {
    width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%;
    background: #e6f6ec; color: #1c7c3f; font-size: 2rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.booking-confirmation, .booking-disabled { padding: 2.5rem; }

/* ---------- AI placeholder ---------- */
.ai-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.35rem; padding: 1.6rem; min-height: 120px; text-align: center;
    border: 2px dashed color-mix(in srgb, var(--brand-primary) 45%, transparent);
    border-radius: var(--radius);
    background: repeating-linear-gradient(45deg,
        color-mix(in srgb, var(--brand-primary) 4%, transparent) 0 12px,
        transparent 12px 24px);
    color: var(--brand-text-muted);
}
.ai-placeholder-tag {
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em;
    background: var(--brand-primary); color: var(--brand-text-on-primary);
    padding: 0.1rem 0.5rem; border-radius: 4px;
}
.ai-placeholder-label { font-weight: 700; color: var(--brand-text); }
.ai-placeholder-hint { font-size: 0.8rem; max-width: 420px; }

/* ---------- Auth pages ---------- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem 1.25rem; gap: 1.4rem; }
.auth-brand { text-decoration: none; }
.auth-card {
    width: 100%; max-width: 440px; background: var(--brand-surface);
    border: 1px solid var(--border-color); border-radius: var(--radius);
    padding: 2rem; box-shadow: var(--shadow);
}
.auth-title { font-size: 1.5rem; margin-bottom: 0.3rem; }
.auth-subtitle { color: var(--brand-text-muted); font-size: 0.92rem; margin-top: 0; }
.auth-link { font-weight: 600; }
.auth-footer-links { margin: 1.2rem 0 0; font-size: 0.9rem; color: var(--brand-text-muted); }
.auth-divider { display: flex; align-items: center; gap: 0.8rem; margin: 1.3rem 0 1rem; color: var(--brand-text-muted); font-size: 0.82rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-color); }
.external-login-buttons { display: flex; flex-direction: column; gap: 0.55rem; }
.auth-back { font-size: 0.88rem; }

/* ---------- Account manage ---------- */
.manage-grid { display: grid; grid-template-columns: 220px 1fr; gap: 1.6rem; align-items: start; }
.manage-nav { display: flex; flex-direction: column; gap: 0.2rem; }
.manage-nav-link { padding: 0.55rem 0.9rem; border-radius: var(--radius-sm); color: var(--brand-text); font-weight: 600; }
.manage-nav-link:hover { background: var(--brand-surface); text-decoration: none; }
.manage-nav-link.active { background: var(--brand-primary); color: var(--brand-text-on-primary); }
.manage-title { margin-top: 0; }
.manage-subtitle { margin-top: 1.4rem; }
.manage-content { max-width: 560px; }
@media (max-width: 780px) { .manage-grid { grid-template-columns: 1fr; } }

.simple-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.simple-table td, .simple-table th { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: top; }
.input-with-badge { display: flex; align-items: center; gap: 0.6rem; }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem; margin: 1rem 0; }
.recovery-code { padding: 0.45rem; text-align: center; background: var(--brand-surface); border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.shared-key code { font-size: 1.15rem; letter-spacing: 0.08em; background: var(--brand-surface); padding: 0.5rem 0.8rem; border-radius: var(--radius-sm); display: inline-block; }
.otpauth-uri { word-break: break-all; font-size: 0.78rem; }
.setup-steps li { margin-bottom: 1.2rem; }

/* ---------- Account dashboard ---------- */
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.4rem; }
.account-card h3 { margin-bottom: 0.8rem; }
.account-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.account-list li { padding: 0.55rem 0; border-bottom: 1px dashed var(--border-color); }
.subscription-row { padding: 0.6rem 0; border-bottom: 1px dashed var(--border-color); margin-bottom: 0.6rem; }
.subscription-row.canceling { opacity: 0.85; }

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; background: var(--brand-bg); }
.admin-sidebar {
    background: var(--brand-secondary); color: var(--brand-text-on-primary);
    display: flex; flex-direction: column; padding: 1.2rem 0.9rem; gap: 1.2rem;
    position: sticky; top: 0; height: 100vh;
}
.admin-brand { color: inherit; font: 800 1.1rem var(--font-heading); padding: 0 0.6rem; }
.admin-brand:hover { text-decoration: none; }
.admin-nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.admin-nav-link { display: block; padding: 0.55rem 0.9rem; border-radius: var(--radius-sm); color: inherit; opacity: 0.82; font-weight: 600; }
.admin-nav-link:hover { opacity: 1; background: rgba(255,255,255,0.08); text-decoration: none; }
.admin-nav-link.active { opacity: 1; background: var(--brand-primary); }
.admin-main { display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.8rem 1.6rem; border-bottom: 1px solid var(--border-color);
    background: var(--brand-surface);
}
.admin-topbar-title { font-weight: 800; }
.admin-content { padding: 1.6rem; }
.admin-page-header { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.admin-page-header h1 { margin: 0; font-size: 1.6rem; }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } .admin-sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; } .admin-nav { flex-direction: row; flex-wrap: wrap; } }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.9rem; margin-bottom: 1.6rem; }
.kpi-card {
    background: var(--brand-surface); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.15rem;
}
.kpi-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-text-muted); }
.kpi-value { font: 800 1.7rem var(--font-heading); }
.kpi-delta { font-size: 0.78rem; font-weight: 700; }
.kpi-delta.up { color: #1c7c3f; }
.kpi-delta.down { color: #b03024; }

.admin-panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.2rem; }
.admin-panel {
    background: var(--brand-surface); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 1.2rem 1.3rem; min-width: 0;
}
.admin-panel.wide { grid-column: 1 / -1; }
.admin-panel h3 { font-size: 1.02rem; margin-bottom: 0.8rem; }
.admin-filter-bar { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 1rem; }
.admin-filter-bar .form-control { max-width: 230px; }
.panel-divider { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--border-color); }
.panel-note { font-size: 0.82rem; margin-top: 0.8rem; }
.unread-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--brand-primary); }
.message-detail { margin-top: 1.2rem; }
.message-body { white-space: pre-wrap; }
.booking-pending-card { padding: 0.8rem 0; border-bottom: 1px dashed var(--border-color); }
.booking-pending-card.selected { background: color-mix(in srgb, var(--brand-primary) 6%, transparent); }
.booking-notes { font-style: italic; color: var(--brand-text-muted); font-size: 0.88rem; margin: 0.2rem 0; }
.swatch-row { display: flex; gap: 0.4rem; }
.swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border-color); display: inline-block; }
.endpoint-code { display: block; font-size: 0.75rem; margin-top: 0.2rem; }
.config-json {
    max-height: 480px; overflow: auto; background: var(--brand-bg);
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    padding: 1rem; font-size: 0.78rem; line-height: 1.5;
}

/* ---------- Footer ---------- */
.site-footer {
    background: color-mix(in srgb, var(--brand-surface) 55%, var(--brand-bg));
    color: var(--brand-text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 0;
}
.footer-grid { display: grid; grid-template-columns: 1.3fr 0.8fr 1fr 1.1fr; gap: 2rem; padding-top: 3rem; padding-bottom: 2rem; }
.footer-col h4 { color: var(--brand-text); font-size: 0.95rem; margin-bottom: 0.8rem; }
.footer-col a { display: block; color: inherit; padding: 0.15rem 0; }
.footer-col a:hover { color: var(--brand-primary); text-decoration: none; }
.footer-brand .brand-text { color: var(--brand-text); }
.footer-tagline { opacity: 0.8; font-size: 0.9rem; }
.footer-social { display: flex; gap: 0.9rem; }
.footer-social a { display: inline; }
.footer-hours { display: flex; justify-content: space-between; font-size: 0.85rem; opacity: 0.85; padding: 0.12rem 0; }
.footer-newsletter-note { font-size: 0.85rem; opacity: 0.8; }
.newsletter-form { display: flex; gap: 0.5rem; }
.newsletter-form .form-control { background: color-mix(in srgb, var(--brand-text) 6%, transparent); border-color: var(--border-color); color: var(--brand-text); }
.newsletter-form .form-control::placeholder { color: color-mix(in srgb, var(--brand-text) 45%, transparent); }
.newsletter-status { font-size: 0.82rem; min-height: 1.2em; margin: 0.4rem 0 0; }
.footer-bottom {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem;
    padding-top: 1.2rem; padding-bottom: 1.6rem; font-size: 0.82rem; opacity: 0.75;
    border-top: 1px solid var(--border-color);
}
.footer-bottom a { color: inherit; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Legal ---------- */
.legal-page h2 { font-size: 1.2rem; margin-top: 2rem; }

/* ---------- Blog ---------- */
/* Index cards ride .card-grid + .surface-card; the article body lives in .container.narrow
   like the legal pages. Everything is token-driven so both themes pick it up unchanged. */
.post-grid { align-items: stretch; }
.post-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.16s ease, border-color 0.16s ease; }
.post-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--border-color)); }
.post-card-media { display: block; background: color-mix(in srgb, var(--brand-primary) 6%, var(--brand-bg)); }
.post-card-media:hover { text-decoration: none; }
.post-card-media .ai-placeholder { border-radius: 0; border-width: 0 0 2px; }
.post-card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.post-card-body { padding: 1.25rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.post-card-body h3 { font-size: 1.15rem; margin: 0; }
.post-card-body h3 a { color: inherit; }
.post-card-body h3 a:hover { color: var(--brand-primary); text-decoration: none; }
.post-card-body p { color: var(--brand-text-muted); margin: 0; flex: 1; }
.post-card-tags { margin-top: 0.2rem; }
.post-card-tags .tag-chip { padding: 0.2rem 0.7rem; font-size: 0.75rem; }
.post-card-more { font-weight: 700; font-size: 0.9rem; margin-top: 0.3rem; align-self: flex-start; }
.post-featured {
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--brand-accent);
}

.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; font-size: 0.85rem; color: var(--brand-text-muted); letter-spacing: 0.02em; margin: 0; }

/* Byline: the writer's avatar (or the site logo when the post has none) beside the name. */
.post-author { display: flex; align-items: center; gap: 0.5rem; }
.post-author-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--brand-surface); }
.post-page .post-author-avatar { width: 36px; height: 36px; }

/* Tag chips double as links on the blog (the gallery uses buttons). */
a.tag-chip { display: inline-block; text-decoration: none; }
a.tag-chip:hover { border-color: var(--brand-primary); color: var(--brand-primary); text-decoration: none; }
a.tag-chip.active:hover { color: var(--brand-text-on-primary); border-color: var(--brand-primary); }

/* Article page */
.post-header { margin-bottom: 1.6rem; }
.post-page .section-title { margin-bottom: 0.6rem; }
.post-hero { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-radius: var(--radius); border: 1px solid var(--border-color); margin: 0 0 2rem; }
.post-body { font-size: 1.05rem; line-height: 1.75; }
.post-body > :first-child { margin-top: 0; }
.post-body h2 { font-size: 1.45rem; margin-top: 2.2rem; }
.post-body h3 { font-size: 1.15rem; margin-top: 1.6rem; }
.post-body h4 { font-size: 1.02rem; margin-top: 1.3rem; }
.post-body p { margin: 0 0 1.1rem; }
.post-body ul, .post-body ol { padding-left: 1.4rem; margin: 0 0 1.1rem; }
.post-body li { margin-bottom: 0.35rem; }
.post-body li::marker { color: var(--brand-accent); }
.post-body blockquote {
    margin: 1.4rem 0; padding: 0.2rem 0 0.2rem 1.1rem;
    border-left: 3px solid var(--brand-accent); color: var(--brand-text-muted); font-style: italic;
}
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); margin: 1rem 0; }
.post-body figure { margin: 1.4rem 0; }
.post-body figcaption { font-size: 0.85rem; color: var(--brand-text-muted); text-align: center; margin-top: 0.4rem; }
.post-body a { text-decoration: underline; text-underline-offset: 3px; }
.post-body pre { overflow-x: auto; padding: 1rem; background: var(--brand-surface); border: 1px solid var(--border-color); border-radius: var(--radius-sm); font-size: 0.88rem; }
.post-body code { font-size: 0.92em; }
.post-body table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: 0.95rem; }
.post-body th, .post-body td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: top; }
.post-body hr { border: 0; border-top: 1px solid var(--border-color); margin: 2rem 0; }
.post-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 2rem; }
.post-updated { font-size: 0.85rem; margin: 1.2rem 0 0; }

@media (prefers-reduced-motion: reduce) {
    .post-card { transition: none; }
    .post-card:hover { transform: none; }
}

/* ---------- Local ranking / competitor comparison ---------- */
.ranking-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.5rem; align-items: start; }
.ranking-side { display: flex; flex-direction: column; gap: 1.2rem; }
.ranking-search-term { color: var(--brand-text-muted); font-size: 0.92rem; margin-top: 0; }
.ranking-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-text-muted); }
.ranking-table td { vertical-align: middle; }
.ranking-position { font: 800 1.1rem var(--font-heading); color: var(--brand-text-muted); width: 2.5rem; }
.ranking-name { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; flex-wrap: wrap; }
.ranking-note { font-size: 0.85rem; color: var(--brand-text-muted); margin-top: 0.15rem; }
.ranking-address { font-size: 0.8rem; color: var(--brand-text-muted); opacity: 0.8; }
.ranking-rating { font-weight: 800; margin-right: 0.35rem; }
.ranking-you { background: color-mix(in srgb, var(--brand-primary) 10%, transparent); }
.ranking-you .ranking-position { color: var(--brand-primary); }
.ranking-source { font-size: 0.8rem; margin-bottom: 0; }
@media (max-width: 900px) { .ranking-grid { grid-template-columns: 1fr; } }

/* ── About: visit & directions ─────────────────────────────────────────── */
.visit-grid { display: grid; grid-template-columns: minmax(300px, 2fr) 3fr; gap: 1.25rem; align-items: stretch; }
@media (max-width: 800px) { .visit-grid { grid-template-columns: 1fr; } }
.visit-card { display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem; }
.visit-row { display: flex; flex-direction: column; gap: 0.15rem; }
.visit-row a { font-weight: 600; }
.visit-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--brand-text-muted); }
.visit-hours { display: flex; flex-direction: column; gap: 0.35rem; }
.visit-hours .hours-list { margin: 0; }
/* Three actions on one line: shrink the buttons rather than let them wrap. */
.visit-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.visit-actions .btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
    white-space: nowrap;
    flex: 0 1 auto;
    min-width: 0;
}

/* Below the split the row is allowed to wrap again — three buttons on a phone
   would otherwise shrink past legibility. */
@media (max-width: 620px) {
    .visit-actions { flex-wrap: wrap; }
    .visit-actions .btn { flex: 1 1 auto; text-align: center; }
}
.map-card { padding: 0; overflow: hidden; min-height: 360px; display: flex; }
.map-frame { border: 0; width: 100%; min-height: 360px; flex: 1; display: block; }

/* The map sits under a brand mark so the pin is unmistakably this business. */
.map-card-wrap { position: relative; width: 100%; display: flex; flex: 1; }
.map-card-wrap .map-frame { width: 100%; }

.map-logo {
    position: absolute;
    left: 0.75rem;
    bottom: 0.75rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--brand-surface);
    border: 2px solid var(--brand-surface);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    pointer-events: none;
}

.map-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Inline placement under the ranking table — a touch more breathing room above it. */
.visit-grid-inline { margin-top: 1.5rem; }


/* ── Contact: person card + mobile call bar ── */
.contact-person { display: flex; align-items: center; gap: 1.4rem; padding: 1.3rem 1.5rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.contact-person-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--brand-primary); flex-shrink: 0; }
.contact-person-body { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.contact-person-name { font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; }
.contact-person-role { color: var(--brand-text-muted); font-size: 0.9rem; }
.contact-call-btn { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 1.15rem; font-weight: 800; margin-top: 0.4rem; width: fit-content; }
.contact-email-line { font-size: 0.9rem; }
.contact-mobile-callbar { display: none; }
@media (max-width: 640px) {
    .contact-mobile-callbar {
        position: fixed; left: 0.9rem; right: 0.9rem; bottom: 0.9rem; z-index: 60;
        display: flex; align-items: center; justify-content: center; gap: 0.5rem;
        background: var(--brand-primary); color: var(--brand-text-on-primary);
        font-weight: 800; font-size: 1.05rem; padding: 0.85rem 1rem; border-radius: 999px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); text-decoration: none;
    }
    .contact-person { flex-direction: column; text-align: center; }
    .contact-person-body { align-items: center; }
}


/* ── Cart ── */
.cart-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 1.25rem; align-items: start; }
@media (max-width: 800px) { .cart-grid { grid-template-columns: 1fr; } }
.cart-empty { padding: 2.5rem; text-align: center; display: flex; flex-direction: column; gap: 1rem; align-items: center; }
.cart-items { padding: 0.5rem 1.2rem; }
.cart-line { display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem 0; border-bottom: 1px solid var(--border-color); }
.cart-line:last-child { border-bottom: 0; }
.cart-line-img { width: 56px; height: 56px; object-fit: cover; border-radius: 0.5rem; flex-shrink: 0; }
.cart-line-body { flex: 1; min-width: 0; }
.cart-line-name { font-weight: 700; }
.cart-line-unit { color: var(--brand-text-muted); font-size: 0.82rem; }
.cart-qty { display: flex; align-items: center; gap: 0.5rem; }
.cart-qty button { width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 1px solid var(--border-color); background: transparent; color: var(--brand-text); cursor: pointer; font-size: 1rem; line-height: 1; }
.cart-qty button:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.cart-line-total { font-weight: 700; min-width: 5.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.cart-remove { background: transparent; border: 0; color: var(--brand-text-muted); font-size: 1.2rem; cursor: pointer; padding: 0.2rem 0.4rem; }
.cart-remove:hover { color: #ef4444; }
.cart-summary { padding: 1.4rem; display: flex; flex-direction: column; gap: 0.7rem; position: sticky; top: calc(var(--header-h) + 1rem); }
.cart-summary h3 { margin: 0 0 0.3rem; }
.cart-code-row input { width: 100%; }
.cart-apply { align-self: flex-start; }
.cart-code-error { color: #ef4444; font-size: 0.82rem; }
.cart-code-ok { color: #22c55e; font-size: 0.82rem; }
.cart-totals { margin: 0.4rem 0 0; display: flex; flex-direction: column; gap: 0.35rem; }
.cart-totals div { display: flex; justify-content: space-between; }
.cart-totals dt { color: var(--brand-text-muted); font-weight: 500; }
.cart-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.cart-discount dd { color: #22c55e; }
.cart-grand { border-top: 1px solid var(--border-color); padding-top: 0.5rem; font-weight: 800; font-size: 1.1rem; }
.cart-checkout { width: 100%; }
.cart-note { color: var(--brand-text-muted); font-size: 0.78rem; margin: 0; }

/* ── Header cart button ── */
.nav-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.55rem;
    /* The collapsed mobile nav stretches links full-width — keep the badge glued
       to the icon by letting this link hug its content instead. */
    width: max-content;
    align-self: center;
}

.nav-cart-count {
    position: absolute;
    top: -0.2rem;
    right: -0.3rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--primary, #4f46e5);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Store admin ---------- */
/* The storefront back office. Everything below is brand-variable driven so a customer's
   own palette themes the admin the same way it themes the public site. */

.admin-nav-link { display: flex; align-items: center; gap: 0.6rem; }

.admin-nav-icon {
    font-size: 1.05rem;
    line-height: 1;
    opacity: 0.85;
    flex-shrink: 0;
}

.admin-nav-group {
    padding: 0.9rem 0.9rem 0.25rem;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.55;
}

/* Page header with an action slot on the right. */
.store-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.3rem;
}

.store-header-text { min-width: 0; }
.store-header h1 { margin: 0 0 0.15rem; font-size: 1.6rem; }
.store-header-sub { color: var(--brand-text-muted); font-size: 0.9rem; }
.store-header-actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Toolbar above a grid: search on the left, filters and actions trailing. */
.store-toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.9rem;
    background: var(--brand-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.store-search {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1 1 240px;
    min-width: 0;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--brand-bg);
}

.store-search input {
    border: 0;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
    color: inherit;
}

.store-search .material-symbols-outlined { font-size: 1.1rem; opacity: 0.6; }

.store-toolbar-spacer { flex: 1 1 auto; }

/* Segmented status filter. */
.store-segment { display: inline-flex; border: 1px solid var(--border-color); border-radius: 999px; overflow: hidden; }

.store-segment button {
    border: 0;
    background: transparent;
    padding: 0.38rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brand-text-muted);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.store-segment button:hover { background: color-mix(in srgb, var(--brand-primary) 8%, transparent); }

.store-segment button.is-active {
    background: var(--brand-primary);
    color: var(--brand-text-on-primary);
}

/* Card wrapper for a data grid. */
.store-panel {
    background: var(--brand-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.store-panel-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
}

.store-panel-body { padding: 1rem; }

/* Product cell: thumbnail beside name + meta. */
.store-product-cell { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }

.store-thumb {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-color);
    background: var(--brand-bg);
}

.store-thumb-empty {
    display: grid;
    place-items: center;
    color: var(--brand-text-muted);
}

.store-thumb-empty .material-symbols-outlined { font-size: 1.2rem; }

.store-cell-title { font-weight: 700; }
.store-cell-sub { font-size: 0.76rem; color: var(--brand-text-muted); }

/* Money reads as a column of aligned figures, never ragged text. */
.store-money { font-variant-numeric: tabular-nums; font-weight: 700; }
.store-money-muted { font-variant-numeric: tabular-nums; color: var(--brand-text-muted); }

/* Status pills. */
.store-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.store-pill-ok { background: color-mix(in srgb, #1c7c3f 14%, transparent); color: #1c7c3f; border-color: color-mix(in srgb, #1c7c3f 30%, transparent); }
.store-pill-warn { background: color-mix(in srgb, #b06a00 14%, transparent); color: #b06a00; border-color: color-mix(in srgb, #b06a00 30%, transparent); }
.store-pill-bad { background: color-mix(in srgb, #b03024 14%, transparent); color: #b03024; border-color: color-mix(in srgb, #b03024 30%, transparent); }
.store-pill-muted { background: color-mix(in srgb, var(--brand-text-muted) 12%, transparent); color: var(--brand-text-muted); border-color: var(--border-color); }

/* Empty state shared by every store grid. */
.store-empty {
    display: grid;
    place-items: center;
    gap: 0.5rem;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--brand-text-muted);
}

.store-empty .material-symbols-outlined { font-size: 2.4rem; opacity: 0.45; }
.store-empty-title { font-weight: 700; color: inherit; }

/* Slide-over editor — a full form without leaving the list. */
.store-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1200;
}

.store-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(560px, 96vw);
    z-index: 1210;
    display: flex;
    flex-direction: column;
    background: var(--brand-surface);
    border-left: 1px solid var(--border-color);
    box-shadow: -18px 0 48px rgba(0, 0, 0, 0.25);
    animation: store-drawer-in 0.2s ease-out both;
}

@keyframes store-drawer-in {
    from { transform: translateX(24px); }
    to { transform: none; }
}

.store-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

.store-drawer-head h2 { margin: 0; font-size: 1.15rem; }
.store-drawer-body { flex: 1; overflow-y: auto; padding: 1.2rem; }

.store-drawer-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.9rem 1.2rem;
    border-top: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--brand-bg) 60%, var(--brand-surface));
}

.store-drawer-close {
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--brand-text-muted);
    display: grid;
    place-items: center;
}

.store-drawer-close:hover { color: inherit; }

/* Form grid inside the drawer. */
.store-form { display: grid; gap: 0.9rem; }
.store-form-row { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.store-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }

.store-field label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-text-muted);
}

.store-field-hint { font-size: 0.74rem; color: var(--brand-text-muted); }

.store-section-label {
    margin-top: 0.4rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-color);
    font-weight: 800;
    font-size: 0.9rem;
}

/* Order detail summary lines. */
.store-summary { display: grid; gap: 0.35rem; }

.store-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
}

.store-summary-row.is-total {
    margin-top: 0.35rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    font-weight: 800;
    font-size: 1rem;
}

@media (prefers-reduced-motion: reduce) {
    .store-drawer { animation: none; }
    .store-segment button { transition: none; }
}

/* ---------- Storefront ---------- */
.shop-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.6rem; }

.shop-filter {
    border: 1px solid var(--border-color);
    background: var(--brand-surface);
    color: var(--brand-text-muted);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.shop-filter:hover { color: var(--brand-text); border-color: var(--brand-primary); }

.shop-filter.is-active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--brand-text-on-primary);
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.4rem;
}

.shop-card {
    display: flex;
    flex-direction: column;
    background: var(--brand-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.shop-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--border-color));
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.10);
}

.shop-card-media {
    display: block;
    aspect-ratio: 4 / 3;
    background: color-mix(in srgb, var(--brand-primary) 6%, var(--brand-bg));
    overflow: hidden;
}

.shop-card-media { display: grid; place-items: center; }
.shop-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; grid-area: 1 / 1; }

.shop-card-placeholder {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font: 800 2.2rem var(--font-heading);
    color: color-mix(in srgb, var(--brand-primary) 55%, transparent);
}

.shop-card-body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.shop-card-title { font-size: 1rem; margin: 0; }
.shop-card-title a { color: inherit; }
.shop-card-title a:hover { color: var(--brand-primary); text-decoration: none; }
.shop-card-desc { font-size: 0.86rem; color: var(--brand-text-muted); margin: 0; }

.shop-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.shop-price { font-weight: 800; font-variant-numeric: tabular-nums; }
.shop-price-unit { font-weight: 600; font-size: 0.82rem; color: var(--brand-text-muted); }

/* Detail */
.shop-crumbs {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--brand-text-muted);
    margin-bottom: 1.2rem;
}

.shop-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

@media (max-width: 780px) {
    .shop-detail { grid-template-columns: 1fr; gap: 1.4rem; }
}

.shop-detail-media {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: color-mix(in srgb, var(--brand-primary) 6%, var(--brand-bg));
}

.shop-detail-media { display: grid; place-items: center; }
.shop-detail-media img { width: 100%; height: 100%; object-fit: cover; display: block; grid-area: 1 / 1; }

.shop-detail-info { display: flex; flex-direction: column; gap: 0.8rem; }
.shop-detail-title { margin: 0; font-size: 2rem; }
.shop-detail-price { font: 800 1.5rem var(--font-heading); font-variant-numeric: tabular-nums; }
.shop-detail-meta { color: var(--brand-text-muted); font-size: 0.9rem; }
.shop-detail-desc { margin: 0; line-height: 1.65; }

.shop-detail-actions { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.4rem; }

.shop-qty {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--brand-text-muted);
}

.shop-qty input {
    width: 4.5rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--brand-surface);
    color: inherit;
}

.shop-related { margin-top: 3rem; }
.shop-related-title { font-size: 1.2rem; margin-bottom: 1rem; }

@media (prefers-reduced-motion: reduce) {
    .shop-card, .shop-filter { transition: none; }
    .shop-card:hover { transform: none; }
}

/* Checkout receipt on the thank-you page. */
.checkout-receipt {
    max-width: 420px;
    margin: 1.4rem auto;
    text-align: left;
    background: var(--brand-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
}

.checkout-receipt-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    font-weight: 800;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-color);
}

.checkout-receipt-lines { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.35rem; }

.checkout-receipt-lines li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
}

.checkout-receipt-note { margin-top: 0.6rem; font-size: 0.85rem; color: var(--brand-text-muted); }

/* ---------- Google Places panels on the comparison page ---------- */
.places-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.places-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    padding: 0 0.4rem;
    height: 1.5rem;
    border-radius: 999px;
    background: var(--brand-primary);
    color: var(--brand-text-on-primary);
    font-size: 0.75rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.places-hours-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.places-hours-list li { font-size: 0.9rem; color: var(--brand-text-muted); }

.places-thumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.places-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: block;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.places-thumb:hover { transform: translateY(-2px); border-color: var(--brand-primary); }
.places-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.places-thumb-more {
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--brand-text-muted);
    background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
}

/* A distance the browser actually measured reads as live, not configured. */
.ranking-distance.is-measured { color: var(--brand-primary); font-weight: 700; }

/* ---------- Google reviews ---------- */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.2rem;
}

.review-card { display: flex; flex-direction: column; gap: 0.7rem; margin: 0; }

.review-head { display: flex; align-items: center; gap: 0.7rem; }

.review-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: color-mix(in srgb, var(--brand-primary) 16%, transparent);
    color: var(--brand-primary);
}

.review-meta { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.review-author { font-weight: 700; }
.review-when { font-size: 0.78rem; color: var(--brand-text-muted); }

.review-text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--brand-text-muted);
}

@media (prefers-reduced-motion: reduce) {
    .places-thumb { transition: none; }
    .places-thumb:hover { transform: none; }
}

/* Image slot editor (MediaUploadField): preview + URL box + upload button. Used in the
   settings grid and the product drawer. */
.media-upload { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.media-upload-row { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }

.media-upload-preview {
    height: 40px;
    max-width: 96px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--brand-bg);
}

.media-upload-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

.media-upload-pick {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--brand-surface);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.media-upload-pick:hover { border-color: var(--brand-primary); }
.media-upload-pick:focus-within { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.media-upload-pick.is-busy { opacity: 0.6; cursor: progress; }
.media-upload-pick .material-symbols-outlined { font-size: 1.05rem; }

/* The real file input sits invisibly over the label so clicks and keyboard focus reach it. */
.media-upload-pick input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.media-upload-hint { font-size: 0.74rem; color: var(--brand-text-muted); }
.media-upload-error { font-size: 0.78rem; color: var(--bs-danger, #b42318); }

/* Read-mode thumbnail beside an image setting's value in the settings grid. */
.setting-thumb {
    height: 40px;
    max-width: 80px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--brand-bg);
}
