:root {
    --ink: #17211d;
    --muted: #66736d;
    --line: #dde6e1;
    --paper: #ffffff;
    --wash: #f3f7f5;
    --brand: #1f6f4a;
    --brand-dark: #124c34;
    --gold: #fff200;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: #fff;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid #30384c;
    background: #3f485e;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .08);
}

.bar,
.main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 74px;
}

.brand {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.brand img {
    display: block;
    width: 200px;
    max-height: 58px;
    object-fit: contain;
}

.nav-note,
.muted {
    color: var(--muted);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.site-nav a {
    border-radius: 5px;
    padding: 10px 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.site-nav a:hover {
    background: rgba(255, 255, 255, .1);
}

.contact-link,
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 6px;
    padding: 0 16px;
    background: #111;
    color: #fff;
    font-weight: 700;
}

.contact-link {
    min-height: 38px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: #4892dc;
    color: #fff;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .12);
}

.main {
    padding: 18px 0 56px;
}

.filters {
    display: grid;
    grid-template-columns: 1.2fr repeat(5, minmax(110px, 1fr)) auto;
    gap: 10px;
    margin-bottom: 24px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.filters input,
.filters select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 10px;
    color: var(--ink);
    background: #fff;
}

.filters button {
    min-height: 42px;
    border: 0;
    border-radius: 6px;
    padding: 0 18px;
    background: var(--brand-dark);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 18px;
}

.section-head h2 {
    margin: 0;
    font-size: 28px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    transition: transform .16s ease, box-shadow .16s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(23, 33, 29, .1);
}

.thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #dfe8e3;
    overflow: hidden;
}

.image-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    color: var(--muted);
    text-align: center;
    font-size: 14px;
}

.thumb img,
.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    color: transparent;
}

.badge {
    position: absolute;
    left: 12px;
    top: 12px;
    border-radius: 6px;
    padding: 7px 10px;
    background: var(--gold);
    color: #111;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .18);
    font-size: 12px;
    font-weight: 800;
}

.card-body {
    padding: 16px;
}

.price {
    color: var(--brand-dark);
    font-size: 22px;
    font-weight: 800;
}

.card h3 {
    min-height: 52px;
    margin: 8px 0;
    font-size: 20px;
    line-height: 1.28;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.meta span {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 8px;
    color: #405049;
    font-size: 13px;
    background: #fbfdfc;
}

.empty {
    border: 1px dashed #b7c7be;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: #fff;
}

.detail-hero {
    padding: 18px 0 12px;
}

.crumb {
    color: var(--muted);
    font-weight: 700;
}

.detail-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.detail-title h1 {
    max-width: 900px;
    margin: 8px 0 6px;
    font-size: 26px;
    line-height: 1.25;
    font-weight: 750;
    text-transform: none;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) 360px;
    gap: 18px;
}

.gallery-main {
    position: relative;
    cursor: zoom-in;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #dfe8e3;
}

.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.gallery-thumbs button {
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: zoom-in;
}

.gallery-thumbs img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 3px;
}

.panel {
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 14px;
    background: #fff;
}

.panel + .panel {
    margin-top: 14px;
}

.specs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.spec {
    display: grid;
    grid-template-columns: 42% 1fr;
    gap: 12px;
    align-items: center;
    border-bottom: 1px dotted #c9d5ce;
    padding: 8px 0;
}

.spec span {
    color: var(--muted);
    font-size: 13px;
}

.spec strong {
    font-size: 15px;
    font-weight: 700;
}

.description {
    margin-top: 16px;
    line-height: 1.75;
}

.panel h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.detail-title .price {
    min-width: 220px;
    padding-top: 34px;
    text-align: right;
    font-size: 25px;
}

.has-lightbox {
    overflow: hidden;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(9, 15, 13, .88);
}

.lightbox[hidden] {
    display: none;
}

.lightbox figure {
    width: min(1120px, calc(100vw - 120px));
    height: min(760px, calc(100vh - 90px));
    margin: 0;
}

.lightbox img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.lightbox figcaption {
    margin-top: 10px;
    color: #fff;
    text-align: center;
    font-weight: 700;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    border: 0;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    cursor: pointer;
}

.lightbox-close {
    top: 18px;
    right: 22px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 34px;
    line-height: 38px;
}

.lightbox-nav {
    top: 50%;
    width: 48px;
    height: 70px;
    border-radius: 6px;
    transform: translateY(-50%);
    font-size: 54px;
    line-height: 54px;
}

.lightbox-nav.prev {
    left: 22px;
}

.lightbox-nav.next {
    right: 22px;
}

.footer {
    border-top: 1px solid var(--line);
    padding: 24px 0;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 980px) {
    .detail-grid,
    .detail-title {
        grid-template-columns: 1fr;
    }

    .filters,
    .grid {
        grid-template-columns: 1fr 1fr;
    }

    .detail-title .price {
        min-width: 0;
        padding-top: 0;
        text-align: left;
    }
}

@media (max-width: 640px) {
    .bar {
        align-items: center;
        flex-wrap: wrap;
        padding: 10px 0;
    }

    .brand img {
        width: 150px;
    }

    .site-nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .contact-link {
        min-height: 34px;
        padding: 0 10px;
        font-size: 13px;
    }

    .filters,
    .grid,
    .specs {
        grid-template-columns: 1fr;
    }

    .gallery-thumbs {
        grid-template-columns: repeat(4, 1fr);
    }

    .lightbox figure {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
    }

    .lightbox-nav {
        width: 38px;
        height: 56px;
        font-size: 42px;
    }

    .lightbox-nav.prev {
        left: 8px;
    }

    .lightbox-nav.next {
        right: 8px;
    }
}
