/* ============================================================
   SOFIGÁS — PUBLIC FRONTEND DESIGN SYSTEM
   ============================================================ */

/* ── Design tokens ── */
:root {
    --brand-navy: #042350;
    --brand-navy-dark: #021530;
    --brand-navy-light: #0a3a7a;
    /* --accent-color is set inline per-request from CompanySettings.AccentColorHex */
    --accent-color: #042350;
    --accent-color-dark: color-mix(in srgb, var(--accent-color) 80%, black);

    --text-body: #33394a;
    --text-muted: #6b7280;
    --text-on-dark: #eef1f7;
    --text-on-dark-muted: #b7c2d6;

    --surface: #ffffff;
    --surface-alt: #f5f7fb;
    --surface-border: #e4e8f1;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    --shadow-sm: 0 2px 8px rgba(4, 35, 80, 0.06);
    --shadow-md: 0 12px 28px rgba(4, 35, 80, 0.12);
    --shadow-lg: 0 24px 48px rgba(4, 35, 80, 0.18);

    --space-section: 5rem;
}

body {
    color: var(--text-body);
    background-color: var(--surface-alt);
}

.site-main {
    background-color: var(--surface-alt);
}

a {
    color: var(--accent-color);
}

/* ── Header ── */
.site-header-bar {
    background: linear-gradient(120deg, var(--brand-navy) 0%, var(--brand-navy-dark) 100%);
    color: var(--text-on-dark);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.85rem 0;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-on-dark);
}

.site-brand-logo {
    width: 56px;
    height: auto;
}

.site-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.site-brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.site-brand-tagline {
    font-size: 0.75rem;
    color: var(--text-on-dark-muted);
}

.site-header-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.site-header-phone {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-on-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.site-header-phone:hover {
    color: var(--text-on-dark);
    opacity: 0.85;
}

.site-nav {
    background-color: var(--surface);
    border-bottom: 1px solid var(--surface-border);
    box-shadow: var(--shadow-sm);
}

.site-nav .nav-link {
    color: var(--text-body);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 1rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.15s ease;
}

.site-nav .nav-link:hover,
.site-nav .nav-link.active {
    color: var(--accent-color);
}

.site-nav .nav-link.active {
    position: relative;
}

.site-nav .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-sm);
}

/* ── Header search ── */
.site-search {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0.5rem 0;
}

.site-search-icon {
    position: absolute;
    left: 0.9rem;
    color: var(--text-muted);
    pointer-events: none;
}

.site-search-input {
    width: 100%;
    padding: 0.55rem 2.5rem 0.55rem 2.4rem;
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    background: var(--surface-alt);
    font-size: 0.88rem;
    color: var(--text-body);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.site-search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--surface);
}

.site-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.site-search-submit {
    position: absolute;
    right: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.site-search-submit:hover {
    color: var(--accent-color);
    background: var(--surface-border);
}

@media (min-width: 992px) {
    .site-search {
        margin: 0 1.5rem;
    }
}

.site-search-results {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.site-search-result-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-body);
    border-bottom: 1px solid var(--surface-border);
    transition: background-color 0.15s ease;
}

.site-search-result-item:hover {
    background: var(--surface-alt);
    color: var(--text-body);
}

.site-search-result-item img,
.site-search-result-noimg {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface-alt);
    flex-shrink: 0;
}

/* No-photo product: show the generic placeholder small and dimmed so it reads
   as "no image", matching the catalog cards' .img-placeholder treatment. */
.site-search-result-item img.site-search-result-noimg {
    object-fit: contain;
    padding: 14px;
    opacity: 0.85;
}

.site-search-result-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
    gap: 0.1rem;
}

.site-search-result-brand {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.site-search-result-name {
    font-size: 0.92rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-search-result-sku {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.site-search-result-price {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-color);
    flex-shrink: 0;
    white-space: nowrap;
}

.site-search-view-all {
    display: block;
    padding: 0.65rem 0.9rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-color);
    background: var(--surface-alt);
    text-decoration: none;
}

.site-search-view-all:hover {
    color: var(--accent-color-dark);
    text-decoration: underline;
}

.site-search-empty {
    padding: 0.9rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── Mega menu (e-commerce nav item) ── */
.mega-menu {
    position: relative;
}

.mega-menu-caret {
    margin-left: 0.15rem;
    opacity: 0.6;
    transition: transform 0.15s ease;
}

.mega-menu-toggle {
    display: none;
}

.mega-menu-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    width: 52rem;
    max-width: 90vw;
    max-height: min(34rem, calc(100vh - 6.5rem));
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 1.25rem 1.5rem;
    margin-top: -1px;
}

@media (min-width: 992px) {
    .mega-menu:hover .mega-menu-panel,
    .mega-menu:focus-within .mega-menu-panel {
        display: block;
    }

    .mega-menu:hover .mega-menu-caret {
        transform: rotate(180deg);
    }
}

.mega-menu-panel-inner {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.mega-menu-heading {
    display: block;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.mega-menu-brands {
    flex: 0 0 9.5rem;
    border-right: 1px solid var(--surface-border);
    padding-right: 1.5rem;
}

.mega-menu-categories {
    flex: 1 1 auto;
    min-width: 0;
}

.mega-menu-categories-columns {
    column-count: 4;
    column-gap: 1.5rem;
}

.mega-menu-category-group {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-bottom: 0.55rem;
}

/* Groups a layout's categories under their owning brand - shared across all four
   mega-menu layouts (SimpleList/Grid/ColumnsWithBrands/default) so a shopper can
   navigate brand -> categories directly from the menu, not just via a separate
   brand-only list. Clicking the heading itself goes to that brand's page. The
   bottom border is deliberate: with only one brand populated, a color/weight
   difference alone reads as "just another link" - a rule makes it look like a
   section divider regardless of how many brand groups exist. */
.mega-menu-brand-heading {
    display: block;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: var(--brand-navy);
    text-decoration: none;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.35rem;
    break-inside: avoid;
    break-after: avoid-column;
}

.mega-menu-brand-heading:hover {
    color: var(--accent-color);
}

.mega-menu-categories-columns .mega-menu-brand-heading {
    margin: 0 0 0.65rem;
}

.mega-menu-categories-columns .mega-menu-brand-heading:not(:first-child) {
    margin-top: 1.25rem;
}

.mega-menu-category-title {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-body);
    text-decoration: none;
    margin-bottom: 0.15rem;
}

.mega-menu-category-title:hover {
    color: var(--accent-color);
}

.mega-menu-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu-sublist-root > li {
    margin-bottom: 0.3rem;
}

.mega-menu-sublist .mega-menu-sublist {
    padding-left: 0.8rem;
    margin-top: 0.1rem;
}

.mega-menu-link {
    display: inline-block;
    padding: 0.1rem 0;
    color: var(--text-body);
    font-size: 0.82rem;
    text-decoration: none;
}

.mega-menu-link:hover {
    color: var(--accent-color);
}

/* Collapsed navbar (mobile/tablet): hover doesn't apply, so a caret
   button toggles the panel and it renders inline instead of absolute. */
@media (max-width: 991.98px) {
    .mega-menu {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .mega-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        margin-left: auto;
        background: none;
        border: none;
        color: var(--text-body);
    }

    .mega-menu-panel {
        position: static;
        width: 100%;
        max-width: none;
        box-shadow: none;
        border: 1px solid var(--surface-border);
        margin-top: 0.5rem;
    }

    .mega-menu.mega-menu-open .mega-menu-panel {
        display: block;
    }

    .mega-menu.mega-menu-open .mega-menu-toggle svg {
        transform: rotate(180deg);
    }

    .mega-menu-panel {
        max-height: 70vh;
    }

    .mega-menu-panel-inner {
        flex-direction: column;
        gap: 1rem;
    }

    .mega-menu-brands {
        flex: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--surface-border);
        padding-right: 0;
        padding-bottom: 0.75rem;
    }

    .mega-menu-categories-columns {
        column-count: 2;
        column-gap: 1rem;
    }
}

@media (max-width: 480px) {
    .mega-menu-categories-columns {
        column-count: 1;
    }
}

/* Layout variant: categories only, no brands sidebar — more room per column */
@media (min-width: 992px) {
    .mega-menu-panel--categoriesonly {
        width: 44rem;
    }

    .mega-menu-panel--categoriesonly .mega-menu-categories-columns {
        column-count: 5;
    }
}

/* Layout variant: simple list — plain, narrow single-column dropdown */
.mega-menu-panel--simplelist {
    padding: 0.5rem 0;
}

@media (min-width: 992px) {
    .mega-menu-panel--simplelist {
        width: 16rem;
    }
}

.mega-menu-simple-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu-simple-list .mega-menu-link {
    display: block;
    padding: 0.45rem 1.25rem;
    font-size: 0.88rem;
}

.mega-menu-simple-list .mega-menu-link:hover {
    background: var(--surface-alt);
}

.mega-menu-simple-list .mega-menu-brand-heading {
    padding: 0.6rem 1.25rem 0.3rem;
}

.mega-menu-simple-list li:first-child .mega-menu-brand-heading {
    padding-top: 0.1rem;
}

/* Layout variant: category grid with images */
@media (min-width: 992px) {
    .mega-menu-panel--grid {
        width: 46rem;
    }
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.9rem;
}

.mega-menu-grid-brand-heading {
    grid-column: 1 / -1;
    padding-top: 0.5rem;
}

.mega-menu-grid-brand-heading:first-child {
    padding-top: 0;
}

@media (max-width: 991.98px) {
    .mega-menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.mega-menu-grid-tile {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--surface-border);
}

.mega-menu-grid-tile-image {
    display: block;
    aspect-ratio: 4 / 3;
    background-color: var(--surface-alt);
    background-size: cover;
    background-position: center;
}

.mega-menu-grid-tile-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--surface-border);
}

.mega-menu-grid-tile-label {
    padding: 0.5rem 0.6rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-body);
}

.mega-menu-grid-tile:hover .mega-menu-grid-tile-label {
    color: var(--accent-color);
}

