:root {
    color-scheme: dark;
    --bg: #0e0f0d;
    --surface: #171815;
    --surface-2: #1f211d;
    --surface-3: #282a24;
    --ink: #f4f1e8;
    --muted: #a9a497;
    --muted-2: #7f796d;
    --line: #343229;
    --line-strong: #4a4638;
    --accent: #48b9a7;
    --accent-dark: #319889;
    --accent-soft: rgba(72, 185, 167, 0.14);
    --gold: #d7b36a;
    --gold-soft: rgba(215, 179, 106, 0.13);
    --champagne: #f0d99d;
    --bronze: #8d6a38;
    --warning: #d99c3b;
    --danger: #ef6b63;
    --shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
    --shadow-deep: 0 28px 80px rgba(0, 0, 0, 0.48);
    --nav-width: 232px;
}

* {
    box-sizing: border-box;
}

html {
    scrollbar-color: var(--line-strong) var(--bg);
}

body {
    margin: 0;
    background:
        linear-gradient(115deg, rgba(240, 217, 157, 0.035), transparent 34%),
        radial-gradient(circle at top left, rgba(72, 185, 167, 0.09), transparent 360px),
        linear-gradient(180deg, rgba(215, 179, 106, 0.05), transparent 320px),
        var(--bg);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

img {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

main {
    width: min(1900px, 100%);
    margin: 0 auto;
    padding: 34px 38px 46px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 76px;
    padding: 0 38px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(90deg, rgba(215, 179, 106, 0.04), transparent 36%),
        rgba(15, 15, 13, 0.9);
    backdrop-filter: blur(10px);
}

.brand,
.site-nav,
.inline-form {
    display: flex;
    align-items: center;
}

.brand {
    gap: 10px;
    font-weight: 800;
    color: var(--ink);
}

.brand-logo {
    display: block;
    width: 150px;
    height: auto;
    border-radius: 8px;
}

.site-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 18px;
    color: var(--muted);
    font-size: 15px;
}

.site-nav a:hover,
.link-button:hover {
    color: var(--accent);
}

.link-button {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    padding: 0;
}

@media (min-width: 1051px) {
    body:has(.catalog-layout) {
        --nav-width: 232px;
    }

    body {
        padding-left: var(--nav-width);
    }

    main {
        padding: 34px 34px 46px;
    }

    .site-header {
        position: fixed;
        inset: 0 auto 0 0;
        align-items: stretch;
        flex-direction: column;
        justify-content: flex-start;
        width: var(--nav-width);
        height: 100vh;
        min-height: 0;
        padding: 28px 18px;
        overflow-y: auto;
        border-right: 1px solid var(--line);
        border-bottom: 0;
        background:
            linear-gradient(180deg, rgba(215, 179, 106, 0.08), transparent 42%),
            rgba(15, 15, 13, 0.94);
    }

    .brand {
        justify-content: center;
    }

    .site-nav {
        display: grid;
        align-content: start;
        justify-content: stretch;
        gap: 8px;
        margin-top: 30px;
        font-size: 15px;
    }

    .site-nav a,
    .site-nav .link-button {
        display: flex;
        align-items: center;
        min-height: 44px;
        width: 100%;
        padding: 0 12px;
        border-radius: 8px;
        color: var(--muted);
        text-align: left;
    }

    .site-nav a:hover,
    .site-nav .link-button:hover {
        background: rgba(215, 179, 106, 0.08);
        color: var(--ink);
    }

    .inline-form {
        display: block;
        width: 100%;
    }

    .messages {
        padding: 0 34px;
    }

}

.messages {
    width: min(1900px, 100%);
    margin: 18px auto 0;
    padding: 0 38px;
}

.message {
    margin-bottom: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.island-toast-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.island-toast-stack .message {
    width: 100%;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.message-error {
    border-left-color: var(--danger);
}

.message-warning {
    border-left-color: var(--warning);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    position: relative;
    overflow: hidden;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.24), transparent);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-120%);
    transition: opacity 180ms ease, transform 520ms ease;
}

