/* =========================================================================
   Comprar em Portugal – public website
   Colours taken from the logo: ocean blue, leaf green and sun orange.
   ========================================================================= */

:root {
    --brand: #0a6cc2;
    --brand-dark: #07549a;
    --brand-soft: #e7f1fb;
    --green: #2e9e4f;
    --green-soft: #e8f6ec;
    --accent: #f28c00;
    --accent-soft: #fff1de;
    --ink: #1c2633;
    --muted: #66758a;
    --line: #e2e8ef;
    --ground: #f5f7fa;
    --header-h: 76px;
    --sidebar-w: 300px;
    --radius: 14px;
    --bs-link-color: var(--brand);
    --bs-link-hover-color: var(--brand-dark);
    --bs-link-color-rgb: 10, 108, 194;
    --bs-link-hover-color-rgb: 7, 84, 154;
}

html {
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ground);
    color: var(--ink);
}

.min-w-0 { min-width: 0; }
.text-brand { color: var(--brand) !important; }
.text-accent { color: var(--accent) !important; }

.skip-link {
    position: absolute;
    top: .5rem;
    left: .5rem;
    z-index: 2000;
    background: #fff;
    padding: .5rem 1rem;
    border-radius: 8px;
}

/* ---- Buttons ------------------------------------------------------------ */

.btn-brand {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: 10, 108, 194;
}

.btn-outline-brand {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--brand);
    --bs-btn-active-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: 10, 108, 194;
}

.btn-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    color: var(--ink);
    font-size: 1.25rem;
}

.btn-icon:hover { background: var(--brand-soft); color: var(--brand); }

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #86b7e6;
    box-shadow: 0 0 0 .25rem rgba(10, 108, 194, .18);
}

/* ---- Header ------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line);
}

.brand img {
    height: 58px;
    width: auto;
    display: block;
}

.lang-switch {
    display: flex;
    gap: .25rem;
    padding: .2rem;
    background: var(--ground);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.lang-flag {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .55rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    line-height: 1;
}

.lang-flag .fi {
    width: 1.35em;
    line-height: 1em;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}

.lang-flag:hover { color: var(--ink); background: #fff; }

.lang-flag.active {
    background: #fff;
    color: var(--brand);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

@media (max-width: 575.98px) {
    :root { --header-h: 64px; }
    .brand img { height: 42px; }
    .lang-code { display: none; }
    .lang-flag { padding: .35rem; }
}

/* ---- Body: sidebar + main ------------------------------------------------ */

.site-body {
    flex: 1 0 auto;
    display: flex;
    align-items: flex-start;
}

.site-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 3rem;
    outline: none;
}

.sidebar {
    background: #fff;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem .5rem;
}

.sidebar-title {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0;
}

.sidebar-tools {
    padding: 0 1rem .75rem;
    border-bottom: 1px solid var(--line);
}

.sidebar-body {
    padding: .5rem 0 1.5rem;
}

@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        top: var(--header-h);
        flex: 0 0 var(--sidebar-w);
        width: var(--sidebar-w);
        height: calc(100vh - var(--header-h));
        border-right: 1px solid var(--line);
        display: flex;
        flex-direction: column;
        transition: margin-left .25s ease, visibility .25s;
    }

    .sidebar-body {
        flex: 1 1 auto;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    body.sidebar-collapsed .sidebar {
        margin-left: calc(-1 * var(--sidebar-w));
        visibility: hidden;
    }
}