/* ── Buttons ── */
.btn-accent {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.55rem 1.25rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn-accent:hover {
    background-color: var(--accent-color-dark);
    border-color: var(--accent-color-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-outline-accent {
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: transparent;
    transition: all 0.15s ease;
}

.btn-outline-accent:hover {
    background-color: var(--accent-color);
    color: #fff;
}

/* ── Hero ── */
:root {
    --hero-height: clamp(440px, 62vh, 620px);
}

.hero {
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-light) 55%, var(--accent-color) 130%);
    color: var(--text-on-dark);
    min-height: var(--hero-height);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.08), transparent 55%);
    pointer-events: none;
}

.hero > .container {
    position: relative;
    z-index: 1;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--hero-text-muted, var(--text-on-dark-muted));
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.1rem;
    color: var(--hero-text-color, inherit);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--hero-text-muted, var(--text-on-dark-muted));
    max-width: 640px;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.hero-actions .btn-light-outline {
    border: 2px solid rgba(255, 255, 255, 0.55);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.55rem 1.25rem;
    background: transparent;
    transition: all 0.15s ease;
}

.hero-actions .btn-light-outline:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.hero-actions .btn-white {
    background: #fff;
    border: 2px solid #fff;
    color: var(--brand-navy);
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.55rem 1.25rem;
    transition: all 0.15s ease;
}

.hero-actions .btn-white:hover {
    background: #eef1f7;
    border-color: #eef1f7;
    color: var(--brand-navy);
}

.hero-actions .btn-dark-outline {
    border: 2px solid var(--brand-navy);
    color: var(--brand-navy);
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.55rem 1.25rem;
    background: transparent;
    transition: all 0.15s ease;
}

.hero-actions .btn-dark-outline:hover {
    background: var(--brand-navy);
    color: #fff;
}

/* ── Hero carousel (admin-managed slides) ── */
.hero-carousel {
    display: block;
    min-height: 0;
    padding: 0;
}

.hero-carousel .carousel-item {
    background-size: cover;
    background-position: center;
    background-color: var(--brand-navy);
    height: var(--hero-height);
    position: relative;
}

/* Darkening overlay for legibility — only needed over photos, not flat colors
   the admin already picked deliberately alongside a matching text color. */
.hero-carousel .carousel-item.has-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(4, 35, 80, 0.88) 0%, rgba(4, 35, 80, 0.6) 60%, rgba(4, 35, 80, 0.4) 100%);
}

.hero-carousel .carousel-item .container {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-carousel .carousel-indicators {
    margin-bottom: 1.5rem;
}

.hero-carousel .carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    opacity: 1;
}

.hero-carousel .carousel-indicators .active {
    background-color: #fff;
}

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    width: 6%;
}

/* ── Section header ── */
.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 2.5rem;
}

.section-header.text-start {
    margin-left: 0;
    margin-right: auto;
}

.section-header.text-end {
    margin-left: auto;
    margin-right: 0;
}

.section-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--brand-navy);
    margin-bottom: 0.75rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.02rem;
}

.section {
    padding: var(--space-section) 0;
}

.section-alt {
    background-color: var(--surface);
}

/* ── Block layout presets (page builder) ── */
/* Spacing is set per side: a block carries one spacing-top-* and one
   spacing-bottom-* class (see Block.SpacingCssClass). */
.spacing-top-compact { padding-top: 2.5rem; }
.spacing-top-normal { padding-top: var(--space-section); }
.spacing-top-spacious { padding-top: 7rem; }
.spacing-top-none { padding-top: 0; }

.spacing-bottom-compact { padding-bottom: 2.5rem; }
.spacing-bottom-normal { padding-bottom: var(--space-section); }
.spacing-bottom-spacious { padding-bottom: 7rem; }
.spacing-bottom-none { padding-bottom: 0; }

.bg-alt {
    background-color: var(--surface);
}

.bg-accent {
    background-color: var(--brand-navy);
    color: var(--text-on-dark);
}

.bg-accent .section-title,
.bg-accent .section-eyebrow,
.block-text-light .section-title,
.block-text-light .section-eyebrow {
    color: var(--text-on-dark);
}

.bg-accent .section-subtitle,
.block-text-light .section-subtitle {
    color: var(--text-on-dark-muted);
}

.block-text-light {
    color: var(--text-on-dark);
}

/* ── Feature / service cards ── */
.feature-grid {
    display: grid;
    gap: 1.5rem;
}

/* Auto: responsive, capped max-width per column (not 1fr) so a handful of cards
   don't stretch to fill the whole row — grows up to the cap, then the row just
   left-aligns with empty space to the right instead of ballooning. */
.feature-grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(260px, 340px));
}

/* 2/3/4 Colunas: an explicit, always-equal-width column count that DOES stretch
   to fill the row — the only way to guarantee cards span edge-to-edge regardless
   of how many there are or how wide the container is. */
.feature-grid-2col {
    grid-template-columns: repeat(2, 1fr);
}

.feature-grid-3col {
    grid-template-columns: repeat(3, 1fr);
}

.feature-grid-4col {
    grid-template-columns: repeat(4, 1fr);
}

/* Card size presets: only meaningful in Auto column mode (2/3/4 Colunas already fix
   an equal-width share of the row, leaving no range for a size preset to adjust). */
.feature-grid-auto.cards-size-small {
    grid-template-columns: repeat(auto-fit, minmax(200px, 260px));
}

.feature-grid-auto.cards-size-large {
    grid-template-columns: repeat(auto-fit, minmax(340px, 440px));
}

@media (max-width: 768px) {
    .feature-grid-2col,
    .feature-grid-3col,
    .feature-grid-4col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .feature-grid-2col,
    .feature-grid-3col,
    .feature-grid-4col {
        grid-template-columns: 1fr;
    }
}

/* Slider mode: cards stay in a single row and scroll horizontally instead of
   wrapping, for when there are more cards than comfortably fit at once. Columns
   still controls how many are visible at a time — same setting, different CSS
   family (flex-basis widths instead of grid-template-columns). */
.feature-slider-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.feature-slider {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
}

.feature-slider::-webkit-scrollbar {
    display: none;
}

.feature-slider .feature-card,
.feature-slider .product-card,
.feature-slider .product-card-text {
    scroll-snap-align: start;
    flex: 0 0 auto;
    height: auto;
}

.feature-slider-auto .feature-card,
.feature-slider-auto .product-card,
.feature-slider-auto .product-card-text {
    width: min(300px, 80vw);
}

.feature-slider-auto.cards-size-small .feature-card {
    width: min(240px, 80vw);
}

.feature-slider-auto.cards-size-large .feature-card {
    width: min(380px, 80vw);
}

.feature-slider-2col .feature-card,
.feature-slider-2col .product-card,
.feature-slider-2col .product-card-text {
    width: calc((100% - 1.5rem) / 2);
}

.feature-slider-3col .feature-card,
.feature-slider-3col .product-card,
.feature-slider-3col .product-card-text {
    width: calc((100% - 2 * 1.5rem) / 3);
}

.feature-slider-4col .feature-card,
.feature-slider-4col .product-card,
.feature-slider-4col .product-card-text {
    width: calc((100% - 3 * 1.5rem) / 4);
}

@media (max-width: 768px) {
    .feature-slider-3col .feature-card,
    .feature-slider-3col .product-card,
    .feature-slider-3col .product-card-text,
    .feature-slider-4col .feature-card,
    .feature-slider-4col .product-card,
    .feature-slider-4col .product-card-text {
        width: calc((100% - 1.5rem) / 2);
    }
}

@media (max-width: 480px) {
    .feature-slider-2col .feature-card,
    .feature-slider-2col .product-card,
    .feature-slider-2col .product-card-text,
    .feature-slider-3col .feature-card,
    .feature-slider-3col .product-card,
    .feature-slider-3col .product-card-text,
    .feature-slider-4col .feature-card,
    .feature-slider-4col .product-card,
    .feature-slider-4col .product-card-text {
        width: 85%;
    }
}

.feature-slider-arrow {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--brand-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, color 0.15s ease;
}

.feature-slider-arrow:hover:not(:disabled) {
    background: var(--accent-color);
    color: #fff;
}

.feature-slider-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

@media (max-width: 576px) {
    .feature-slider-arrow {
        display: none;
    }
}

.feature-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--surface-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--accent-color) 12%, white);
    color: var(--accent-color);
    margin-bottom: 1.25rem;
}

.feature-media {
    width: 100%;
    height: 180px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

/* Contain: letterboxed on a neutral background instead of cropped - the fix for
   logos/graphics with their own whitespace, where Cover chops off part of the mark. */
.feature-media.image-fit-contain {
    background: var(--surface-alt);
}

.feature-media.image-fit-contain img {
    object-fit: contain;
    padding: 0.75rem;
}

.feature-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.feature-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 0.6rem;
}

.feature-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.feature-text p:last-child {
    margin-bottom: 0;
}

.feature-text ul {
    padding-left: 1.1rem;
    margin-bottom: 1rem;
}

.feature-text li {
    margin-bottom: 0.35rem;
}

