/* E-shop – bazinis stilius (šviesi/tamsi tema pagal sistemą). */
:root {
    --bg: #f7f7f5;
    --surface: #ffffff;
    --text: #1d1d1f;
    --muted: #6b6b70;
    --border: #e2e2de;
    --accent: #2f5bd3;
    --accent-text: #ffffff;
    --ok-bg: #e7f5ea;
    --ok-text: #1f6b33;
    --error-bg: #fbe9e9;
    --error-text: #9b1c1c;
    --radius: 10px;
    --wrap: 1120px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #141416;
        --surface: #1e1e21;
        --text: #ececee;
        --muted: #9a9aa2;
        --border: #313136;
        --accent: #7c9cff;
        --accent-text: #0f1220;
        --ok-bg: #173323;
        --ok-text: #9be2b0;
        --error-bg: #3a1a1a;
        --error-text: #f3a6a6;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 24px; padding-bottom: 48px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.main-nav { display: flex; gap: 16px; flex: 1; flex-wrap: wrap; }
.main-nav a, .lang-switch a { color: var(--text); text-decoration: none; }
.main-nav a:hover, .lang-switch a:hover { color: var(--accent); }
.main-nav a[aria-current] { color: var(--accent); font-weight: 600; }
.lang-switch { display: flex; gap: 4px; }
.lang-switch a { padding: 2px 8px; border-radius: 6px; font-size: .9rem; }
.lang-switch a[aria-current] { background: var(--accent); color: var(--accent-text); }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; padding: 20px 0; }

.hero { padding: 32px 0 16px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 8px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }

.types { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; }
.type-card, .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.type-card h2 { margin-top: 0; font-size: 1.2rem; }
.card { margin-bottom: 20px; }
.card h2 { margin-top: 0; font-size: 1.15rem; }