@media (max-width: 991.98px) {
    .sidebar.offcanvas-lg { --bs-offcanvas-width: min(var(--sidebar-w), 88vw); }
    .sidebar-body { overflow-y: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar { transition: none !important; }
}

/* ---- Category tree -------------------------------------------------------- */

.tree, .tree-children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tree-children {
    margin-left: 1.15rem;
    border-left: 1px dashed var(--line);
}

.tree-row {
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .1rem .6rem .1rem .4rem;
    border-radius: 8px;
    margin: 1px .5rem;
}

.tree-row:hover { background: var(--ground); }

.tree-row.is-current {
    background: var(--brand-soft);
    box-shadow: inset 3px 0 0 var(--brand);
}

.tree-caret, .tree-caret-spacer {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
}

.tree-caret {
    display: grid;
    place-items: center;
    border: 0;
    background: none;
    border-radius: 6px;
    color: var(--muted);
    padding: 0;
}

.tree-caret:hover { background: var(--line); color: var(--ink); }
.tree-caret .bi { transition: transform .15s ease; font-size: .8rem; }
.tree-caret[aria-expanded="true"] .bi { transform: rotate(90deg); }

.tree-link {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem 0;
    font-size: .925rem;
    color: var(--ink);
    text-decoration: none;
}

.tree-link:hover { color: var(--brand); }
.tree-link .bi { color: var(--brand); flex: 0 0 auto; }
.tree-children .tree-link .bi { color: var(--muted); font-size: .85em; }
.tree-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree > .tree-node > .tree-row .tree-link { font-weight: 600; }
.tree-row.is-current .tree-link { color: var(--brand-dark); font-weight: 700; }

.tree-count {
    flex: 0 0 auto;
    font-size: .72rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--ground);
    border-radius: 999px;
    padding: .1rem .45rem;
    min-width: 1.6rem;
    text-align: center;
}

.tree-node.is-filtered-out { display: none; }
.tree-name mark { padding: 0; background: #fff3cd; }

/* ---- Search & welcome ----------------------------------------------------- */

.search-bar {
    max-width: 860px;
    margin-bottom: 1.75rem;
}

.search-bar .input-group-text {
    background: #fff;
    color: var(--muted);
}

.search-bar .form-control { border-left: 0; }

.hero {
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--radius) * 1.4);
    padding: clamp(1.5rem, 4vw, 3rem);
    color: #fff;
    background:
        radial-gradient(circle at 92% 10%, rgba(242, 140, 0, .9) 0, rgba(242, 140, 0, 0) 32%),
        linear-gradient(135deg, var(--brand) 0%, #0e86a8 50%, var(--green) 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: center;
    margin-bottom: 2.5rem;
}

.hero h1 {
    font-size: clamp(1.75rem, 3.2vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -.02em;
}

.hero .lead { color: rgba(255, 255, 255, .92); }

.hero-cards { display: grid; gap: .85rem; }

.hero-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: var(--radius);
    backdrop-filter: blur(4px);
}

.hero-card > .bi { font-size: 1.75rem; line-height: 1; }
.hero-card p { color: rgba(255, 255, 255, .88); }

@media (max-width: 991.98px) {
    .hero { grid-template-columns: 1fr; }
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: .35rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.category-tile {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 1.1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.category-tile:hover, .category-tile:focus-within {
    transform: translateY(-2px);
    border-color: #b5d3ef;
    box-shadow: 0 10px 24px -12px rgba(10, 108, 194, .35);
}

.category-main {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--ink);
    text-decoration: none;
}

.category-main:hover .category-name { color: var(--brand); }

.category-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.3rem;
}

.category-tile:nth-child(3n+2) .category-icon { background: var(--green-soft); color: var(--green); }
.category-tile:nth-child(3n+3) .category-icon { background: var(--accent-soft); color: #c06d00; }

.category-name { font-weight: 600; line-height: 1.25; }

.category-sub {
    list-style: none;
    margin: 0;
    padding: 0 0 0 calc(44px + .75rem);
    display: grid;
    gap: .2rem;
    font-size: .85rem;
}

.category-sub a { color: var(--muted); text-decoration: none; }
.category-sub a:hover { color: var(--brand); text-decoration: underline; }
.category-sub .category-more { color: var(--brand); font-weight: 600; }

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) * 1.2);
    box-shadow: inset 4px 0 0 var(--brand);
}