.feature-link {
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Cards layout variants: chosen per card (ContentCard.Layout), so the class lives
   on .feature-card itself rather than on the grid/slider container. Standard stacks
   media above text (default, no extra class); ImageLeft/ImageRight split the card
   into a media column and a text column. */
.feature-card.cards-layout-image-left,
.feature-card.cards-layout-image-right {
    display: flex;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}

.feature-card.cards-layout-image-right {
    flex-direction: row-reverse;
}

.feature-card.cards-layout-image-left .feature-media,
.feature-card.cards-layout-image-right .feature-media {
    width: 42%;
    flex-shrink: 0;
    margin-bottom: 0;
    border-radius: 0;
}

.feature-card.cards-layout-image-left .feature-body,
.feature-card.cards-layout-image-right .feature-body {
    padding: 1.75rem;
    flex: 1;
    min-width: 0;
}

/* A card with only an Icon (no Image) in a Left/Right layout still needs breathing
   room, since the card's own padding was zeroed out above for the image column. */
.feature-card.cards-layout-image-left > .feature-icon,
.feature-card.cards-layout-image-right > .feature-icon {
    margin: 1.75rem;
    flex-shrink: 0;
}

/* OnlyImage: no text body at all - the image fills the entire card. Positioned
   absolute/inset instead of a fixed height, because a fixed height left dead white
   space below the image whenever this card shared a grid row with a taller
   Standard/text card (the grid's default align-items:stretch pads the card's own
   box out to match, but a fixed-height image doesn't grow to fill it). Absolute
   positioning always fills whatever height the card box actually ends up with. */
.feature-card.cards-layout-only-image {
    padding: 0;
    overflow: hidden;
    position: relative;
    min-height: 240px;
}

.feature-card.cards-layout-only-image .feature-media {
    position: absolute;
    inset: 0;
    height: 100%;
    margin-bottom: 0;
    border-radius: 0;
}

.feature-card.cards-layout-only-image .feature-body {
    display: none;
}

/* A card with only an Icon (no Image) in OnlyImage layout still needs breathing
   room, same reasoning as the Left/Right fallback above. */
.feature-card.cards-layout-only-image > .feature-icon {
    margin: 1.75rem auto;
}

@media (max-width: 576px) {
    .feature-card.cards-layout-image-left,
    .feature-card.cards-layout-image-right {
        flex-direction: column;
    }

    .feature-card.cards-layout-image-left .feature-media,
    .feature-card.cards-layout-image-right .feature-media {
        width: 100%;
        height: 180px;
    }
}

/* ── Category tiles ── */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

/* Image nav-tile: a photo with the label sitting on a gradient scrim. The
   catalog's picture-led navigation cue (Phase 2 uses it for the Group cards on
   a brand page - every Group node has a real image). Pairs with .product-card-text
   for the tiers that don't. */
.category-tile {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--brand-navy);
    color: #fff;
    text-decoration: none;
    min-height: 170px;
    display: flex;
    align-items: flex-end;
    padding: 1.15rem 1.3rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    background-size: cover;
    background-position: center;
}

.category-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 35, 80, 0.05) 0%, rgba(4, 35, 80, 0.5) 55%, rgba(4, 35, 80, 0.92) 100%);
}

/* No photo on this node - fall back to a flat navy tile so the label still reads. */
.category-tile-noimg::before {
    background: transparent;
}

.category-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: #fff;
}

.category-tile:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.category-tile-body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.category-tile-name {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.25;
}

.category-tile-desc {
    position: relative;
    font-size: 0.82rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.82);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.15rem;
}

.category-tile-count {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.78);
    font-variant-numeric: tabular-nums;
    margin-top: 0.2rem;
}

.category-tile.is-active {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.25rem;
}

.brand-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.brand-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

.brand-tile img {
    max-width: 100%;
    max-height: 56px;
    object-fit: contain;
}

.brand-tile-name {
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--text-body);
    text-align: center;
}

/* ── Breadcrumbs ── */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--accent-color);
}

.breadcrumbs .sep {
    margin: 0 0.4rem;
    opacity: 0.6;
}

/* ── Product grid / cards ── */
.product-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.product-toolbar-search {
    display: flex;
    gap: 0.5rem;
    flex: 1 1 260px;
    min-width: 0;
}

.product-toolbar-search .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

.product-toolbar-brand,
.product-toolbar-sort {
    flex: 0 1 220px;
    min-width: 0;
}

.product-toolbar-clear {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: underline;
    white-space: nowrap;
}

.product-toolbar-clear:hover {
    color: var(--accent-color);
}

/* ── Product catalog: attribute facets ── */
.catalog-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.catalog-facets {
    width: 234px;
    flex-shrink: 0;
    align-self: flex-start;
    position: sticky;
    top: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 1.15rem 1.1rem;
    box-shadow: var(--shadow-sm);
}

.catalog-results {
    flex: 1;
    min-width: 0;
}

.facet-group {
    margin-bottom: 1.35rem;
}

.facet-group:last-child {
    margin-bottom: 0;
}

.facet-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-navy);
    margin-bottom: 0.6rem;
}

.facet-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Read-only "this attribute is the same on every product here" rows, shown above the
   filterable facets. */
.facet-group--info {
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--surface-border);
}

.facet-info-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.facet-info-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.82rem;
    padding: 0.2rem 0;
}

.facet-info-name {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.facet-info-value {
    color: var(--text-body);
    text-align: right;
}

.facet-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0;
    color: var(--text-body);
    text-decoration: none;
    font-size: 0.87rem;
}

.facet-option:hover {
    color: var(--accent-color);
}

.facet-checkbox {
    position: relative;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    border: 1px solid var(--surface-border);
    border-radius: 3px;
    background: var(--surface);
}

.facet-option.is-selected .facet-checkbox {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.facet-option.is-selected .facet-checkbox::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.facet-value {
    flex: 1;
}

.facet-option.is-selected .facet-value {
    font-weight: 600;
    color: var(--brand-navy);
}

.facet-count {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Mobile: the filter rail collapses behind a "Filtros" button. */
.catalog-facets-toggle {
    display: none;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brand-navy);
    cursor: pointer;
}

@media (max-width: 768px) {
    .catalog-layout {
        flex-direction: column;
    }

    .catalog-facets {
        width: 100%;
        position: static;
        display: none;
    }

    .catalog-facets.is-open {
        display: block;
    }

    .catalog-facets-toggle {
        display: inline-flex;
    }
}

/* ── Active-filter chips ── one per selected facet value, click to remove.
   Styled ahead of the Phase 3 faceted-grid markup so it can land without a
   second CSS pass. */
.catalog-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
}

.catalog-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.72rem;
    font-size: 0.82rem;
    line-height: 1.2;
    color: var(--brand-navy);
    background: color-mix(in srgb, var(--brand-navy) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-navy) 22%, transparent);
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
}

.catalog-chip:hover {
    background: color-mix(in srgb, var(--brand-navy) 15%, transparent);
    color: var(--brand-navy);
}

.catalog-chip__remove {
    font-size: 0.95rem;
    line-height: 1;
    opacity: 0.65;
}

.catalog-chip--clear {
    color: var(--text-muted);
    background: transparent;
    border-color: var(--surface-border);
}

.catalog-chip--clear:hover {
    color: var(--brand-navy);
    background: var(--surface-alt);
}

.product-result-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: -0.75rem 0 1.25rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.5rem;
}

/* Admin-configurable Columns override (ProductCatalogBlockSettings.Columns) - own
   dedicated classes rather than reusing .feature-grid-*col, since those are defined
   earlier in this file and .product-grid's own grid-template-columns above would win
   the cascade by source order if applied to the same element. */
.product-grid-2col {
    grid-template-columns: repeat(2, 1fr);
}

.product-grid-3col {
    grid-template-columns: repeat(3, 1fr);
}

.product-grid-4col {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .product-grid-2col,
    .product-grid-3col,
    .product-grid-4col {
        grid-template-columns: repeat(2, 1fr);
    }
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-navy);
    color: inherit;
}

.product-card:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.product-card-image {
    aspect-ratio: 1 / 1;
    background: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}

/* Products with no photo get a generic placeholder image (Images/product-placeholder.svg)
   so every card keeps the same square image region and the grid stays aligned - shown
   smaller and dimmer than a real photo so it reads as "no image", not as content. */
.product-card-image .img-placeholder {
    width: 42%;
    height: 42%;
    padding: 0;
    opacity: 0.85;
}

.product-card-badge {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
}

.product-card-body {
    padding: 1.1rem 1.15rem 1.3rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card-brand {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.product-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--brand-navy);
    margin-bottom: 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-sku {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: -0.35rem;
    margin-bottom: 0.6rem;
}

.product-card-variants-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-color);
    background: color-mix(in srgb, var(--accent-color) 10%, transparent);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    margin-top: -0.2rem;
    margin-bottom: 0.5rem;
}

.product-card-price {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 1rem;
}

.product-card-price-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
}

.product-card-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
}

/* .product-card-info grows to fill the body's height (pushing price to the bottom
   edge regardless of name length) - it replaces .product-card-name's own flex-grow
   now that name/sku are grouped in this wrapper alongside price-wrap. */
.product-card-info {
    flex-grow: 1;
}

/* ── Product catalog: List layout (ProductCatalogBlockSettings.Layout) ──
   One full-width row per product instead of a grid of cards - denser, easier to
   scan a lot of SKUs. Reuses every .product-card-* class, just reflows them
   horizontally instead of duplicating markup/CSS for a second card style. */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-list .product-card {
    flex-direction: row;
    align-items: center;
    height: auto;
}

.product-list .product-card-image {
    width: 88px;
    height: 88px;
    aspect-ratio: auto;
    flex-shrink: 0;
}

.product-list .product-card-image img {
    padding: 0.4rem;
}

.product-list .product-card-body {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.15rem;
}

.product-list .product-card-info {
    flex-grow: 0;
    min-width: 0;
}

.product-list .product-card-name {
    margin-bottom: 0;
    -webkit-line-clamp: 1;
}

.product-list .product-card-sku {
    margin-top: 0.15rem;
    margin-bottom: 0;
}

.product-list .product-card-price-wrap {
    text-align: right;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .product-list .product-card {
        flex-direction: column;
        align-items: stretch;
    }

    .product-list .product-card-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .product-list .product-card-body {
        flex-direction: column;
        align-items: flex-start;
    }

    .product-list .product-card-price-wrap {
        text-align: left;
    }
}

.product-card-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.4rem 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Text-only variant of .product-card (HighlightedLayout.TextCards) - no image
   area. Used when a category/brand has no picture, or for a denser look with
   more items per row. Shares the navy top-rule cue with an imageless
   .product-card so the two read as one family. */
.product-card-text {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    border-top: 3px solid var(--brand-navy);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    padding: 1.5rem 1rem;
    min-height: 110px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    height: 100%;
}

.product-card-text:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-navy);
    color: inherit;
}

.product-card-text:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.product-card-text-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--brand-navy);
}

/* ── Product detail ── */
.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 420px) 1fr;
    gap: 3rem;
}

@media (max-width: 900px) {
    .product-detail {
        grid-template-columns: 1fr;
    }
}

.product-gallery-main {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 0.9rem;
}