.button:hover::after {
    opacity: 1;
    transform: translateX(120%);
}

.button.primary {
    border-color: rgba(105, 218, 201, 0.8);
    background: linear-gradient(135deg, #6ce3d1, var(--accent) 52%, var(--accent-dark));
    color: #07110f;
    box-shadow: 0 14px 34px rgba(72, 185, 167, 0.22);
}

.button.primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #eefdf9;
}

.button.ghost:hover {
    background: var(--gold-soft);
    border-color: var(--gold);
    color: var(--gold);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.catalog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    transition: grid-template-columns 220ms ease, gap 220ms ease;
}

.filters {
    position: static;
    min-width: 0;
}

.filters h1::after {
    content: "";
    display: block;
    width: 76px;
    height: 2px;
    margin-top: 18px;
    background: linear-gradient(90deg, var(--champagne), transparent);
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 22px;
    color: var(--ink);
    font-size: clamp(34px, 4vw, 60px);
    line-height: 1;
}

.filters h1 {
    display: block;
    margin-bottom: 10px;
    font-size: clamp(24px, 2.2vw, 34px);
    line-height: 1.04;
}

h2 {
    margin-bottom: 0;
    font-size: 20px;
    line-height: 1.2;
}

h2 a:hover {
    color: var(--accent);
}