.category-header-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--brand-soft), var(--green-soft));
    color: var(--brand);
    font-size: 1.9rem;
}

.info-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.25rem;
    padding: 1.25rem 1.5rem;
    background: var(--accent-soft);
    border: 1px solid #f7d4a3;
    border-radius: var(--radius);
}

.info-panel > .bi { font-size: 2rem; color: #c06d00; }
.info-panel > div { flex: 1 1 280px; }

.tip-card {
    display: flex;
    gap: 1rem;
    padding: 1.1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.tip-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    background: var(--green-soft);
    color: var(--green);
    font-size: 1.2rem;
}

.result-list {
    display: grid;
    gap: .5rem;
    max-width: 860px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .75rem 1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    text-decoration: none;
}

.result-item:hover { border-color: #b5d3ef; box-shadow: 0 6px 18px -12px rgba(10, 108, 194, .4); }

.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.empty-state > .bi { font-size: 2.75rem; color: var(--brand); }

/* ---- Auth & content pages ------------------------------------------------- */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: clamp(1.5rem, 6vh, 4rem);
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) * 1.3);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: 0 20px 50px -30px rgba(28, 38, 51, .35);
}

.auth-icon, .content-icon {
    width: 56px;
    height: 56px;
    display: inline-grid;
    place-items: center;
    border-radius: 16px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.6rem;
    flex: 0 0 auto;
}

.content-page { max-width: 980px; margin: 0 auto; width: 100%; }

.content-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) * 1.3);
    padding: clamp(1.25rem, 4vw, 2.75rem);
}

.content-body h2 { font-size: 1.15rem; font-weight: 700; margin-top: 1.75rem; }
.content-body p, .content-body li { line-height: 1.7; }

/* ---- Buying guides ---------------------------------------------------------- */

.guide-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.guide-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--ink);
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.guide-card:hover, .guide-card:focus-within {
    transform: translateY(-2px);
    border-color: #b5d3ef;
    box-shadow: 0 10px 24px -12px rgba(10, 108, 194, .35);
}

.guide-card-cover {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    background-color: var(--brand-soft, #eaf3fb);
}

.guide-card-cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--brand);
}

.guide-card-body { display: flex; flex-direction: column; gap: .35rem; padding: 1rem; }

.guide-card-tag {
    align-self: flex-start;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--brand);
    background: var(--brand-soft, #eaf3fb);
    border-radius: 999px;
    padding: .15rem .6rem;
    text-decoration: none;
}

.guide-card-title { font-weight: 700; line-height: 1.3; }
.guide-card-excerpt { font-size: .85rem; color: #6b7684; line-height: 1.5; }
.guide-card-date { font-size: .78rem; color: #8993a1; margin-top: .25rem; }

.shop-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.shop-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--ink);
}

.shop-card-cover {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
    object-position: center;
    background-color: var(--brand-soft, #eaf3fb);
}

.shop-card-cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--brand);
}

.shop-card-body { display: flex; flex-direction: column; gap: .35rem; padding: 1rem; }
.shop-card-title { font-weight: 700; line-height: 1.3; }
.shop-card-meta { font-size: .82rem; color: #6b7684; }
.shop-card-link { font-size: .82rem; color: var(--brand); text-decoration: none; margin-top: .25rem; }
.shop-card-link:hover { text-decoration: underline; }

.shops-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    margin: .75rem 0;
}

.map-container { position: relative; }

.shops-map {
    height: min(70vh, 640px);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    z-index: 0;
}

.map-marker {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--brand);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}

.map-marker .bi { transform: rotate(45deg); color: #fff; font-size: .95rem; }

.guide-article .guide-cover {
    display: block;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: calc(var(--radius) - 4px);
    margin: 0 auto 1.5rem;
}

.guide-body table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.guide-body table td, .guide-body table th { border: 1px solid var(--line); padding: .5rem .6rem; }
.guide-body img { max-width: 100%; height: auto; border-radius: 6px; }

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.contact-item {
    display: flex;
    gap: .85rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--ground);
    overflow-wrap: anywhere;
}