.product-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1.5rem;
}

.product-gallery-main .img-placeholder {
    width: 45%;
    height: 45%;
    padding: 0;
    opacity: 0.85;
}

.product-gallery-thumbs {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.product-gallery-thumbs img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    padding: 0.3rem;
    cursor: pointer;
}

.product-subgroup {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.product-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--brand-navy);
    margin-bottom: 0.4rem;
}

.product-sku {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.product-price-block {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
}

.product-price-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.product-description {
    color: var(--text-body);
    margin-bottom: 1.75rem;
    line-height: 1.65;
}

.variant-picker {
    margin-bottom: 1.5rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.variant-picker label {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
    display: block;
}

.variant-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.variant-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid #d8d8d8;
    border-radius: 999px;
    background: #fff;
    font-size: 0.88rem;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.variant-pill img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.variant-pill:hover {
    border-color: var(--accent-color);
}

.variant-pill.active {
    border-color: var(--accent-color);
    border-width: 2px;
    color: var(--accent-color);
    font-weight: 600;
}

.variant-pill:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    text-decoration: line-through;
}

.variant-facet-row {
    margin-bottom: 1rem;
}

.variant-facet-row label {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    display: block;
}

/* Option picker result cards - the products matching the current axis selection.
   Usually one; a few when products only differ by an unmodelled trait (e.g. SCHIENE
   "A 100" vs "R / A 100"), where the photo is the deciding cue. */
.option-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.6rem;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.option-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.option-card.current {
    border-color: var(--accent-color);
    border-width: 2px;
}

.option-card img {
    width: 100%;
    height: 96px;
    object-fit: contain;
    margin-bottom: 0.3rem;
}

.option-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
}

.option-card-sku {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.option-card-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-top: 0.15rem;
}

/* Photo swatch grid skin: same pill markup as the default style, laid out as a grid
   of larger square tiles with the photo on top and the label underneath. Only really
   distinguishes itself once an axis's photos are genuinely different per value - see
   project_image_deduplication for why most variants share one generic photo per shape. */
.variant-picker-style-photoswatchgrid.variant-pill-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 0.6rem;
}

.variant-picker-style-photoswatchgrid .variant-pill {
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.4rem;
    border-radius: 10px;
    padding: 0.5rem;
    text-align: center;
}

.variant-picker-style-photoswatchgrid .variant-pill img {
    width: 100%;
    aspect-ratio: 1;
    height: auto;
    border-radius: 6px;
}

/* Segmented control skin: the same pills rendered as one connected bar per axis
   instead of separate rounded chips. */
.variant-picker-style-segmentedcontrol.variant-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    overflow: hidden;
}

.variant-picker-style-segmentedcontrol .variant-pill {
    flex: 1 1 0;
    justify-content: center;
    border: none;
    border-radius: 0;
    background: #fff;
}

.variant-picker-style-segmentedcontrol .variant-pill:not(:first-child) {
    border-left: 1px solid #d8d8d8;
}

.variant-picker-style-segmentedcontrol .variant-pill.active {
    background: var(--accent-color);
    color: #fff;
    border-width: 0;
}

.variant-axis-select {
    max-width: 320px;
}

.add-to-cart-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 2rem;
}

.qty-input {
    width: 90px;
    text-align: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    padding: 0.55rem;
}

/* ── Product detail: sticky gallery + full-width spec block ── */
.product-detail {
    align-items: start;
}

.product-gallery {
    position: sticky;
    top: 1.5rem;
    align-self: start;
}

.product-detail-specs {
    margin-top: 3.5rem;
    max-width: 760px;
}

.spec-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 1rem;
}

@media (max-width: 900px) {
    .product-gallery {
        position: static;
    }
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--surface-border);
}

.spec-table .spec-group-row th {
    background: var(--surface-alt);
    text-align: left;
    padding: 0.6rem 0.9rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-navy);
    border-top: 1px solid var(--surface-border);
}

.spec-table tr:first-child th {
    border-top: 0;
}

.spec-table td {
    padding: 0.65rem 0.9rem;
    border-top: 1px solid var(--surface-border);
    font-size: 0.9rem;
}

.spec-table td:first-child {
    color: var(--text-muted);
    width: 45%;
}

.spec-group-title {
    font-weight: 700;
    color: var(--brand-navy);
    margin: 1.75rem 0 0.75rem;
}

/* ── Catalog documents (manufacturer data sheets etc.) ── */

.catalog-documents {
    margin-top: 3.5rem;
    max-width: 760px;
}

.catalog-documents__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 1rem;
}

.catalog-documents__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.catalog-documents__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.catalog-documents__link:hover {
    border-color: var(--brand-navy);
    background: var(--surface-alt);
}

.catalog-documents__icon {
    flex: 0 0 auto;
    color: #c0392b;
}

.catalog-documents__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.catalog-documents__name {
    font-weight: 600;
    font-size: 0.9rem;
}

.catalog-documents__meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ── Cart & checkout ── */

/* Mirrors AdminComponents.css' .status-badge/.badge-status - QuoteStatusViewHelpers'
   badge helper is shared between Admin, QuoteManager and the customer frontend, but
   only AdminComponents.css (never loaded here) had its shape - the frontend badge was
   rendering as bare inline-colored text with no padding/radius until this was added. */
.status-badge,
.badge-status {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
}

.cart-row {
    background: var(--surface);
}

.cart-row td {
    padding: 1rem;
    vertical-align: middle;
    border-top: 1px solid var(--surface-border);
    border-bottom: 1px solid var(--surface-border);
}

.cart-row td:first-child {
    border-left: 1px solid var(--surface-border);
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}

.cart-row td:last-child {
    border-right: 1px solid var(--surface-border);
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

.cart-item-thumb {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    padding: 0.3rem;
}

.cart-item-name {
    font-weight: 600;
    color: var(--brand-navy);
}

a.cart-item-name {
    text-decoration: none;
    display: inline-block;
}

a.cart-item-name:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.cart-item-sku {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cart-summary {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    padding: 1.75rem;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.cart-summary-row--neg { color: #b91c1c; }
.cart-summary-row--net { color: var(--brand-navy); font-weight: 700; }

.cart-summary-total {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--brand-navy);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--surface-border);
}

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--surface-border);
    margin-bottom: 1rem;
}

/* ── 404 page ── */
.error-page {
    max-width: 34rem;
    margin: 0 auto;
}

.error-page-code {
    font-size: clamp(4rem, 14vw, 7rem);
    font-weight: 800;
    line-height: 1;
    color: var(--accent-color);
    letter-spacing: -0.03em;
}

.error-page-lead {
    color: var(--text-body);
}

.error-page-url {
    margin-top: 0.25rem;
}

    .error-page-url code {
        font-size: 0.85rem;
        color: var(--text-muted);
        word-break: break-all;
    }

.error-page-search {
    margin: 1.75rem auto 0;
    max-width: 24rem;
}

.error-page-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* ── Auth CTA banner (guest trying to use cart) ── */
.auth-banner {
    background: var(--surface-alt);
    border: 1px dashed var(--surface-border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── Pagination ── */
.pagination .page-link {
    border: none;
    color: var(--text-body);
    border-radius: var(--radius-sm) !important;
    margin: 0 0.15rem;
}

.pagination .page-item.active .page-link {
    background-color: var(--accent-color);
    color: #fff;
}

/* ── Generic content pages (Instalações / Auditorias / About) ── */
.page-hero {
    background: linear-gradient(120deg, var(--brand-navy) 0%, var(--brand-navy-light) 100%);
    padding: 3.5rem 0;
    text-align: center;
    position: relative;
    background-size: cover;
    background-position: center;
}

/* Only the two backgrounds that are actually dark (page-hero's own default navy
   gradient, and any background photo under its darkening overlay) get light text
   baked in here — .bg-accent and .block-text-light already supply it themselves
   for the Accent preset / "Texto claro" custom-background opt-in. Anything else
   (Alt, or a Custom color/gradient left at the default dark text) keeps the page's
   normal body text color, which is what actually stays legible there. */
.page-hero.bg-default,
.page-hero.has-image {
    color: var(--text-on-dark);
}

.page-hero.has-image::before {
    content: "";
    position: absolute;
    inset: 0;
    /* The overlay gradient is chosen server-side by BannerImageEffect and the block's
       own gradient colours, and passed in as --hero-overlay (see
       CategoryHeaderBlockSettings.HeroOverlayGradient). The fallback keeps the legacy
       look for any .has-image hero that doesn't set the variable. */
    background: var(--hero-overlay, linear-gradient(135deg, rgba(4, 35, 80, 0.88) 0%, rgba(4, 35, 80, 0.6) 60%, rgba(4, 35, 80, 0.4) 100%));
}

/* BannerImageEffect = None: photo with no overlay at all. */
.page-hero.has-image.hero-overlay-none::before {
    display: none;
}

.page-hero .container {
    position: relative;
    z-index: 1;
}

.page-hero h1 {
    font-weight: 800;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    margin-bottom: 0.6rem;
}

.page-hero p {
    display: inline-block;
    max-width: 100%;
    opacity: 0.82;
}

/* Category descriptions are real sentences (a few dozen words), not a short
   tagline - the base 620px width wraps them into a dense 5-6 line block.
   Wider column + a touch more line-height reads as a paragraph instead.
   (Needs .page-hero prefixed in to out-specificity the ".page-hero p" rule
   above, since a bare class selector alone would lose that tie-break.) */
.page-hero .page-hero-description {
    max-width: 760px;
    line-height: 1.6;
    font-size: 1.05rem;
}

/* The 760px cap above leaves the description box narrower than the hero, so it
   must follow the block's alignment - without this it always hugs the left even
   when the container is text-center / text-end. */
.page-hero .container.text-center .page-hero-description {
    margin-inline: auto;
}

.page-hero .container.text-end .page-hero-description {
    margin-inline: auto 0;
}

.page-hero-actions {
    margin-top: 1.5rem;
}

/* ── Brand header block ── */
.brand-header-logo-sm {
    max-height: 56px;
    object-fit: contain;
}

.brand-header-logo-md {
    max-height: 96px;
    object-fit: contain;
}

.brand-header-logo-lg {
    max-height: 160px;
    object-fit: contain;
}

.brand-header-extras {
    margin-top: 1rem;
}

.brand-header-count {
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 1rem;
}

.brand-header-website {
    /* Without this, the global `a { color: var(--accent-color) }` rule wins over
       the section's text color regardless of light/dark mode, since an explicit
       rule on the element itself beats inheriting from an ancestor - this is what
       made the link render blue while the rest of the hero text was white. */
    color: inherit;
    font-size: 0.9rem;
    text-decoration: underline;
}

/* ── Category header block ── */
.category-header-image-sm {
    max-height: 56px;
    object-fit: contain;
}

.category-header-image-md {
    max-height: 96px;
    object-fit: contain;
}

.category-header-image-lg {
    max-height: 160px;
    object-fit: contain;
}

.category-header-extras {
    margin-top: 1rem;
}

.category-header-count {
    font-weight: 600;
    font-size: 0.9rem;
}

.content-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-sm);
    padding: 1.75rem;
    height: 100%;
}

