:root {
    --bg: #f2f6fb;
    --surface: #ffffff;
    --surface-strong: #f8fbff;
    --text: #1e293b;
    --muted: #5b6b82;
    --line: #dbe4ef;
    --brand: #0b4f7d;
    --brand-strong: #083b5f;
    --accent: #d37a2c;
    --ok-bg: #ecfdf3;
    --ok-text: #166534;
    --err-bg: #fff1f1;
    --err-text: #b42318;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --shadow-md: 0 10px 24px rgba(12, 31, 61, 0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 0% 0%, #e6f2ff 0%, transparent 34%),
        radial-gradient(circle at 100% 14%, #fef3dd 0%, transparent 28%),
        var(--bg);
    font-family: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}

a { color: var(--brand); text-decoration-thickness: 0.08em; text-underline-offset: 0.14em; }
a:hover { color: var(--brand-strong); }

.skip-link {
    position: absolute;
    top: -40px;
    left: 8px;
    background: #111827;
    color: #fff;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}
.skip-link:focus { top: 8px; }

header {
    color: #fff;
    background: linear-gradient(130deg, #072338 0%, #0b4f7d 65%, #10679f 100%);
    border-bottom: 3px solid rgba(255, 255, 255, 0.16);
}
.header-container { max-width: 1160px; margin: 0 auto; padding: 16px 20px 18px; }
.header-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.header-brand a {
    color: #fff;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.header-brand span { color: #d6e8f8; font-size: 14px; }
.header-top {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    font-size: 14px;
}
.header-top a {
    color: #edf6ff;
    text-decoration: none;
    border: 1px solid rgba(237, 246, 255, 0.34);
    border-radius: 999px;
    padding: 4px 10px;
}
.header-top a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}
.header-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.header-nav a {
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.06);
}
.header-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
}
.header-nav a.is-active {
    background: #ffffff;
    color: #0b4f7d;
    border-color: #ffffff;
}
.header-nav a.is-active:hover { color: #0b4f7d; }

.header-menu-toggle {
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 10px;
    padding: 7px 11px;
}

.breadcrumbs {
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}
.breadcrumbs ol {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 14px;
    color: var(--muted);
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs li + li::before {
    content: "/";
    color: #9aa9bd;
}
.breadcrumbs .is-current { color: #20364f; font-weight: 600; }

main { max-width: 1160px; margin: 22px auto; padding: 0 16px 26px; }

.site-footer {
    border-top: 1px solid var(--line);
    padding: 14px 16px 20px;
}

.site-footer-counter {
    max-width: 1160px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-md);
}
.card h1, .card h2, .card h3 { margin-top: 0; line-height: 1.25; }

.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.flow-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.full-span { grid-column: 1 / -1; }
.qty-input { width: 88px; max-width: 88px; }

.alert {
    margin: 10px 0;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    padding: 10px 12px;
    font-size: 14px;
}
.alert-ok { background: var(--ok-bg); color: var(--ok-text); border-color: #b7ebc7; }
.alert-err { background: var(--err-bg); color: var(--err-text); border-color: #f7b2b7; }

.btn,
button {
    font: inherit;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 8px 14px;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.btn-primary,
button {
    color: #fff;
    background: linear-gradient(140deg, var(--brand) 0%, #10679f 100%);
    border-color: transparent;
}
.btn-primary:hover,
button:hover {
    color: #fff;
    background: linear-gradient(140deg, var(--brand-strong) 0%, #0b4f7d 100%);
}
.btn-secondary {
    color: var(--brand-strong);
    background: #ebf5ff;
    border-color: #c3dcf3;
}
.btn-primary:hover,
.btn-primary:focus-visible {
    color: #fff;
    background: linear-gradient(140deg, var(--brand-strong) 0%, #0b4f7d 100%);
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
    color: #083b5f;
    background: #dcecff;
    border-color: #9dc3e6;
}

input,
textarea,
select {
    width: 100%;
    font: inherit;
    padding: 8px 10px;
    border: 1px solid #c5d2e0;
    border-radius: var(--radius-sm);
    background: #fff;
}
input:focus,
textarea:focus,
select:focus,
.btn:focus,
button:focus,
a:focus {
    outline: 2px solid #0f7cc7;
    outline-offset: 2px;
}

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table:not([data-adaptive-table]) { min-width: 640px; }
th, td { border-bottom: 1px solid #e0e8f1; padding: 10px 8px; text-align: left; vertical-align: top; }
th { font-size: 14px; color: #243448; background: var(--surface-strong); }

.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 252px), 1fr)); gap: 12px; }
.catalog-filters {
    margin-top: 12px;
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #f9fcff;
}
.catalog-filters label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #334a64;
}
.catalog-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 3px 8px;
    font-size: 12px;
    line-height: 1.2;
}
.chip-sales {
    color: #085f2a;
    background: #e7faef;
    border-color: #bde9cd;
}
.chip-views {
    color: #0b4f7d;
    background: #ebf5ff;
    border-color: #c9deef;
}
.chip-request {
    color: #8a4b0f;
    background: #fff3e5;
    border-color: #f4d7b1;
}
.catalog-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.catalog-item h3 { margin: 0; font-size: 17px; }
.catalog-meta { margin: 0; font-size: 14px; color: var(--muted); }
.catalog-price { font-size: 19px; font-weight: 700; color: #1f4f26; }

.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.gallery-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; background: #fff; }
.gallery-item img { width: 100%; height: 180px; object-fit: cover; border-radius: 6px; border: 1px solid #dce3ec; }

.pdp-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 360px);
    gap: 16px;
}
.pdp-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}
.product-gallery-switcher {
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 10px;
}
.product-gallery-main-wrap {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
.product-gallery-main {
    display: block;
    width: 100%;
    max-height: 460px;
    object-fit: contain;
    background: #f7fbff;
}
.product-gallery-thumbs {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}
.product-gallery-thumb {
    border: 1px solid #c9d9e9;
    border-radius: 8px;
    padding: 3px;
    background: #fff;
}
.product-gallery-thumb.is-active {
    border-color: #0b4f7d;
    box-shadow: 0 0 0 1px #0b4f7d inset;
}
.product-gallery-thumb img {
    width: 100%;
    height: 74px;
    object-fit: cover;
    border-radius: 6px;
}
.pdp-tabs {
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
}
.pdp-tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: #f5f9ff;
    border-bottom: 1px solid var(--line);
}
.pdp-tab {
    border: 1px solid #bfd4ea;
    background: #fff;
    color: #1e3f5d;
    border-radius: 999px;
    padding: 7px 12px;
}
.pdp-tab.is-active {
    background: #0b4f7d;
    color: #fff;
    border-color: #0b4f7d;
}
.pdp-tab-panel {
    padding: 12px;
}
.pdp-buy-panel {
    position: sticky;
    top: 14px;
    align-self: start;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #f9fcff;
    padding: 12px;
}
.pdp-price {
    margin: 0;
    font-size: 25px;
    line-height: 1.2;
    color: #1f4f26;
    font-weight: 700;
}
.pdp-buy-form {
    margin-top: 8px;
    display: grid;
    gap: 8px;
}
.pdp-trust-list {
    margin: 12px 0 0;
    padding-left: 18px;
    color: #2f4259;
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.9fr) minmax(240px, 320px);
    gap: 14px;
}
.cart-summary-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #f9fcff;
    padding: 12px;
    position: sticky;
    top: 14px;
    align-self: start;
}
.cart-summary-panel h3 { margin: 0 0 10px; }
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
    gap: 14px;
}
.checkout-help {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #f9fcff;
    padding: 12px;
}
.checkout-help h3 { margin-top: 0; }

.is-clickable-row { cursor: pointer; }
.is-clickable-row:hover { background: #f5f9ff; }
.portfolio-preview {
    display: block;
    width: 120px;
    height: auto;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}
.portfolio-mobile-list { display: none; }
.portfolio-mobile-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    margin-bottom: 10px;
}
.portfolio-mobile-link {
    display: flex;
    gap: 10px;
    padding: 10px;
    text-decoration: none;
    color: inherit;
}
.portfolio-mobile-preview {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    flex-shrink: 0;
}
.portfolio-mobile-content { min-width: 0; }
.portfolio-mobile-content h3 {
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.portfolio-mobile-number {
    margin: 0 0 4px;
    font-size: 12px;
    color: #48617a;
}
.portfolio-mobile-content .muted { overflow-wrap: anywhere; }
.pagination-row { justify-content: space-between; }
.pagination-links { gap: 8px; }
.portfolio-nav-row { justify-content: space-between; }
.portfolio-figure { margin: 0; }
.portfolio-full-image {
    display: block;
    width: 100%;
    max-width: 980px;
    height: auto;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

@media (max-width: 900px) {
    .header-container { padding: 14px 14px 16px; }
    .header-brand a { font-size: 18px; }
    .header-top { justify-content: flex-start; }
    .header-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-top: 2px;
    }
    .header-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        margin-top: 10px;
    }
    .header-nav.is-open { display: flex; }
    .header-nav a {
        width: 100%;
        padding: 9px 10px;
        border-radius: 10px;
    }
    .pdp-layout,
    .cart-layout,
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    .pdp-buy-panel,
    .cart-summary-panel {
        position: static;
    }
    .pdp-tab-list {
        gap: 6px;
    }
    .pdp-tab {
        width: 100%;
        border-radius: 10px;
    }
    .grid,
    .catalog-grid,
    .form-grid,
    .catalog-filters,
    .pdp-meta-grid {
        grid-template-columns: 1fr;
    }
    .card { padding: 14px; }
    .portfolio-nav-row { justify-content: flex-start; }
    .portfolio-preview { width: 96px; }
    .portfolio-desktop-table { display: none; }
    .portfolio-mobile-list { display: block; }
    .portfolio-mobile-link { align-items: center; }

    .table-scroll { overflow: visible; }

    table[data-adaptive-table] {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0;
    }
    table[data-adaptive-table] thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }
    table[data-adaptive-table],
    table[data-adaptive-table] tbody,
    table[data-adaptive-table] tr,
    table[data-adaptive-table] td {
        display: block;
        width: 100%;
    }
    table[data-adaptive-table] tbody tr {
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: #fff;
        padding: 8px 10px;
        margin-bottom: 10px;
    }
    table[data-adaptive-table] td {
        border: 0;
        padding: 6px 0;
        display: grid;
        grid-template-columns: minmax(96px, 42%) minmax(0, 58%);
        column-gap: 10px;
        align-items: start;
        overflow-wrap: anywhere;
    }
    table[data-adaptive-table] td::before {
        content: attr(data-label);
        font-size: 12px;
        color: #48617a;
        font-weight: 600;
    }
    table[data-adaptive-table] td[data-label=""],
    table[data-adaptive-table] td[colspan] {
        grid-template-columns: 1fr;
    }
    table[data-adaptive-table] td[data-label=""]::before,
    table[data-adaptive-table] td[colspan]::before {
        display: none;
    }
}