.contact-item > .bi { font-size: 1.4rem; color: var(--brand); }

/* ---- Footer --------------------------------------------------------------- */

.site-footer {
    flex-shrink: 0;
    background: #0d1b2c;
    color: rgba(255, 255, 255, .85);
    position: relative;
    z-index: 1;
}

.footer-brand {
    display: inline-block;
    background: #fff;
    border-radius: 12px;
    padding: .4rem .75rem;
}

.footer-brand img {
    height: 56px;
    width: auto;
    display: block;
}

.footer-muted { color: rgba(255, 255, 255, .65); max-width: 34ch; }

.footer-title {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: .55rem;
}

.footer-links a, .footer-link-btn {
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
    font-size: .925rem;
    text-align: left;
}

.footer-links a:hover, .footer-link-btn:hover { color: #fff; text-decoration: underline; }

.footer-contacts li {
    display: flex;
    gap: .6rem;
    align-items: baseline;
    overflow-wrap: anywhere;
}

.footer-contacts .bi { color: #ffb14a; }

.social-link {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.social-link:hover { background: var(--brand); color: #fff; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding: 1rem 0;
    font-size: .85rem;
    color: rgba(255, 255, 255, .6);
}

/* ---- Cookie banner -------------------------------------------------------- */

.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1060;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 0;
    max-width: 1200px;
    margin: 0 auto;
    animation: cookie-in .35s ease-out;
}

@keyframes cookie-in {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-banner { animation: none; }
}

.cookie-category {
    padding: .85rem 0;
    border-bottom: 1px solid var(--line);
}

.cookie-category:last-child { border-bottom: 0; }
.cookie-category .form-check-input { width: 2.5em; height: 1.3em; flex-shrink: 0; }

/* ---- Filter toolbar (region, city, search) – same as viveremportugal ---------------- */

:root { --toolbar-h: 54px; }

.toolbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    z-index: 1020;
}

.toolbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    padding-block: .6rem;
}

.toolbar-field {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.toolbar-field > .bi {
    position: absolute;
    left: .75rem;
    color: var(--muted);
    pointer-events: none;
    z-index: 1;
}

.toolbar-field .form-select,
.toolbar-field .form-control {
    padding-left: 2.1rem;
    min-width: 11rem;
    border-radius: 999px;
}

.toolbar-search { flex: 1 1 16rem; max-width: 30rem; }
.toolbar-search .form-control { width: 100%; }
.toolbar-submit { border-radius: 999px; padding-inline: 1rem; }

@media (min-width: 992px) {
    .toolbar { position: sticky; top: var(--header-h); }
    body.has-toolbar .sidebar {
        top: calc(var(--header-h) + var(--toolbar-h));
        height: calc(100vh - var(--header-h) - var(--toolbar-h));
    }
}

@media (max-width: 575.98px) {
    .toolbar-field { flex: 1 1 45%; }
    .toolbar-field .form-select, .toolbar-field .form-control { min-width: 0; width: 100%; }
    .toolbar-search { flex: 1 1 60%; max-width: none; }
}

/* ---- Products (products.php, product.php, category page teaser) ------------- */

.product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--ink);
    text-decoration: none;
    transition: box-shadow .15s ease, transform .15s ease;
}

.product-card:hover, .product-card:focus-visible {
    box-shadow: 0 8px 22px rgba(16, 42, 67, .1);
    transform: translateY(-2px);
    color: var(--ink);
}

.product-card-cover {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background-color: var(--brand-soft);
}

.product-card-cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--brand);
}