.cta-banner {
    background: var(--brand-navy);
    color: var(--text-on-dark);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
}

.cta-banner h3 {
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.cta-banner p {
    color: var(--text-on-dark-muted);
    max-width: 520px;
    margin: 0 auto 1.5rem;
}

/* ── Draft quote details: product search-and-add (inside the Add Product modal) ── */
.product-search-results-static {
    max-height: 340px;
    overflow-y: auto;
}

.product-search-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--surface-border);
}

.product-search-row:last-child {
    border-bottom: none;
}

.product-search-empty {
    text-align: center;
}

/* ── Product search dropdown (QuoteManager add-item, reuses admin-quotes.js) ── */
.product-search-results {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    max-height: 340px;
    overflow-y: auto;
    z-index: 1000;
    width: 100%;
    display: none;
    margin-top: 4px;
}

.product-search-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--surface-border);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.product-search-item:hover {
    background: var(--surface-alt, #f8f9fa);
}

.product-search-item:last-child {
    border-bottom: none;
}

.product-search-price {
    font-weight: 700;
    color: var(--accent-color);
    flex-shrink: 0;
}

/* ── Forms (contact / checkout) ── */
.form-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-sm);
    padding: 2.25rem;
}

.form-floating > .form-control,
.form-floating > .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--surface-border);
}

.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--accent-color) 15%, transparent);
}

/* ── Footer ── */
.site-footer {
    background: var(--brand-navy-dark);
    color: var(--text-on-dark-muted);
    padding: 3.5rem 0 1.5rem;
    margin-top: auto;
}

.site-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .site-footer-grid {
        grid-template-columns: 1fr;
    }
}

.site-footer-logo {
    width: 120px;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.site-footer-text {
    font-size: 0.88rem;
    max-width: 320px;
    margin-bottom: 1rem;
}

.site-footer-social a {
    color: var(--text-on-dark-muted);
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.site-footer-social a:hover {
    color: #fff;
}

.site-footer-heading {
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
}

.site-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer-links li {
    margin-bottom: 0.6rem;
}

.site-footer-links a {
    color: var(--text-on-dark-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.site-footer-links a:hover {
    color: #fff;
}

.site-footer-contacts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer-contacts li {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-bottom: 0.75rem;
    font-size: 0.88rem;
}

.site-footer-contacts svg.bi {
    fill: #fff;
}

.site-footer-contacts a {
    color: var(--text-on-dark-muted);
    text-decoration: none;
}

.site-footer-contacts a:hover {
    color: #fff;
}

.site-footer-bottom {
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
}

/* ── Toast notifications (shop-cart.js) ── */
.shop-toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.shop-toast {
    min-width: 260px;
    max-width: 340px;
    color: #fff;
    padding: 0.8rem 1.1rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-size: 0.9rem;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.shop-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.shop-toast.bg-success { background-color: #198754; }
.shop-toast.bg-danger { background-color: #dc3545; }
.shop-toast.bg-warning { background-color: #b8860b; }
.shop-toast.bg-info { background-color: var(--accent-color); }

/* ── Full-page loading overlay (quote item quantity/remove) ── */
.shop-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.shop-loading-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.shop-loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--accent-color);
}

/* ── Branded "igniting flame" loading overlay (SofigasLoader, see sofigas-loader.js) ── */
.sofigas-loader {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.82);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.sofigas-loader.is-active { opacity: 1; pointer-events: all; }

.sofigas-loader-inner { display: flex; flex-direction: column; align-items: center; gap: 0.85rem; }
.sofigas-loader-flame {
    position: relative;
    width: 88px;
    height: 88px;
    transform-origin: 50% 88%;
    animation: sofigas-loader-flicker 1.6s ease-in-out infinite;
}
.sofigas-loader-flame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sofigas-loader-ghost { opacity: 0.14; }
.sofigas-loader-lit { animation: sofigas-loader-fill 1.6s ease-in-out infinite; }
.sofigas-loader-cap {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--brand-navy);
    animation: sofigas-loader-pulse 1.6s ease-in-out infinite;
}

@keyframes sofigas-loader-fill {
    0%   { clip-path: inset(100% 0 0 0); opacity: 0; }
    16%  { opacity: 1; }
    62%  { clip-path: inset(0 0 0 0); }
    82%  { clip-path: inset(0 0 0 0); opacity: 1; }
    100% { clip-path: inset(0 0 0 0); opacity: 0; }
}
@keyframes sofigas-loader-flicker {
    0%, 100% { transform: scale(1, 1); }
    50%      { transform: scale(1.03, 0.98); }
}
@keyframes sofigas-loader-pulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .sofigas-loader-flame { animation: none; }
    .sofigas-loader-lit { animation: none; clip-path: none; opacity: 1; }
    .sofigas-loader-ghost { opacity: 0; }
    .sofigas-loader-cap { animation: none; opacity: 0.85; }
}

/* ── Collapsible product list toggle (My Quotes drafts) ── */
.quote-products-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
}

.quote-products-toggle .chevron {
    transition: transform 0.15s ease;
}

.quote-products-toggle[aria-expanded="true"] .chevron {
    transform: rotate(90deg);
}

/* ============================================================
   QUOTES (frontend) — Os Meus Orçamentos + detalhes
   Direction A: quiet statement list. Mirrors the .im-* vocabulary
   from the InventoryManager frontend so the two features read as
   one system. New .quote-* classes only; .cart-table is left
   untouched (still used by _ProductDetailsBlock).
   ============================================================ */

/* Page / section headings — calmer than .section-title (clamps to 2.2rem) */
.quote-h { font-size: 1.3rem; font-weight: 700; color: var(--brand-navy); margin: 0; }
.quote-h-row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.quote-h-later { margin-top: 2.75rem; padding-top: 1.5rem; border-top: 1px solid var(--surface-border); }

.quote-page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.quote-page-head h1 { font-size: 1.5rem; font-weight: 800; color: var(--brand-navy); margin: 0 0 0.15rem; }
.quote-page-head .quote-page-sub { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* --- List: one card per quote --- */
.quote-list { display: flex; flex-direction: column; gap: 0.85rem; }

.quote-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
}
.quote-card--action {
    border-color: #f0b429;
    box-shadow: inset 3px 0 0 #f0b429;
}
.quote-action-pill {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    background: #fdf2d0;
    color: #8a5a00;
}
.quote-action-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #f0d089;
    border-left: 4px solid #f0b429;
    border-radius: var(--radius-md);
    background: #fffaf0;
    color: #8a5a00;
    font-size: 0.9rem;
}
.quote-action-banner svg { flex-shrink: 0; }
.quote-card-body { padding: 1rem 1.15rem; }
.quote-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.quote-card-head-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; flex-shrink: 0; }
.quote-card-title { font-weight: 700; color: var(--brand-navy); font-size: 1.02rem; line-height: 1.3; }
.quote-card-meta { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.15rem; }

.quote-card-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 0.9rem; gap: 1rem; }
.quote-card-total .label { font-size: 0.82rem; color: var(--text-muted); }
.quote-card-total .value { font-size: 1.15rem; font-weight: 700; color: var(--brand-navy); }

.quote-card-actions { display: flex; border-top: 1px solid var(--surface-border); }
.quote-card-actions > * {
    flex: 1 1 0;
    min-height: 46px;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    font-size: 0.9rem; font-weight: 600;
    background: none; border: 0;
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}
.quote-card-actions > * + * { border-left: 1px solid var(--surface-border); }
.quote-card-actions > *:first-child { border-bottom-left-radius: var(--radius-md); }
.quote-card-actions > *:last-child { border-bottom-right-radius: var(--radius-md); }
.quote-card-actions > *:hover { background: var(--surface-alt); }
.quote-card-actions .is-primary { background: var(--accent-color); color: var(--text-on-dark); }
.quote-card-actions .is-primary:hover { background: var(--accent-color-dark); color: #fff; }

/* --- Overflow (⋯) menu --- */
.quote-menu { position: relative; flex: 0 0 auto; }
.quote-menu-btn {
    border: 0; background: none; cursor: pointer;
    color: var(--text-muted); font-size: 1.35rem; line-height: 1;
    padding: 0.1rem 0.45rem; border-radius: var(--radius-sm);
}
.quote-menu-btn:hover { background: var(--surface-alt); color: var(--brand-navy); }
.quote-menu-list {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 0.35rem;
    display: none;
}
.quote-menu.open .quote-menu-list { display: block; }
.quote-menu-list button,
.quote-menu-list a {
    display: flex; align-items: center; gap: 0.55rem; width: 100%;
    padding: 0.6rem 0.6rem;
    background: none; border: 0; text-align: left;
    font-size: 0.88rem; color: var(--text-body); text-decoration: none;
    border-radius: 6px; cursor: pointer;
}
.quote-menu-list button:hover,
.quote-menu-list a:hover { background: var(--surface-alt); }
.quote-menu-list .is-danger { color: #b91c1c; }

/* --- Line items (replaces .cart-table in quote views) --- */
.quote-items { display: flex; flex-direction: column; margin: 0.25rem 0; }
.quote-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "main qty price";
    align-items: center;
    gap: 0.35rem 1rem;
    padding: 0.8rem 0;
    border-top: 1px solid var(--surface-border);
}
.quote-item:first-child { border-top: 0; }
.quote-item-main { grid-area: main; min-width: 0; }
.quote-item-qty { grid-area: qty; display: flex; align-items: center; gap: 0.4rem; }
.quote-item-price { grid-area: price; font-weight: 600; color: var(--brand-navy); white-space: nowrap; text-align: right; min-width: 5.5rem; }
.quote-item-remove { grid-area: rm; border: 0; background: none; color: #b91c1c; cursor: pointer; padding: 0.25rem; justify-self: end; }
.quote-item--editable { grid-template-columns: 1fr auto auto auto; grid-template-areas: "main qty price rm"; }
.quote-item-name { font-weight: 600; color: var(--brand-navy); text-decoration: none; }
a.quote-item-name:hover { color: var(--accent-color); text-decoration: underline; }
.quote-item-sku { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.1rem; }

@media (max-width: 560px) {
    .quote-item,
    .quote-item--editable {
        grid-template-columns: 1fr auto;
        grid-template-areas: "main price" "qty rm";
    }
    .quote-item-qty { margin-top: 0.35rem; }
    .quote-item-remove { align-self: center; }
}

.quote-items-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--surface-border); }
.quote-items-foot strong { color: var(--brand-navy); }