.form-card,
.order-summary,
.purchase-panel {
    display: grid;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.order-summary {
    background:
        linear-gradient(135deg, rgba(215, 179, 106, 0.08), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
        var(--surface);
}

.checkout-form,
.payment-form {
    gap: 22px;
}

.form-section {
    display: grid;
    gap: 12px;
}

.form-section h2 {
    color: var(--champagne);
    font-size: 17px;
}

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

.field-wide {
    grid-column: 1 / -1;
}

.choice-grid,
.choice-list > div,
.choice-list ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.choice-list > div > div,
.choice-list li {
    min-width: 0;
}

.choice-card,
.choice-list label {
    display: flex;
    position: relative;
    min-height: 54px;
    align-items: center;
    gap: 12px;
    padding: 13px 14px 13px 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent),
        rgba(255, 255, 255, 0.025);
    color: var(--ink);
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.choice-card-title {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.choice-card::before,
.choice-list label::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    width: 16px;
    height: 16px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: #10110f;
    box-shadow: inset 0 0 0 4px #10110f;
    transform: translateY(-50%);
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.choice-card:hover,
.choice-list label:hover {
    border-color: rgba(215, 179, 106, 0.36);
    background: rgba(215, 179, 106, 0.06);
    transform: translateY(-1px);
}

.choice-card:has(input:checked),
.choice-list label:has(input:checked) {
    border-color: rgba(72, 185, 167, 0.72);
    background:
        linear-gradient(135deg, rgba(72, 185, 167, 0.16), transparent 58%),
        rgba(215, 179, 106, 0.06);
    color: var(--ink);
    box-shadow: 0 14px 28px rgba(72, 185, 167, 0.1);
}

.choice-card:has(input:checked)::before,
.choice-list label:has(input:checked)::before {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 4px #10110f, 0 0 0 3px rgba(72, 185, 167, 0.12);
}

.choice-card input,
.choice-list input {
    position: absolute;
    width: 1px;
    min-height: 1px;
    opacity: 0;
    accent-color: var(--accent);
}

.payment-choice-grid,
.payment-choice-list > div,
.payment-choice-list ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.payment-choice-card {
    min-height: 76px;
    align-items: center;
    padding-top: 12px;
    padding-bottom: 12px;
}

.errorlist {
    margin: 6px 0 0;
    padding: 0;
    color: var(--danger);
    font-size: 13px;
    list-style: none;
}

.filter-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(215, 179, 106, 0.08), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
        var(--surface);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.filter-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 42px;
    padding: 0 14px;
    color: var(--ink);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    list-style: none;
    user-select: none;
}

.filter-panel > summary::-webkit-details-marker {
    display: none;
}

.filter-panel[open] > summary {
    border-bottom: 1px solid rgba(215, 179, 106, 0.14);
}

.filter-toggle-icon {
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
    transform: rotate(45deg);
    transition: transform 160ms ease;
}

.filter-panel[open] .filter-toggle-icon {
    transform: rotate(225deg);
}

.filter-form {
    display: grid;
    gap: 10px;
    padding: 12px 14px 14px;
}

.filter-panel:not([open]) .filter-form {
    display: none;
}

@media (min-width: 1051px) {
    .catalog-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .catalog-layout .filters {
        position: static;
        width: 100%;
        min-width: 0;
    }

    .catalog-layout .filters h1 {
        display: block;
        margin-bottom: 10px;
    }

    .catalog-layout .filter-panel {
        overflow: hidden;
    }

    .catalog-layout .filter-panel > summary {
        min-height: 40px;
        padding: 0 14px;
    }

    .catalog-layout .filter-form {
        grid-template-columns: repeat(4, minmax(150px, 1fr));
        align-items: end;
        gap: 10px;
        padding: 12px 14px 14px;
    }

    .catalog-layout .filter-form label {
        gap: 4px;
        font-size: 12px;
    }

    .catalog-layout .filter-form > label:first-child,
    .catalog-layout .price-row {
        grid-column: span 2;
    }

    .catalog-layout .filter-form input,
    .catalog-layout .filter-form select {
        min-height: 34px;
        padding: 6px 9px;
        font-size: 13px;
    }

    .catalog-layout .price-row {
        gap: 8px;
    }

    .catalog-layout .check-row {
        min-height: 34px;
        align-self: end;
        padding-bottom: 1px;
    }

    .catalog-layout .filter-panel:not([open]) {
        min-height: 0;
    }
}

@media (min-width: 1280px) {
    .catalog-layout .filter-form {
        grid-template-columns: minmax(190px, 1.5fr) repeat(4, minmax(118px, 1fr)) minmax(190px, 1.25fr);
    }

    .catalog-layout .filter-form > label:first-child,
    .catalog-layout .price-row {
        grid-column: auto;
    }

    .catalog-layout .check-row {
        grid-column: span 2;
    }
}

@media (min-width: 1360px) {
    .catalog-layout .filter-form {
        grid-template-columns:
            minmax(168px, 1.35fr)
            repeat(4, minmax(102px, 0.95fr))
            minmax(180px, 1.28fr)
            minmax(112px, 0.8fr)
            minmax(132px, 0.95fr);
    }

    .catalog-layout .check-row {
        grid-column: auto;
        white-space: nowrap;
    }
}

label,
.form-card p {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #11110f;
    color: var(--ink);
    font: inherit;
    padding: 9px 11px;
    outline: none;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

select {
    color-scheme: dark;
}

input::placeholder {
    color: var(--muted-2);
}

textarea {
    resize: vertical;
}

.price-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-row input {
    width: 18px;
    min-height: 18px;
}

.catalog-results {
    min-width: 0;
}

.catalog-results.is-loading .product-grid {
    opacity: 0.58;
    transform: translateY(4px);
    pointer-events: none;
}

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

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 22px;
    transition: opacity 180ms ease, transform 180ms ease;
}

.catalog-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 22px;
}

.catalog-skeleton-card {
    position: relative;
    overflow: hidden;
    min-height: 430px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.026), transparent 46%),
        var(--surface);
    box-shadow: var(--shadow);
}

.catalog-skeleton-card::before,
.product-image.is-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(105deg, transparent 0%, rgba(240, 217, 157, 0.1) 38%, transparent 72%);
    transform: translateX(-110%);
    animation: skeleton-shimmer 1180ms ease-in-out infinite;
}

.catalog-skeleton-media {
    aspect-ratio: 16 / 10;
    background: #11120f;
}

.catalog-skeleton-body {
    display: grid;
    gap: 12px;
    padding: 20px;
}

.catalog-skeleton-body span,
.catalog-skeleton-body strong,
.catalog-skeleton-body p,
.catalog-skeleton-body em {
    display: block;
    height: 12px;
    margin: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.075);
}