.product-card-body { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem 1rem; flex: 1 1 auto; }
.product-card-brand { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brand); }
.product-card-title { font-weight: 700; line-height: 1.3; }
.product-card-meta { font-size: .82rem; color: var(--muted); }
.product-card-specs { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .15rem; }
.product-card-specs > span { font-size: .75rem; background: var(--ground); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .55rem; color: #4a5768; }
.product-card-price { margin-top: auto; padding-top: .4rem; font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.product-card-price small { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }

.filters { padding: 0 1rem; }
.filter-group { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.filter-group-compact { padding: .55rem 0; }
.filter-title { display: block; font-size: .8rem; font-weight: 700; margin-bottom: .45rem; color: var(--ink); }
.filter-unit { font-weight: 400; color: var(--muted); }
.filter-range { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.filter-options { max-height: 13rem; overflow-y: auto; }
.filter-options .form-check-label, .filter-group .form-check-label { font-size: .88rem; }
.filter-count { font-size: .75rem; color: var(--muted); }
.filter-actions { display: flex; gap: .5rem; padding: 1rem 0; position: sticky; bottom: 0; background: #fff; }

.results-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1rem 0; }
.results-bar .form-select { min-width: 12rem; }
.active-filters { display: flex; flex-wrap: wrap; gap: .35rem; }
.subcategory-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-size: .82rem;
    padding: .25rem .7rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    text-decoration: none;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip-active { background: var(--brand-soft); border-color: transparent; color: var(--brand-dark); }

.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 2rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
}
@media (max-width: 767.98px) { .product-detail { grid-template-columns: 1fr; padding: 1rem; } }

.product-gallery-main {
    display: flex;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: calc(var(--radius) - 4px);
    background: var(--brand-soft);
}
.product-gallery-thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.product-thumb { padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; overflow: hidden; }
.product-thumb img { width: 72px; height: 54px; object-fit: cover; display: block; }
.product-thumb.active { border-color: var(--brand); }
.product-price { font-size: 1.6rem; font-weight: 800; }

.spec-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 2rem; margin: 0; }
.spec-row { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.spec-row dt { font-weight: 400; color: var(--muted); }
.spec-row dd { margin: 0; font-weight: 600; text-align: right; }

.unit-thumb { width: 48px; height: 36px; object-fit: cover; border-radius: 4px; }
.product-map { height: 320px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; }

.seller-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.seller-card { display: flex; flex-direction: column; gap: .25rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); background: var(--ground); }
.seller-role { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brand); }

/* ---- Brand tiles (choose a brand, then see its models) ---------------------------------------------- */
.brand-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .65rem; margin: 1rem 0 1.25rem; }
.brand-tile {
    display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .7rem .5rem .6rem; text-align: center;
    background: #fff; border: 1px solid var(--line); border-radius: .75rem; color: inherit; text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}
.brand-tile:hover, .brand-tile:focus-visible { border-color: var(--brand); box-shadow: 0 2px 10px rgba(13, 110, 253, .12); }
.brand-tile.is-active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.brand-tile-logo { display: flex; align-items: center; justify-content: center; height: 2.75rem; width: 100%; }
.brand-tile-logo img { max-width: 100%; max-height: 2.75rem; object-fit: contain; }
.brand-tile-initial { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--ground); color: var(--brand); font-weight: 700; font-size: 1.1rem; }
.brand-tile-name { font-weight: 700; font-size: .9rem; line-height: 1.25; overflow-wrap: anywhere; }
.brand-tile-count { font-size: .75rem; color: var(--muted); }

/* ---- Versions of a model: comparison table ------------------------------------------------------------ */
.version-table th, .version-table td { min-width: 9.5rem; vertical-align: top; }
.version-table thead th { white-space: normal; border-bottom-width: 2px; }
.version-table tbody th { font-weight: 500; color: var(--muted); min-width: 8rem; position: sticky; left: 0; background: #fff; }
.version-name { font-weight: 700; line-height: 1.25; }
.version-price { font-weight: 700; font-size: 1.15rem; color: var(--brand); margin: .15rem 0; }