/* --- Detail page layout: items + sticky summary --- */
.quote-detail { display: flex; flex-direction: column; gap: 1.5rem; }
.quote-detail-main { min-width: 0; }
@media (min-width: 900px) {
    .quote-detail { flex-direction: row; align-items: flex-start; }
    .quote-detail-main { flex: 1 1 auto; }
    .quote-detail-aside { flex: 0 0 320px; position: sticky; top: 1rem; }
}

.quote-detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; margin-bottom: 1rem; }
.quote-detail-head .spacer { flex: 1 1 auto; }
.quote-detail-back { font-size: 0.85rem; color: var(--accent-color); text-decoration: none; white-space: nowrap; }
.quote-detail-back:hover { text-decoration: underline; }
.quote-detail-status { margin-bottom: 1.25rem; }

/* Customer decision actions (accept / reject) — kept in their own card so they
   don't blur into the back link + PDF utility row on a phone. */
.quote-actions-card {
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-md);
    background: var(--surface-alt);
    padding: 1rem 1.15rem;
    margin-bottom: 1.5rem;
}
.quote-actions-card-title { font-size: 0.95rem; font-weight: 700; color: var(--brand-navy); margin: 0 0 0.75rem; }
.quote-actions-card-buttons { display: flex; flex-direction: column; gap: 0.6rem; }
.quote-actions-card-buttons .btn { width: 100%; }
@media (min-width: 700px) {
    .quote-actions-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
    .quote-actions-card-title { margin: 0; }
    .quote-actions-card-buttons { flex-direction: row; flex-wrap: wrap; }
    .quote-actions-card-buttons .btn { width: auto; }
}

/* --- Sections (details + draft editor) --- */
.quote-section { padding: 1.5rem 0; border-top: 1px solid var(--surface-border); }
.quote-section:first-child { border-top: 0; padding-top: 0; }
.quote-section-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.quote-section-title { font-size: 1.05rem; font-weight: 700; color: var(--brand-navy); margin: 0; }

/* --- Messages / notes --- */
.quote-notes { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.quote-note { border: 1px solid var(--surface-border); border-radius: var(--radius-sm); padding: 0.75rem 0.9rem; }
.quote-note--mine { background: var(--surface-alt); }
.quote-note-meta { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.25rem; }

/* --- Aside sub-cards (payment / receipts) --- */
.quote-aside-card {
    margin-top: 1rem;
    padding: 1.1rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
}
.quote-aside-card .quote-section-head { margin-bottom: 0.75rem; }
.quote-aside-card .quote-section-title { font-size: 0.98rem; }

/* --- Manager list: filter bar + whole-card link rows --- */
.quote-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.25rem; }
.quote-filters > .form-control,
.quote-filters > .form-select { flex: 1 1 180px; min-width: 0; min-height: 42px; }
.quote-filters .qf-search { flex-basis: 240px; }
.quote-filters .qf-date { flex-basis: 150px; }
.quote-filters-actions { display: flex; gap: 0.6rem; flex: 1 1 auto; }
.quote-filters-actions .btn { flex: 1 1 auto; min-height: 42px; }
@media (min-width: 768px) {
    .quote-filters-actions { flex: 0 0 auto; }
    .quote-filters-actions .btn { flex: 0 0 auto; }
}

a.quote-card--link { display: block; text-decoration: none; color: inherit; transition: border-color .15s ease, box-shadow .15s ease; }
a.quote-card--link:hover { border-color: var(--accent-color); box-shadow: var(--shadow-sm); color: inherit; }

.quote-flag-danger {
    display: inline-block; margin-left: 0.5rem; vertical-align: middle;
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
    color: #b91c1c; background: #fdecec; border-radius: 6px; padding: 0.15rem 0.45rem;
}

.quote-pagination { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.quote-pagination a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; min-height: 40px; padding: 0 0.5rem;
    border: 1px solid var(--surface-border); border-radius: var(--radius-sm);
    text-decoration: none; color: var(--accent-color); font-size: 0.9rem;
}
.quote-pagination a:hover { background: var(--surface-alt); }
.quote-pagination .is-active a { background: var(--accent-color); color: var(--text-on-dark); border-color: var(--accent-color); }
.quote-pagination .is-gap span {
    display: inline-flex; align-items: flex-end; justify-content: center;
    min-width: 24px; min-height: 40px; padding: 0 0.15rem;
    color: var(--text-muted);
}

/* ============================================================
   QUOTE MANAGER — quote detail workbench (_QuoteManagerDetailsBlock)
   Direction A. The editable items <table> is KEPT as a table -
   admin-quotes.js and Areas/Admin/.../Quotes/Edit.cshtml share its
   DOM (#itemsTableBody, tr[data-item-id], .item-*). It's restyled
   here and made to stack on phones via data-label cells. Everything
   else becomes .qm-panel / token-based.
   ============================================================ */

.qm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-bottom: 1.5rem; }
.qm-head .spacer { flex: 1 1 auto; }