.catalog-skeleton-body strong {
    width: 74%;
    height: 22px;
}

.catalog-skeleton-body p {
    width: 92%;
}

.catalog-skeleton-body em {
    width: 54%;
    height: 18px;
}

.load-more-row,
.catalog-autoload-sentinel {
    display: flex;
    justify-content: center;
    padding: 24px 0 4px;
}

.catalog-autoload-sentinel {
    min-height: 52px;
    align-items: center;
    color: var(--muted);
}

.catalog-autoload-sentinel span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(215, 179, 106, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.catalog-autoload-sentinel span::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid rgba(240, 217, 157, 0.22);
    border-top-color: var(--accent);
    border-radius: 999px;
    animation: spin 720ms linear infinite;
}

.product-card,
.cart-row,
.metric-grid > div,
.info-grid > div {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 44%),
        var(--surface);
    transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.product-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(240, 217, 157, 0.78), transparent);
    opacity: 0;
    transition: opacity 180ms ease;
}

.product-card:hover {
    border-color: rgba(215, 179, 106, 0.34);
    box-shadow: var(--shadow-deep);
    transform: translateY(-5px);
}

.product-card:hover::before {
    opacity: 1;
}

.product-image,
.detail-media {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #0b0b0a;
    color: var(--muted);
    font-weight: 700;
    text-align: center;
}

.product-image::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 46%, rgba(0, 0, 0, 0.42)),
        linear-gradient(110deg, transparent, rgba(240, 217, 157, 0.08), transparent 64%);
    pointer-events: none;
}

.product-image img,
.detail-media img {
    position: relative;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0;
}

.product-image img {
    transition: transform 520ms ease, filter 520ms ease;
}

.product-image img[data-lazy-image] {
    opacity: 0;
    filter: blur(12px) saturate(0.92);
    transform: scale(1.02);
    transition: opacity 360ms ease, transform 520ms ease, filter 520ms ease;
}

.product-image img[data-lazy-image].is-loaded {
    opacity: 1;
    filter: none;
    transform: scale(1);
}

.product-card:hover .product-image img.is-loaded,
.product-card:hover .product-image img:not([data-lazy-image]) {
    filter: saturate(1.08) contrast(1.06);
    transform: scale(1.055);
}

.stock-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    min-height: 30px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(14, 15, 13, 0.72);
    backdrop-filter: blur(10px);
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    transition: transform 180ms ease, border-color 180ms ease;
}

.stock-badge.is-available {
    border-color: rgba(72, 185, 167, 0.52);
}

.stock-badge.is-empty {
    border-color: rgba(215, 179, 106, 0.44);
}

.product-card:hover .stock-badge {
    transform: translateY(-2px);
}

.product-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.product-card-body h2 {
    min-height: 48px;
}