.button {
    display: inline-block; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); text-decoration: none; font: inherit; cursor: pointer;
}
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.button:hover { filter: brightness(1.05); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.flash-ok { background: var(--ok-bg); color: var(--ok-text); }
.flash-error { background: var(--error-bg); color: var(--error-text); }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.inline { display: inline; }

.error-page { text-align: center; padding: 48px 0; }
.error-code { font-size: 4rem; font-weight: 700; color: var(--muted); margin: 0; }

input, select, textarea {
    font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; max-width: 100%;
}
input:focus, select:focus, textarea:focus, .button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Katalogas ---------- */
.breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--muted); }
.filters { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-size: .92rem; }
.chip:hover { border-color: var(--accent); }
.chip[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chips-types .chip { font-size: .85rem; padding: 4px 10px; }
/* Produkto puslapis: kitos to paties modelio versijos */
.siblings { margin: 18px 0; }
.siblings h2 { font-size: 1rem; margin: 0 0 8px; }
.siblings ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.siblings a { display: grid; grid-template-columns: 56px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
    padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.siblings a:hover { border-color: var(--accent); }
.siblings img { grid-row: 1 / 3; width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.sibling-use { font-weight: 600; }
.sibling-title { grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sibling-price { grid-column: 3; grid-row: 1 / 3; font-weight: 600; color: var(--accent); }
/* Užsakymas: autorystės tekstas */
.attribution { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.attribution p { margin: 0 0 6px; }
.attribution-row { display: flex; gap: 6px; }
.attribution-text { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: .85rem; }
/* 3D paskirties tabai + paieška (_filters.php) */
.catalog-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-top: 6px; border-bottom: 1px solid var(--border); }
.use-tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.use-tab { padding: 8px 14px; border-bottom: 3px solid transparent; color: var(--text); text-decoration: none; font-weight: 600; margin-bottom: -1px; }
.use-tab:hover { border-bottom-color: var(--border); }
.use-tab[aria-current] { border-bottom-color: var(--accent); color: var(--accent); }
.use-count { font-weight: 400; font-size: .8em; color: var(--muted, #6b6b70); }
.catalog-search { display: flex; gap: 6px; margin: 0 0 8px auto; flex: 0 1 320px; }
.catalog-search input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.catalog-search .button { padding: 7px 14px; }
.search-summary { margin: 6px 0 0; }
@media (max-width: 600px) { .catalog-search { flex-basis: 100%; margin-left: 0; } }

.product-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card a { display: block; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.product-card a:hover { border-color: var(--accent); transform: translateY(-2px); }
.thumb { position: relative; aspect-ratio: 4 / 3; background: var(--border); display: flex; align-items: center; justify-content: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-placeholder { color: var(--muted); font-weight: 600; }
.type-badge { position: absolute; top: 8px; left: 8px; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; }
.type-badge.static { position: static; display: inline-block; background: var(--border); color: var(--text); }
.card-body { padding: 12px 14px 14px; }
.card-title { font-size: 1rem; margin: 0 0 4px; }
.price { margin: 0; font-weight: 600; color: var(--accent); }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pagination a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; color: var(--text); }
.pagination a[aria-current] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* ---------- Produktas ---------- */
.product { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; align-items: start; }
@media (max-width: 860px) { .product { grid-template-columns: 1fr; gap: 20px; } }
.product-info h1 { margin: 8px 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.product-preview { min-width: 0; }
.preview-empty { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; background: var(--border); border-radius: var(--radius); color: var(--muted); }
.gallery-main { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gallery-main img { display: block; width: 100%; height: auto; max-height: 75vh; object-fit: contain; background: var(--bg); }
.gallery-main figcaption { padding: 8px 12px; }
.gallery-thumbs, .gallery-strip { list-style: none; padding: 0; margin: 10px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; overflow: hidden; display: block; }
.gallery-thumbs button[aria-current] { border-color: var(--accent); }
.gallery-thumbs img, .gallery-strip img { width: 84px; height: 64px; object-fit: cover; display: block; border-radius: 6px; }
.viewer-frame { position: relative; }
.viewer-full { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; border-radius: 8px; font-size: 22px; line-height: 1;
    background: rgba(0, 0, 0, .45); color: #fff; cursor: pointer; }
.viewer-full:hover, .viewer-full:focus-visible { background: rgba(0, 0, 0, .7); }
/* height: auto – kitaip model-viewer numatytas 150 px aukštis nustelbia aspect-ratio */
.viewer-3d model-viewer { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; max-height: 80vh; background: radial-gradient(circle at 50% 40%, var(--surface), var(--bg)); border: 1px solid var(--border); border-radius: var(--radius); --poster-color: transparent; }
.viewer-progress { display: none; }
/* Atidėtas 3D krovimas (model-lazy.js): nuotrauka + „Žiūrėti 3D“ virš dar tuščio model-viewer */
.viewer-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius); pointer-events: none; z-index: 1; }
.viewer-load { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 2; padding: 10px 22px; border: 0; border-radius: 999px;
    background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.viewer-load:hover, .viewer-load:focus-visible { filter: brightness(1.1); }
.viewer-load:disabled { cursor: progress; opacity: .85; }
.viewer-frame .viewer-full { z-index: 3; }
.viewer-hint { margin: 6px 0 0; }
/* Slapukų sutikimas (consent.js): abu mygtukai vienodai matomi */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 900; max-width: 720px; margin: 0 auto; padding: 14px 16px;
    background: var(--surface); color: inherit; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: .92rem; }
.consent[hidden] { display: none; }
.consent p { margin: 0; flex: 1 1 320px; }
.consent-actions { display: flex; gap: 8px; }
.link-button { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.viewer-anims { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; }
.viewer-anims[hidden] { display: none; }
.viewer-anim-list { display: contents; }
.viewer-anim, .viewer-anim-toggle { padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: inherit; font: inherit; font-size: .9em; cursor: pointer; }
.viewer-anim:hover, .viewer-anim-toggle:hover { border-color: var(--accent); }
.viewer-anim[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.viewer-anim-toggle { margin-left: auto; }

.buy-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 16px 0; }
.buy-box fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.buy-box legend { font-weight: 600; margin-bottom: 8px; }
.variant { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "radio name price" ". desc desc"; gap: 2px 10px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.variant:has(input:checked) { border-color: var(--accent); }
.variant input { grid-area: radio; margin-top: 4px; }
.variant-name { grid-area: name; font-weight: 600; }
.variant-price { grid-area: price; font-weight: 700; }
.variant-desc { grid-area: desc; }
.buy-box .button { width: 100%; }
.buy-box .button[disabled] { opacity: .55; cursor: not-allowed; }

.attributes { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0; }
.attributes dt { color: var(--muted); }
.attributes dd { margin: 0; }
.included h2, .description h2, .product-links h2 { font-size: 1.1rem; }
.product-links ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.product-links a { display: inline-block; padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); text-decoration: none; }
.product-links a:hover { border-color: var(--accent); }
.included ul { padding-left: 18px; }
.included li { overflow-wrap: anywhere; }
.description { max-width: 75ch; margin-top: 32px; }

/* Peržiūros langas (lightbox.js) */
.lb-lock, .lb-lock body { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 1000; display: none; background: rgba(10, 10, 12, .95); color: #fff; }
.lb.open { display: block; }
.lb-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 56px 64px; box-sizing: border-box; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; user-select: none; touch-action: none; cursor: zoom-in; transform-origin: center; }
.lb-img.zoomed { cursor: grab; }
.lb-img.zoomed:active { cursor: grabbing; }
.lb-model { width: 100%; height: 100%; --poster-color: transparent; background: radial-gradient(circle at 50% 40%, #3a3a40, #141416); border-radius: var(--radius); }
.lb-btn { position: absolute; z-index: 1; border: 0; border-radius: 50%; width: 48px; height: 48px; font-size: 32px; line-height: 1;
    color: #fff; background: rgba(255, 255, 255, .14); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb-btn:hover, .lb-btn:focus-visible { background: rgba(255, 255, 255, .3); }
.lb-btn[hidden], .lb-count[hidden] { display: none; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; top: 18px; left: 0; right: 0; text-align: center; font-size: .9rem; opacity: .8; pointer-events: none; }
@media (max-width: 600px) {
    .lb-stage { padding: 56px 0; }
    .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
}
.gallery-zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }

/* Krepšelis, užsakymas, atsisiuntimai */
.flash-info { background: var(--surface); border: 1px solid var(--border); }
.cart-link { position: relative; }
.cart-count { display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-text);
    font-size: .8rem; text-align: center; font-weight: 700; }
.cart { display: grid; grid-template-columns: 1fr minmax(260px, 340px); gap: 24px; align-items: start; }
.cart-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cart-item { display: grid; grid-template-columns: 84px 1fr auto auto; gap: 12px; align-items: center; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.cart-thumb img { width: 84px; height: 64px; object-fit: cover; border-radius: 6px; display: block; }
.cart-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.cart-price { font-weight: 700; white-space: nowrap; }
.checkout-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.checkout-box .button { width: 100%; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.15rem; margin: 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; }
.check input { margin-top: 3px; }
.order-item h2 { font-size: 1.1rem; margin-top: 0; }
.download-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.download-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.download-list .file-name { font-weight: 600; overflow-wrap: anywhere; }
.download-list .file-sha { flex-basis: 100%; font-family: ui-monospace, Consolas, monospace; font-size: .72rem; overflow-wrap: anywhere; }
.download-help { margin-top: 16px; }
.button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
@media (max-width: 760px) {
    .cart { grid-template-columns: 1fr; }
    .cart-item { grid-template-columns: 64px 1fr auto; }
    .cart-thumb img { width: 64px; height: 48px; }
    .cart-item form { grid-column: 2 / -1; justify-self: start; }
}
.order-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }

/* Teisiniai puslapiai, poraštė, „atsiųsti nuorodas“ */
.legal { max-width: 75ch; }
.legal h2 { font-size: 1.15rem; margin-top: 1.6em; }
.legal li { margin-bottom: .4em; }
.footer-row { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-nav a { color: inherit; }
.resend-form { display: grid; gap: 10px; max-width: 420px; }
.resend-form input[type="email"] { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--surface); color: var(--text); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Stripe test režimas */
.test-banner { background: var(--error-bg); color: var(--error-text); text-align: center; font-size: .875rem; padding: 6px 16px; }