.qm-grid { display: flex; flex-direction: column; gap: 1.25rem; }
.qm-grid-main, .qm-grid-aside { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
@media (min-width: 992px) {
    .qm-grid { flex-direction: row; align-items: flex-start; }
    .qm-grid-main { flex: 1 1 auto; }
    .qm-grid-aside { flex: 0 0 340px; position: sticky; top: 1rem; }
}

.qm-panel {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.35rem;
}
.qm-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.qm-panel-title { font-size: 1rem; font-weight: 700; color: var(--brand-navy); margin: 0; }
.qm-panel-sub { font-size: 0.76rem; color: var(--text-muted); font-weight: 700; margin: 1.25rem 0 0.75rem; text-transform: uppercase; letter-spacing: 0.4px; }
.qm-panel-sub:first-child { margin-top: 0; }

.qm-defs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.9rem 1.25rem; }
.qm-def-label { font-size: 0.74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.qm-def-value { color: var(--brand-navy); font-weight: 600; margin-top: 0.1rem; }
.qm-def-value--plain { font-weight: 500; color: var(--text-body); }

.qm-callout { border: 1px solid var(--surface-border); border-left: 3px solid var(--accent-color); border-radius: var(--radius-sm); background: var(--surface-alt); padding: 0.9rem 1rem; margin-bottom: 1rem; }
.qm-callout--warn { border-left-color: #d97706; }

.qm-items { width: 100%; border-collapse: collapse; }
.qm-items thead th {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--text-muted); font-weight: 700;
    text-align: left; padding: 0 0.55rem 0.6rem; border-bottom: 1px solid var(--surface-border);
}
.qm-items thead th.num { text-align: right; }
.qm-items tbody td { padding: 0.7rem 0.55rem; border-bottom: 1px solid var(--surface-border); vertical-align: middle; }
.qm-items tbody tr:last-child td { border-bottom: 0; }
.qm-items .qm-item-name { font-weight: 600; color: var(--brand-navy); }
.qm-items .qm-item-sku { font-size: 0.76rem; color: var(--text-muted); }
.qm-items .num { text-align: right; white-space: nowrap; }
.qm-items .item-total { font-weight: 700; color: var(--brand-navy); }
.qm-items input.form-control { display: inline-block; width: 100%; max-width: 6rem; }
.qm-items .num input.form-control { margin-left: auto; }
.item-edit-row td { background: color-mix(in srgb, var(--accent-color) 8%, transparent); transition: background .5s ease; }

@media (max-width: 820px) {
    .qm-items, .qm-items tbody, .qm-items tr, .qm-items td { display: block; width: 100%; }
    .qm-items thead { display: none; }
    .qm-items tbody tr { padding: 0.9rem 0; border-bottom: 1px solid var(--surface-border); }
    .qm-items tbody tr:last-child { border-bottom: 0; }
    .qm-items tbody td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.4rem 0; border: 0; }
    .qm-items tbody td::before { content: attr(data-label); font-size: 0.74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
    .qm-items tbody td.qm-cell-name { display: block; }
    .qm-items tbody td.qm-cell-name::before { display: none; }
    .qm-items input.form-control { max-width: 8rem; }
    .qm-items #noItemsRow td { display: block; text-align: center; }
    .qm-items #noItemsRow td::before { display: none; }
}

.qm-totals { background: var(--surface-alt); border: 1px solid var(--surface-border); border-radius: var(--radius-md); padding: 1.1rem 1.25rem; }
.qm-totals-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; font-size: 0.92rem; color: var(--text-body); }
.qm-totals-row .neg { color: #b91c1c; }
.qm-totals-net { font-weight: 700; color: var(--brand-navy); }
.qm-totals-grand { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 0.6rem; padding-top: 0.7rem; border-top: 1px solid var(--surface-border); }
.qm-totals-grand-value { font-size: 1.35rem; font-weight: 800; color: var(--accent-color); }

.qm-filelist { display: flex; flex-direction: column; gap: 0.6rem; }

.qm-entry { border: 1px solid var(--surface-border); border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; }
.qm-entry + .qm-entry { margin-top: 0.6rem; }
.qm-entry-meta { font-size: 0.76rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.qm-entry-tag { display: inline-block; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; padding: 0.1rem 0.4rem; border-radius: 5px; margin-left: 0.4rem; }
.qm-entry-tag--internal { background: var(--surface-alt); color: var(--text-muted); }
.qm-entry-tag--customer { background: #e7f5ec; color: #1a7f45; }

.qm-input-readonly { background: var(--surface-alt); }

/* Frontend toast for admin-quotes.js showNotification() - .notification
   lives only in AdminComponents.css, never loaded on the storefront. */
.notification {
    position: fixed; right: 1rem; bottom: 1rem; z-index: 1090;
    max-width: 320px; padding: 0.8rem 1rem; border-radius: var(--radius-sm);
    color: #fff; font-size: 0.9rem; box-shadow: var(--shadow-md);
    opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease;
}
.notification.show { opacity: 1; transform: translateY(0); }
.notification.bg-success { background: #1a7f45; }
.notification.bg-danger { background: #b91c1c; }
.notification.bg-warning { background: #b45309; }
.notification.bg-info { background: var(--brand-navy); }

/* ── Print ── */
@media print {
    .no-print,
    .site-nav,
    .site-header,
    .site-footer,
    .shop-toast-container,
    .shop-loading-overlay,
    .modal {
        display: none !important;
    }

    .collapse {
        display: block !important;
        height: auto !important;
        visibility: visible !important;
    }
}

/* ── Video embed block ── */
.video-embed-wrap {
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* ── Gallery block ── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border: none;
    padding: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface-alt);
    box-shadow: var(--shadow-sm);
    cursor: zoom-in;
    transition: box-shadow 0.2s ease;
}

.gallery-item:hover,
.gallery-item:focus-visible {
    box-shadow: var(--shadow-md);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-video {
    background: linear-gradient(135deg, #042350 0%, #0a3a7a 100%);
}

.gallery-item-video img,
.gallery-item-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(4, 35, 80, 0.35);
    transition: background 0.2s ease;
}

.gallery-item-video:hover .gallery-play-icon {
    background: rgba(4, 35, 80, 0.5);
}

.gallery-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.6rem 0.85rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: #fff;
    font-size: 0.85rem;
    text-align: left;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 15, 30, 0.92);
    padding: 3rem 1rem;
}

.gallery-lightbox[hidden] {
    display: none;
}

.gallery-lightbox-figure {
    max-width: min(90vw, 1100px);
    max-height: 85vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-lightbox-img,
.gallery-lightbox-video {
    display: none;
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.gallery-lightbox-iframe {
    display: none;
    width: min(90vw, 1000px);
    height: min(75vh, 562px);
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: var(--radius-md);
}

.gallery-lightbox-caption {
    color: #fff;
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.95rem;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.gallery-lightbox-close {
    top: 1rem;
    right: 1rem;
}

.gallery-lightbox-prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-lightbox-next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.6rem;
    }

    .gallery-lightbox-nav {
        width: 36px;
        height: 36px;
    }
}

/* ── Image block (page builder) ── */
.image-block {
    margin: 0 auto;
    text-align: center;
}

.image-block-full { max-width: 100%; }
.image-block-large { max-width: 900px; }
.image-block-medium { max-width: 600px; }
.image-block-small { max-width: 360px; }

.image-block img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

.image-block figcaption {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

.image-block-zoom {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
}

.image-block-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 15, 30, 0.92);
    padding: 3rem 1rem;
}

.image-block-lightbox[hidden] {
    display: none;
}

.image-block-lightbox-img {
    max-width: min(90vw, 1100px);
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.image-block-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.image-block-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ── QuoteManagerDashboard block ── */
.qdash-wrap { display: flex; flex-direction: column; gap: 1.5rem; }

.qdash-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.qdash-title { font-size: 1.5rem; font-weight: 800; color: var(--brand-navy); margin: 0; }
.qdash-subtitle { color: var(--text-muted); font-size: 0.9rem; margin: 0.15rem 0 0; }

.qdash-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 2rem 2.25rem;
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-light) 60%, var(--accent-color) 150%);
    color: var(--text-on-dark);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    justify-content: space-between;
}
.qdash-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}
.qdash-hero-main { position: relative; z-index: 1; min-width: 220px; }
.qdash-hero-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-on-dark-muted); margin: 0 0 0.35rem; }
.qdash-hero-figure { font-size: clamp(2.1rem, 5vw, 3rem); font-weight: 800; line-height: 1; letter-spacing: -0.01em; margin: 0; font-variant-numeric: tabular-nums; }
.qdash-hero-sub { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--text-on-dark-muted); }
.qdash-sparkline-svg { width: 220px; height: 60px; display: block; }
.qdash-hero-side { position: relative; z-index: 1; display: flex; gap: 1.75rem; flex-wrap: wrap; }
.qdash-hero-metric-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-on-dark-muted); margin: 0 0 0.2rem; }
.qdash-hero-metric-value { font-size: 1.4rem; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; }

.qdash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--surface-border); border: 1px solid var(--surface-border); border-radius: var(--radius-md); overflow: hidden; }
.qdash-stat { background: var(--surface); padding: 1rem 1.1rem; }
.qdash-stat-value { font-size: 1.3rem; font-weight: 700; color: var(--brand-navy); font-variant-numeric: tabular-nums; }
.qdash-stat-label { font-size: 0.76rem; color: var(--text-muted); margin-top: 0.15rem; }
.qdash-stat.is-warn .qdash-stat-value { color: #b45309; }
.qdash-stat--link { display: block; text-decoration: none; transition: background 0.12s ease; }
.qdash-stat--link:hover { background: var(--surface-alt, #f6f7f9); }
.qdash-stat--link .qdash-stat-label { text-decoration: underline; text-decoration-color: transparent; }
.qdash-stat--link:hover .qdash-stat-label { text-decoration-color: currentColor; }
.qdash-stat--link.is-action .qdash-stat-value { color: #b45309; }
.qdash-stat--link.is-active { box-shadow: inset 0 -3px 0 #f0b429; }
.qf-action-only { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; cursor: pointer; }
.qf-action-only input { width: 1rem; height: 1rem; }

.qdash-layout { display: flex; gap: 2rem; align-items: flex-start; }
.qdash-sidebar { width: 240px; flex-shrink: 0; }
.qdash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1.5rem; }

.qdash-panel { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-md); padding: 1.25rem 1.4rem; box-shadow: var(--shadow-sm); }
.qdash-panel-title { font-size: 0.95rem; font-weight: 700; color: var(--brand-navy); margin: 0 0 1rem; display: flex; align-items: center; justify-content: space-between; }
.qdash-panel-title small { font-weight: 500; color: var(--text-muted); font-size: 0.78rem; }

.qdash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

.qdash-status-capsule { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-alt); margin-bottom: 1rem; }
.qdash-status-seg { height: 100%; min-width: 3px; }
.qdash-status-legend { display: flex; flex-direction: column; gap: 0.45rem; }
.qdash-status-legend-row { display: flex; align-items: center; gap: 0.55rem; font-size: 0.85rem; }
.qdash-status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.qdash-status-name { flex: 1; color: var(--text-body); }
.qdash-status-count { color: var(--text-muted); font-size: 0.78rem; }
.qdash-status-value { font-weight: 600; color: var(--brand-navy); font-variant-numeric: tabular-nums; min-width: 80px; text-align: right; }

.qdash-bar-row { display: grid; grid-template-columns: minmax(0,1fr) 90px; align-items: center; gap: 0.6rem; padding: 0.4rem 0; }
.qdash-bar-row + .qdash-bar-row { border-top: 1px solid var(--surface-border); }
.qdash-bar-name { display: block; font-size: 0.85rem; color: var(--text-body); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qdash-bar-meta { font-size: 0.74rem; color: var(--text-muted); }
.qdash-bar-track { height: 6px; border-radius: 4px; background: var(--surface-alt); margin-top: 0.3rem; overflow: hidden; }
.qdash-bar-fill { height: 100%; border-radius: 4px; background: var(--accent-color); }
.qdash-bar-value { text-align: right; font-size: 0.85rem; font-weight: 700; color: var(--brand-navy); font-variant-numeric: tabular-nums; }
.qdash-bar-empty { color: var(--text-muted); font-size: 0.85rem; padding: 0.5rem 0; }

.qdash-list-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.55rem 0; text-decoration: none; color: inherit; }
.qdash-list-row + .qdash-list-row { border-top: 1px solid var(--surface-border); }
.qdash-list-row:hover .qdash-list-number { color: var(--accent-color); }
.qdash-list-number { font-weight: 600; font-size: 0.85rem; }
.qdash-list-customer { font-size: 0.78rem; color: var(--text-muted); }
.qdash-list-right { text-align: right; font-size: 0.78rem; color: var(--text-muted); }
.qdash-list-value { font-weight: 700; color: var(--brand-navy); font-size: 0.85rem; }

.qdash-chart-box { height: 220px; position: relative; }

.qdash-chip-group { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.qdash-chip { font-size: 0.76rem; padding: 0.28rem 0.65rem; border-radius: 999px; border: 1px solid var(--surface-border); color: var(--text-body); text-decoration: none; background: var(--surface); }
.qdash-chip.is-active { background: var(--accent-color); border-color: var(--accent-color); color: #fff; }
.qdash-chip:hover { border-color: var(--accent-color); color: var(--accent-color); }
.qdash-chip.is-active:hover { color: #fff; }
.qdash-value-range { display: flex; gap: 0.4rem; }
.qdash-value-range input { min-width: 0; }
.qdash-clear { display: inline-block; margin-top: 0.75rem; font-size: 0.8rem; color: var(--text-muted); text-decoration: underline; }
.qdash-clear:hover { color: var(--accent-color); }

@media (max-width: 900px) {
    .qdash-grid-2 { grid-template-columns: 1fr; }
    .qdash-layout { flex-direction: column; }
    .qdash-sidebar { width: 100%; }
}

/* ============================================================
   INVENTORY MANAGER (frontend) — mobile-first stock management
   ============================================================ */

/* Stat strip: 2-up on phones, auto-fit on wider screens */
.im-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
.im-stat {
    background: var(--surface-alt);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}
.im-stat-value { display: block; font-size: 1.25rem; font-weight: 700; line-height: 1.2; color: var(--text-body); }
.im-stat-label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem; }

/* Filters: stack on phones, row on >= 576px */
.im-filters { display: flex; flex-direction: column; gap: 0.6rem; }
.im-filter-search { flex: 1 1 auto; }
.im-filters .btn { min-height: 44px; }
.im-filters .form-control,
.im-filters .form-select { min-height: 44px; }
.im-filter-check { display: flex; align-items: center; gap: 0.5rem; padding-left: 1.75rem; }

/* List rows as tap-friendly cards */
.im-list { display: flex; flex-direction: column; gap: 0.5rem; }
.im-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-body);
    transition: border-color .15s, box-shadow .15s;
}
.im-row:hover { border-color: var(--accent-color); box-shadow: var(--shadow-sm); color: var(--text-body); }
.im-thumb {
    flex: 0 0 auto;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-alt);
    border-radius: 6px;
    color: var(--text-muted);
    overflow: hidden;
}
.im-thumb img { width: 100%; height: 100%; object-fit: contain; }
.im-thumb-lg { width: 76px; height: 76px; border: 1px solid var(--surface-border); }
.im-row-main { flex: 1 1 auto; min-width: 0; }
.im-row-name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-row-meta { display: block; font-size: 0.8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-row-meta code { color: var(--text-muted); }
.im-row-qty { flex: 0 0 auto; text-align: center; }
.im-row-qty .badge { font-size: 0.9rem; }
.im-row-qty-sub { display: block; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; }

/* Detail header */
.im-detail-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }

/* Movement history as stacked cards */
.im-moves { display: flex; flex-direction: column; gap: 0.6rem; }
.im-move { border: 1px solid var(--surface-border); border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; }
.im-move-top { display: flex; justify-content: space-between; align-items: baseline; }
.im-move-type { font-weight: 600; }
.im-move-delta { font-weight: 700; }
.im-move-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem; }
.im-move-note { font-size: 0.85rem; margin-top: 0.35rem; }