.eyebrow {
    margin: 0;
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.product-meta,
.summary-row,
.summary-total {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.product-meta strong {
    color: var(--ink);
    font-size: 19px;
}

.product-meta span {
    color: var(--muted);
}

.product-actions {
    display: grid;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(215, 179, 106, 0.12);
}

.product-actions p {
    margin: 0;
    color: var(--muted);
    display: -webkit-box;
    min-height: 42px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.add-cart-form {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 10px;
}

.product-detail,
.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
    gap: 34px;
    align-items: start;
}

.product-detail {
    grid-template-columns: minmax(520px, 0.95fr) minmax(420px, 1.05fr);
}

.detail-media {
    width: 100%;
    min-width: 0;
    height: clamp(430px, 38vw, 560px);
    min-height: 0;
    aspect-ratio: auto;
    border: 0;
    border-radius: 8px;
    box-shadow: var(--shadow-deep);
}

.detail-info {
    display: grid;
    gap: 18px;
}

.lead {
    max-width: 72ch;
    color: var(--muted);
    font-size: 18px;
}

.specs,
.info-grid,
.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.specs div,
.info-grid > div,
.metric-grid > div {
    padding: 14px;
}

.specs div {
    border: 1px solid rgba(215, 179, 106, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(215, 179, 106, 0.05), transparent),
        var(--surface);
}

dt,
.info-grid span,
.metric-grid span {
    color: var(--muted);
    font-size: 13px;
}

dd {
    margin: 4px 0 0;
    font-weight: 700;
}

.purchase-panel strong {
    font-size: 30px;
}

.purchase-panel {
    border-color: rgba(215, 179, 106, 0.2);
    background:
        linear-gradient(135deg, rgba(72, 185, 167, 0.08), transparent 42%),
        var(--surface);
}

.purchase-panel > span {
    color: var(--muted);
}

.page-section,
.auth-panel {
    display: grid;
    gap: 18px;
}

.cart-list {
    display: grid;
    gap: 12px;
}

.cart-row {
    display: grid;
    grid-template-columns: 1fr 230px;
    gap: 16px;
    align-items: center;
    padding: 16px;
}

.cart-row p:not(.eyebrow) {
    color: var(--muted);
    margin-bottom: 0;
}

.cart-controls {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.cart-controls strong {
    font-size: 22px;
}

.cart-summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.cart-summary strong,
.summary-total strong {
    font-size: 24px;
}

.empty-state {
    padding: 28px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
}

.order-summary {
    position: sticky;
    top: 34px;
}

.summary-total {
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.document-panel,
.payment-history {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(215, 179, 106, 0.06), transparent 42%),
        var(--surface);
    box-shadow: var(--shadow);
}

.payment-history {
    overflow-x: auto;
}

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

.document-card {
    display: grid;
    gap: 10px;
    min-height: 82px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.document-card:hover {
    border-color: rgba(72, 185, 167, 0.5);
    background: rgba(72, 185, 167, 0.08);
    transform: translateY(-2px);
}

.document-main-link {
    display: grid;
    width: 100%;
    min-height: 56px;
    align-content: space-between;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

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

.document-card strong {
    color: var(--champagne);
    font-size: 18px;
}

.document-format-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.document-format-links a {
    padding: 4px 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.document-format-links a:hover {
    border-color: rgba(72, 185, 167, 0.5);
    color: var(--accent);
}

.pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    width: auto;
    max-width: none;
    height: auto;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.72);
    color: var(--ink);
    backdrop-filter: blur(6px);
}

.pdf-modal[hidden] {
    display: none !important;
}

.pdf-modal-shell {
    display: grid;
    grid-template-rows: auto 1fr;
    width: min(1160px, calc(100vw - 34px));
    height: min(900px, calc(100vh - 34px));
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-deep);
}

.pdf-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(90deg, rgba(72, 185, 167, 0.08), transparent 52%),
        var(--surface-2);
}

.pdf-modal-head h2 {
    margin: 2px 0 0;
}

.pdf-modal-frame {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #f7f3ea;
}

body.modal-open {
    overflow: hidden;
}

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

.payment-terminal > div {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid rgba(215, 179, 106, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
}

.payment-terminal span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.payment-terminal strong {
    font-size: 20px;
}

.office-page {
    gap: 16px;
}

.office-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(72, 185, 167, 0.07), transparent 46%),
        var(--surface);
}

.office-nav a {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.office-nav a:hover {
    border-color: rgba(215, 179, 106, 0.28);
    background: rgba(215, 179, 106, 0.07);
    color: var(--ink);
}

.office-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.office-periods a {
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.office-periods a:hover,
.office-periods a.is-active {
    border-color: rgba(72, 185, 167, 0.55);
    background: rgba(72, 185, 167, 0.13);
    color: var(--ink);
}

.office-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.office-panel {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(215, 179, 106, 0.055), transparent 42%),
        var(--surface);
    box-shadow: var(--shadow);
}

.office-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.office-panel-head h2 {
    font-size: 18px;
}

.office-panel-head span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.office-panel-head a {
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
}

.office-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(150px, 1fr)) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.office-filter-bar-compact {
    grid-template-columns: minmax(220px, 420px) auto auto 1fr;
}

.office-filter-bar label,
.office-stock-form label {
    gap: 4px;
    font-size: 12px;
}

.office-filter-bar input,
.office-filter-bar select,
.office-stock-form input,
.office-form input,
.office-form select,
.office-form textarea {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 13px;
}

.office-table-wrap {
    overflow-x: auto;
}

.office-table {
    min-width: 760px;
}

.office-table a {
    color: var(--champagne);
    font-weight: 800;
}

.office-table span {
    color: var(--muted);
    font-size: 12px;
}

.office-catalog-table {
    min-width: 1080px;
}

.office-stock-form {
    display: grid;
    grid-template-columns: 74px 74px 64px auto;
    gap: 6px;
    align-items: end;
}

.office-stock-form .button {
    min-height: 36px;
    padding: 0 10px;
}

.office-row-actions,
.office-action-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.office-action-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.office-action-grid .button,
.office-action-grid form {
    width: 100%;
}

.office-form {
    display: grid;
    gap: 16px;
}

.office-form-section {
    display: grid;
    gap: 10px;
}

.office-form-section h2 {
    color: var(--champagne);
    font-size: 17px;
}

.office-form .helptext {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.office-check {
    display: flex;
    min-height: 36px;
    align-items: center;
    padding-top: 21px;
}

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

.office-access-grid .office-check {
    min-height: 52px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--ink);
    font-weight: 850;
}

.office-permission-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
    gap: 14px;
}

