:root {
    color-scheme: light;
    --color-ink: #1f2b3d;
    --color-muted: #64748b;
    --color-brand: #174d82;
    --color-brand-strong: #103c68;
    --color-brand-soft: #eaf3fb;
    --color-surface: #fff;
    --color-page: #f4f7fb;
    --color-line: #d9e2ec;
    --color-line-strong: #aab8c8;
    --color-success: #17653b;
    --color-success-soft: #e6f5ec;
    --color-danger: #a12d2d;
    --color-danger-soft: #fff0f0;
    --shadow-card: 0 .75rem 2rem rgba(31, 52, 78, .08);
    --radius-small: .65rem;
    --radius-medium: .9rem;
    --radius-large: 1.15rem;
}

* { box-sizing: border-box; }
html { min-width: 20rem; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; color: var(--color-ink); background: var(--color-page); font: 17px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
img { max-width: 100%; }
a { color: var(--color-brand); text-underline-offset: .18em; }
a:hover { color: var(--color-brand-strong); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgba(48, 112, 180, .28); outline-offset: 3px; }
.skip-link { position: fixed; top: .75rem; left: .75rem; z-index: 20; padding: .65rem .9rem; color: #fff; background: var(--color-brand-strong); border-radius: var(--radius-small); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.site-header { position: sticky; top: 0; z-index: 10; padding: .9rem max(1.25rem, calc((100vw - 72rem) / 2)); background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--color-line); backdrop-filter: blur(12px); }
.site-header-inner { display: flex; gap: 2rem; align-items: center; justify-content: space-between; max-width: 72rem; margin: 0 auto; }
.brand { color: var(--color-brand-strong); font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; text-decoration: none; }
.site-nav { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.site-nav a { padding: .45rem .7rem; color: var(--color-brand); border-radius: .5rem; font-size: .95rem; font-weight: 700; text-decoration: none; }
.site-nav a:hover, .site-nav a.is-active { color: var(--color-brand-strong); background: var(--color-brand-soft); }
.page-shell { width: 100%; max-width: 72rem; margin: clamp(2rem, 6vh, 4.5rem) auto; padding: 0 1.25rem 3rem; }
.card { padding: clamp(1.5rem, 4vw, 3rem); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-large); box-shadow: var(--shadow-card); }
.card-narrow { max-width: 32rem; margin: 0 auto; }
.hero-card { overflow: hidden; position: relative; }
.hero-card::after { position: absolute; right: -5rem; bottom: -8rem; width: 18rem; height: 18rem; content: ""; background: radial-gradient(circle, rgba(62, 134, 204, .18), transparent 68%); pointer-events: none; }
.eyebrow { margin: 0 0 .5rem; color: var(--color-brand); font-size: .8rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
h1 { margin: 0 0 .65rem; font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1.12; letter-spacing: -.035em; overflow-wrap: anywhere; }
h2 { margin: 1.5rem 0 1rem; font-size: 1.25rem; line-height: 1.25; }
p { overflow-wrap: anywhere; }
label { display: block; margin: 1rem 0 .35rem; font-weight: 700; }
input, select { width: 100%; min-height: 3rem; padding: .7rem .85rem; color: inherit; background: #fff; border: 1px solid var(--color-line-strong); border-radius: var(--radius-small); font: inherit; }
input:hover, select:hover { border-color: #7f91a5; }
input:focus, select:focus { border-color: #3070b4; }
.check-row { display: flex; gap: .6rem; align-items: center; font-weight: 400; }
.check-row input { width: auto; min-height: auto; }
.button { display: inline-flex; min-height: 2.85rem; margin-top: 1.25rem; padding: .68rem 1.1rem; align-items: center; justify-content: center; color: #fff; background: #2869aa; border: 1px solid #2869aa; border-radius: var(--radius-small); font: inherit; font-weight: 750; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; }
.button:hover { color: #fff; background: #1f568d; border-color: #1f568d; }
.button:disabled { opacity: .65; cursor: wait; }
.button-secondary { color: var(--color-ink); background: #eef2f7; border-color: #d7e0ea; }
.button-secondary:hover { color: var(--color-ink); background: #e2e9f1; border-color: #c8d3df; }
.button-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.heading-row { display: flex; gap: 2rem; align-items: flex-start; justify-content: space-between; }
.heading-row .button { margin-top: 0; }
.account-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr); gap: 2rem; }
.summary { align-self: start; margin-top: 1.5rem; padding: 1.25rem; background: #f0f5fb; border-radius: .75rem; }
.summary h2 { margin-top: 0; }
.discount { margin: 0; color: var(--color-brand-strong); font-size: 2.25rem; font-weight: 800; }
.password-form { max-width: 34rem; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--color-line); }
.notice { margin-bottom: 1rem; padding: .8rem 1rem; border-radius: var(--radius-small); background: #e9eef5; }
.notice-success { background: var(--color-success-soft); }
.notice-error { background: var(--color-danger-soft); }

.catalog-heading { display: flex; gap: 1.5rem; align-items: end; justify-content: space-between; margin-bottom: 1.5rem; }
.catalog-heading-copy { max-width: 42rem; }
.catalog-heading p:last-child { margin-bottom: 0; color: var(--color-muted); }
.catalog-filter-panel { margin-bottom: 1.5rem; }
.catalog-filter-toggle { display: none; }
.catalog-filters { display: grid; grid-template-columns: minmax(15rem, 2fr) repeat(3, minmax(10rem, 1fr)); gap: 1rem; align-items: end; margin: 0; padding: 1.25rem; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-medium); box-shadow: 0 .4rem 1.25rem rgba(31, 52, 78, .04); }
.catalog-filter label { margin-top: 0; }
.catalog-filter-hint { display: block; margin-top: .4rem; color: var(--color-muted); font-size: .8rem; }
.catalog-filter-actions { display: flex; gap: .75rem; grid-column: 1 / -1; flex-wrap: wrap; }
.catalog-filter-actions .button { margin-top: 0; }
.catalog-results { display: flex; gap: 1rem; align-items: baseline; justify-content: space-between; margin: 0 0 1rem; }
.catalog-results-count { margin: 0; color: var(--color-muted); font-size: .95rem; }
.catalog-loading, .catalog-state { padding: clamp(1.25rem, 4vw, 2rem); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-medium); }
.catalog-loading { display: flex; gap: .8rem; align-items: center; color: var(--color-brand-strong); }
.catalog-loading::before { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; content: ""; border: 2px solid #b8cee2; border-top-color: var(--color-brand); border-radius: 50%; animation: catalog-spin .8s linear infinite; }
.catalog-loading[hidden] { display: none; }
.catalog-state { text-align: center; }
.catalog-state h2 { margin: 0 0 .45rem; }
.catalog-state p { max-width: 34rem; margin: 0 auto; color: var(--color-muted); }
.catalog-state .button { margin-top: 1rem; }
.catalog-state-error { border-color: #e2a2a2; background: var(--color-danger-soft); }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.catalog-card { display: flex; min-width: 0; min-height: 100%; overflow: hidden; flex-direction: column; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-medium); box-shadow: 0 .3rem 1rem rgba(31, 52, 78, .04); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.catalog-card:hover { border-color: #b7c7d8; box-shadow: 0 .8rem 1.7rem rgba(31, 52, 78, .1); transform: translateY(-2px); }
.catalog-card-image { display: grid; min-height: 13rem; padding: 1rem; place-items: center; background: linear-gradient(145deg, #f5f7fa, #edf2f7); }
.catalog-card-image img { display: block; width: 100%; height: 12rem; object-fit: contain; }
.catalog-card-body { display: flex; min-width: 0; padding: 1.1rem; flex: 1; flex-direction: column; }
.catalog-card h2 { margin: 0 0 .5rem; font-size: 1.12rem; }
.catalog-card h2 a { color: var(--color-ink); text-decoration: none; }
.catalog-card-meta { min-height: 3.25rem; }
.catalog-card-footer { display: flex; gap: .65rem; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 1rem; border-top: 1px solid #edf1f5; }
.product-image-placeholder { display: grid; min-height: 10rem; padding: 1rem; color: var(--color-muted); place-items: center; text-align: center; }
.product-image-placeholder::before { display: block; width: 3rem; height: 2.4rem; margin: 0 auto .7rem; content: ""; border: 2px solid #bcc8d5; border-radius: .4rem; background: linear-gradient(145deg, transparent 48%, #d7e0e8 49% 62%, transparent 63%); }
.product-article, .product-brand, .muted { color: var(--color-muted); }
.product-article, .product-brand { margin: .2rem 0; font-size: .9rem; }
.product-price-block { min-width: 0; }
.product-price-label { display: block; margin-bottom: .1rem; color: var(--color-muted); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.product-price { margin: 0; color: var(--color-brand-strong); font-size: 1.3rem; font-weight: 850; line-height: 1.25; }
.product-availability { display: inline-flex; margin: 0; padding: .35rem .55rem; align-items: center; color: var(--color-success); background: var(--color-success-soft); border-radius: 999px; font-size: .82rem; font-weight: 750; line-height: 1.2; text-align: right; }
.catalog-pagination { margin-top: 2rem; }
.pagination { display: flex; gap: .35rem; margin: 0; padding: 0; flex-wrap: wrap; list-style: none; }
.pagination a, .pagination span { display: inline-flex; min-width: 2.55rem; min-height: 2.55rem; padding: .4rem .65rem; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--color-line); border-radius: .5rem; text-decoration: none; }
.pagination .active span { color: #fff; background: var(--color-brand); border-color: var(--color-brand); }
.pagination .disabled span { color: #94a3b8; background: #f4f6f8; }

.catalog-back { display: inline-flex; margin-bottom: 1.25rem; align-items: center; font-weight: 700; text-decoration: none; }
.product-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(18rem, .85fr); gap: 1.5rem; align-items: start; }
.product-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.product-gallery-item { display: grid; min-width: 0; min-height: 14rem; margin: 0; padding: .75rem; place-items: center; background: #fff; border: 1px solid var(--color-line); border-radius: var(--radius-medium); }
.product-gallery-item:first-child:nth-last-child(n+3) { grid-column: 1 / -1; min-height: 24rem; }
.product-gallery img { width: 100%; max-height: 24rem; object-fit: contain; }
.product-gallery > .product-image-placeholder { min-height: 22rem; background: #fff; border: 1px solid var(--color-line); border-radius: var(--radius-medium); }
.product-summary, .product-details { padding: clamp(1.25rem, 3vw, 1.75rem); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-medium); }
.product-summary { position: sticky; top: 5.5rem; }
.product-summary h1 { font-size: clamp(1.8rem, 4vw, 2.65rem); }
.product-meta { display: grid; gap: .65rem; margin: 1.2rem 0 1.5rem; }
.product-meta div { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: .75rem; }
.product-meta dt { color: var(--color-muted); }
.product-meta dd { min-width: 0; margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.product-summary-price { margin: 0; padding: 1rem 0; border-top: 1px solid #e9eef4; border-bottom: 1px solid #e9eef4; }
.product-summary-price .product-price { font-size: clamp(1.45rem, 4vw, 1.9rem); }
.product-summary .product-availability { margin-top: 1rem; }
.product-details { margin-top: 1.5rem; }
.product-details h2:first-child { margin-top: 0; }
.product-description { white-space: pre-line; }
.product-properties { margin: 0; }
.product-properties div { display: grid; grid-template-columns: minmax(10rem, 1fr) 2fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid #e5eaf0; }
.product-properties div:last-child { border-bottom: 0; }
.product-properties dt { font-weight: 750; overflow-wrap: anywhere; }
.product-properties dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }

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

@media (max-width: 900px) {
    .product-layout { grid-template-columns: 1fr; }
    .product-summary { position: static; }
}

@media (max-width: 700px) {
    body { font-size: 16px; }
    .site-header { position: static; padding: .8rem 1rem; }
    .site-header-inner { gap: .75rem; align-items: center; }
    .site-nav { justify-content: flex-end; }
    .site-nav a { padding: .4rem .5rem; font-size: .86rem; }
    .page-shell { margin-top: 1.5rem; padding: 0 1rem 2rem; }
    .card { padding: 1.25rem; }
    .heading-row, .catalog-heading { display: block; }
    .heading-row .button { margin-top: 1rem; }
    .account-grid { grid-template-columns: 1fr; }
    .catalog-filter-panel { overflow: hidden; background: #fff; border: 1px solid var(--color-line); border-radius: var(--radius-medium); }
    .catalog-filter-toggle { display: flex; min-height: 3.2rem; padding: .8rem 1rem; align-items: center; justify-content: space-between; color: var(--color-brand-strong); font-weight: 800; cursor: pointer; list-style: none; }
    .catalog-filter-toggle::-webkit-details-marker { display: none; }
    .catalog-filter-toggle::after { content: "+"; font-size: 1.4rem; font-weight: 500; line-height: 1; }
    .catalog-filter-panel[open] .catalog-filter-toggle::after { content: "−"; }
    .catalog-filter-panel:not([open]) > .catalog-filters { display: none; }
    .catalog-filters { grid-template-columns: 1fr; padding: 0 1rem 1rem; border: 0; border-top: 1px solid var(--color-line); border-radius: 0; box-shadow: none; }
    .catalog-filter-search { padding-top: .9rem; }
    .catalog-filter-actions { display: grid; grid-template-columns: 1fr; }
    .catalog-filter-actions .button { width: 100%; }
    .catalog-results { display: block; }
    .catalog-grid { grid-template-columns: 1fr; }
    .catalog-card { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); }
    .catalog-card-image { min-height: 100%; padding: .65rem; }
    .catalog-card-image img { height: 7rem; }
    .catalog-card-image .product-image-placeholder { min-height: 7rem; padding: .35rem; font-size: .78rem; }
    .catalog-card-image .product-image-placeholder::before { width: 2rem; height: 1.6rem; margin-bottom: .35rem; }
    .catalog-card-body { padding: .9rem; }
    .catalog-card-meta { min-height: 0; }
    .catalog-card-footer { display: block; padding-top: .75rem; }
    .catalog-card-footer .product-availability { margin-top: .55rem; text-align: left; }
    .product-gallery { grid-template-columns: 1fr; }
    .product-gallery-item:first-child:nth-last-child(n+3) { grid-column: auto; min-height: 14rem; }
    .product-gallery > .product-image-placeholder { min-height: 15rem; }
    .product-properties div, .product-meta div { grid-template-columns: 1fr; gap: .2rem; }
    .product-meta div { padding-bottom: .6rem; border-bottom: 1px solid #edf1f5; }
    .button-row { display: grid; grid-template-columns: 1fr; }
    .button-row .button { width: 100%; }
}

@media (min-width: 701px) and (max-width: 1024px) {
    .catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .catalog-card { transition: none; }
    .catalog-loading::before { animation: none; }
}