@media (min-width: 576px) {
    .im-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .im-filters { flex-direction: row; flex-wrap: wrap; align-items: center; }
    .im-filter-search { flex: 1 1 260px; }
    .im-filter-loc { flex: 0 0 220px; }
}

/* ============================================================
   MOBILE NAVIGATION — app-style bottom tab bar + slide-up sheets
   Desktop keeps the .site-nav strip; below 992px that strip is
   hidden and this takes over. See Helpers/FrontEndNavigation.cshtml.
   ============================================================ */

.mobile-bottom-nav { display: none; }
.mbn-sheet, .mbn-sheet-backdrop { display: none; }

.site-header-phone .bi { flex: 0 0 auto; }

@media (max-width: 991.98px) {
    /* Kill the desktop nav strip + its hamburger */
    .site-nav { display: none; }

    /* Tighter navy header: just the logo. The phone is reachable from the bottom-nav
       Menu sheet ("Ligar ...") and the footer. */
    .site-header-inner { gap: 0.75rem; padding: 0.6rem 0; }
    .site-brand-logo { width: 44px; }
    .site-brand-name { font-size: 1.05rem; }
    .site-brand-tagline { display: none; }
    .site-header-phone { display: none; }

    /* Leave room for the fixed bar so it never covers footer/content */
    .site-main { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 1040;
        background: var(--surface);
        border-top: 1px solid var(--surface-border);
        box-shadow: 0 -2px 12px rgba(4, 35, 80, 0.07);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .mbn-item {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 8px 2px 7px;
        background: none;
        border: none;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.68rem;
        font-weight: 600;
        line-height: 1;
        position: relative;
        cursor: pointer;
        min-height: 56px;
    }
    .mbn-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mbn-item:hover, .mbn-item:focus-visible { color: var(--accent-color); }
    .mbn-item.is-active { color: var(--accent-color); }

    .mbn-badge {
        position: absolute;
        top: 4px;
        left: calc(50% + 6px);
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 999px;
        background: #d63333;
        color: #fff;
        font-size: 0.62rem;
        line-height: 16px;
        text-align: center;
    }

    /* Slide-up sheets. Only opacity/transform are transitioned - transitioning
       `visibility` alongside transform can leave the transform stuck at its start
       value in Blink, so the closed state relies on being off-screen + pointer-events
       + aria-hidden (toggled in JS) instead. */
    .mbn-sheet-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1045;
        background: rgba(4, 20, 45, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
    }
    .mbn-sheet-backdrop.mbn-backdrop-open { opacity: 1; pointer-events: auto; }

    .mbn-sheet {
        display: flex;
        flex-direction: column;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 1050;
        max-height: 85vh;
        background: var(--surface);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 32px rgba(4, 35, 80, 0.18);
        transform: translateY(102%);
        pointer-events: none;
        transition: transform 0.26s ease;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .mbn-sheet.mbn-sheet-open { transform: translateY(0); pointer-events: auto; }

    .mbn-sheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.9rem 1rem 0.75rem;
        border-bottom: 1px solid var(--surface-border);
    }
    .mbn-sheet-head::before {
        content: "";
        position: absolute;
        top: 7px; left: 50%;
        width: 36px; height: 4px;
        margin-left: -18px;
        border-radius: 999px;
        background: var(--surface-border);
    }
    .mbn-sheet-head { position: relative; }
    .mbn-sheet-title { font-weight: 700; font-size: 1rem; color: var(--text-body); }
    .mbn-sheet-close {
        display: flex; align-items: center; justify-content: center;
        width: 32px; height: 32px;
        border: none; border-radius: 50%;
        background: var(--surface-alt);
        color: var(--text-muted);
        cursor: pointer;
    }

    .mbn-sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0.85rem 1rem 1.25rem; }

    /* ── Search sheet: tall, fixed height. Search field sits at the TOP (in the
         header row) so a focused input is never pushed off-screen by the mobile
         keyboard; results flow top-to-bottom below it and scroll. ── */
    .mbn-sheet--search {
        height: 80vh;
        max-height: 80vh;
    }
    .mbn-search-head { gap: 0.6rem; padding: 0.9rem 0.9rem 0.7rem; }
    .mbn-search-bar {
        flex: 1 1 auto;
        min-width: 0;
        position: relative;
        display: flex;
        align-items: center;
    }
    .mbn-search-bar-icon {
        position: absolute;
        left: 0.85rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-muted);
        pointer-events: none;
    }
    .mbn-search-bar-input {
        width: 100%;
        min-width: 0;
        height: 42px;
        padding: 0 0.9rem 0 2.3rem;
        border: 1px solid var(--surface-border);
        border-radius: 999px;
        background: var(--surface-alt);
        font-size: 0.95rem;
        color: var(--text-body);
    }
    .mbn-search-bar-input:focus {
        outline: none;
        border-color: var(--accent-color);
        background: var(--surface);
    }
    .mbn-search-bar-input::-webkit-search-cancel-button { -webkit-appearance: none; }

    .mbn-search-results {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0.25rem 0 calc(0.5rem + env(safe-area-inset-bottom, 0px));
    }
    .mbn-search-results:empty::before {
        content: "Escreva o nome ou SKU de um produto";
        display: block;
        padding: 1.25rem 1rem;
        color: var(--text-muted);
        font-size: 0.9rem;
        text-align: center;
    }
    .mbn-search-results .site-search-result-item { padding-left: 1rem; padding-right: 1rem; }
    .mbn-search-results .site-search-view-all { padding: 0.85rem 1rem; }

    .mbn-call-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        margin-bottom: 0.85rem;
        padding: 0.7rem 1rem;
        border-radius: var(--radius-sm);
        background: var(--accent-color);
        color: #fff;
        font-weight: 600;
        text-decoration: none;
    }

    .mbn-nav-list { list-style: none; margin: 0; padding: 0; }
    .mbn-nav-link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.85rem 0.25rem;
        border-bottom: 1px solid var(--surface-border);
        color: var(--text-body);
        text-decoration: none;
        font-weight: 600;
        font-size: 0.95rem;
    }
    .mbn-nav-list > li:last-child > .mbn-nav-link { border-bottom: none; }
    .mbn-nav-link > span { flex: 1 1 auto; }
    .mbn-nav-chevron { color: var(--text-muted); flex: 0 0 auto; }
    .mbn-nav-link--danger { color: #c23b3b; }

    /* Expandable "Catálogo" row: brand -> category tree */
    .mbn-nav-toggle {
        width: 100%;
        background: none;
        border: none;
        border-bottom: 1px solid var(--surface-border);
        cursor: pointer;
        text-align: left;
        font: inherit;
    }
    .mbn-nav-chevron--toggle { transition: transform 0.18s ease; }
    .mbn-nav-toggle[aria-expanded="true"] .mbn-nav-chevron--toggle { transform: rotate(180deg); }

    .mbn-subnav { padding: 0.3rem 0 0.5rem 0.35rem; }
    .mbn-subnav[hidden] { display: none; }
    .mbn-subnav-all {
        display: block;
        padding: 0.55rem 0.4rem;
        font-weight: 600;
        font-size: 0.88rem;
        color: var(--accent-color);
        text-decoration: none;
    }
    .mbn-subnav-brand {
        display: block;
        margin-top: 0.5rem;
        padding: 0.4rem 0.4rem 0.3rem;
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--text-muted);
        text-decoration: none;
    }
    .mbn-subnav-link {
        display: block;
        padding: 0.5rem 0.4rem;
        font-size: 0.9rem;
        color: var(--text-body);
        text-decoration: none;
        border-bottom: 1px solid var(--surface-border);
    }
    .mbn-subnav-link:last-child { border-bottom: none; }

    body.mbn-no-scroll { overflow: hidden; }
}