.office-permission-grid label {
    min-width: 0;
}

.office-permission-grid select {
    width: 100%;
    min-height: 190px;
    margin-top: 5px;
}

.office-input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
}

.office-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.office-tag-list span {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.office-role-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.office-role-grid > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.office-role-grid strong {
    color: var(--ink);
    font-size: 13px;
}

.office-role-grid span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.office-document-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.office-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.office-pagination span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.status-pill {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--ink);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.status-new,
.payment-waiting {
    border-color: rgba(215, 179, 106, 0.5);
    color: var(--champagne);
}

.status-confirmed,
.status-in_progress,
.payment-paid,
.payment-processing {
    border-color: rgba(72, 185, 167, 0.58);
    color: #7ee8d8;
}

.status-completed {
    border-color: rgba(144, 219, 132, 0.5);
    color: #abe49f;
}

.status-cancelled,
.payment-failed,
.payment-refunded {
    border-color: rgba(239, 107, 99, 0.58);
    color: #ff9a93;
}

.button.danger:hover {
    border-color: var(--danger);
    background: rgba(239, 107, 99, 0.12);
    color: #ff9a93;
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-grid strong {
    display: block;
    margin-top: 6px;
    font-size: 28px;
}

.analytics-bars {
    display: grid;
    gap: 9px;
}

.analytics-row {
    display: grid;
    grid-template-columns: 52px minmax(120px, 1fr) minmax(140px, auto);
    gap: 10px;
    align-items: center;
}

.analytics-row > span,
.analytics-row strong {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.analytics-row > div {
    position: relative;
    display: grid;
    gap: 3px;
    min-height: 16px;
}

.analytics-row i,
.analytics-row b {
    display: block;
    height: 6px;
    min-width: 2px;
    border-radius: 999px;
}

.analytics-row i {
    background: linear-gradient(90deg, rgba(215, 179, 106, 0.95), rgba(215, 179, 106, 0.25));
}

.analytics-row b {
    background: linear-gradient(90deg, rgba(72, 185, 167, 0.95), rgba(72, 185, 167, 0.24));
}

.web-funnel {
    display: grid;
    gap: 10px;
}

.web-funnel-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.9fr) minmax(120px, 1fr) 52px;
    gap: 10px;
    align-items: center;
}

.web-funnel-row span,
.web-funnel-row strong {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.web-funnel-row div {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
}

.web-funnel-row i {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--champagne));
}

.mini-bar {
    width: 96px;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
}

.mini-bar span {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--champagne));
}

.web-dimension-table {
    min-width: 560px;
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.report-grid section {
    display: grid;
    gap: 12px;
    min-width: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
}

tr:last-child td {
    border-bottom: 0;
}

@keyframes card-reveal {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes filter-open {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes skeleton-shimmer {
    to {
        transform: translateX(110%);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .catalog-skeleton-card::before,
    .product-image.is-loading::before,
    .catalog-autoload-sentinel span::before {
        animation: none;
        transform: none;
    }

    .product-grid,
    .product-image img[data-lazy-image] {
        transition: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .filter-panel[open] .filter-form {
        animation: filter-open 180ms ease both;
    }

    .product-card {
        animation: card-reveal 520ms ease both;
    }

    .product-card:nth-child(2) {
        animation-delay: 45ms;
    }

    .product-card:nth-child(3) {
        animation-delay: 90ms;
    }

    .product-card:nth-child(4) {
        animation-delay: 135ms;
    }

    .product-card:nth-child(5) {
        animation-delay: 180ms;
    }

    .product-card:nth-child(n + 6) {
        animation-delay: 220ms;
    }
}

@media (max-width: 1050px) {
    .catalog-layout,
    .product-detail,
    .checkout-layout,
    .report-grid,
    .office-grid,
    .office-action-grid,
    .office-permission-grid {
        grid-template-columns: 1fr;
    }

    .office-filter-bar,
    .office-filter-bar-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .office-role-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters,
    .order-summary {
        position: static;
    }

    .product-grid,
    .metric-grid,
    .document-grid,
    .payment-choice-grid,
    .payment-choice-list > div,
    .payment-choice-list ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-detail {
        grid-template-columns: 1fr;
    }

    .detail-media {
        height: 460px;
        min-height: 0;
    }

}

@media (min-width: 681px) and (max-width: 1050px) {
    .filter-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: end;
        gap: 8px;
        padding: 10px 12px 12px;
    }

    .filter-form > label:first-child,
    .price-row {
        grid-column: auto;
    }

    .filter-form label {
        gap: 4px;
        font-size: 12px;
    }

    .filter-form input,
    .filter-form select {
        min-height: 34px;
        padding: 6px 9px;
        font-size: 13px;
    }

    .check-row {
        min-height: 34px;
        align-self: end;
    }
}

@media (max-width: 680px) {
    main,
    .site-header,
    .messages {
        padding-left: 16px;
        padding-right: 16px;
    }

    main {
        padding-top: 22px;
        padding-bottom: 30px;
    }

    .site-header {
        align-items: flex-start;
        flex-direction: column;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .brand-logo {
        width: 132px;
    }

    .product-grid,
    .specs,
    .info-grid,
    .metric-grid,
    .field-grid,
    .choice-grid,
    .choice-list > div,
    .choice-list ul,
    .document-grid,
    .payment-terminal,
    .cart-row,
    .office-filter-bar,
    .office-filter-bar-compact,
    .office-access-grid,
    .office-role-grid {
        grid-template-columns: 1fr;
    }

    .office-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .office-panel {
        padding: 12px;
    }

    .office-stock-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .analytics-row strong {
        grid-column: 2;
    }

    .web-funnel-row {
        grid-template-columns: minmax(0, 1fr) 48px;
    }

    .web-funnel-row div {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .mini-bar {
        width: 72px;
    }

    .field-wide {
        grid-column: auto;
    }

    .cart-controls {
        justify-items: stretch;
    }

    .cart-summary,
    .section-head,
    .pdf-modal-head {
        align-items: stretch;
        flex-direction: column;
    }

    .pdf-modal {
        width: auto;
        height: auto;
    }

    .pdf-modal-shell {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
    }

    .add-cart-form,
    .price-row {
        grid-template-columns: 1fr;
    }

    .filter-panel > summary {
        min-height: 40px;
        padding: 0 12px;
    }

    .filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 10px 12px 12px;
    }

    .filter-form > label:first-child,
    .filter-form .price-row {
        grid-column: 1 / -1;
    }

    .filter-form label {
        gap: 4px;
        font-size: 12px;
    }

    .filter-form input,
    .filter-form select {
        min-height: 34px;
        padding: 6px 9px;
        font-size: 13px;
    }

    .filter-form .price-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-media {
        height: 330px;
    }
}
