/* Zdjęcia na kafelkach, przycisk 3D, odliczanie po ofercie i okno podglądu 3D (assets/js/viewer3d.js). */

/* ---------- kafelek ---------- */
.media { cursor: zoom-in; }
/* zdjęcia są przycięte do laptopa (proporcje ok. 6:5) – kafelek ze zdjęciem jest wyższy, żeby był widoczny cały */
/* cały laptop widoczny (contain); tło w kolorze ściany ze zdjęć, więc wąskie pasy po bokach nie rzucają się w oczy */
.card .media.has-photo { aspect-ratio: 5 / 4; background: linear-gradient(180deg, #dcd8d1 0%, #d3cfc8 100%); }
.card .media.has-photo img { object-fit: contain; object-position: center; }
.card:hover .media.has-photo img { transform: scale(1.03); }
.view3d { position: absolute; right: 12px; bottom: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; border: 0; cursor: pointer;
  font: 700 12px/1 Poppins, system-ui, sans-serif; letter-spacing: .04em; color: #fff; padding: 7px 11px; border-radius: var(--pill);
  background: rgba(16, 7, 7, .78); backdrop-filter: blur(6px); box-shadow: 0 6px 16px rgba(0, 0, 0, .25); transition: transform .2s, background .2s; }
.view3d svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.view3d:hover, .view3d:focus-visible { background: var(--brand); transform: translateY(-2px); }

/* odliczanie 3 s po ofercie */
form.bid button.cooling { opacity: .65; cursor: not-allowed; filter: saturate(.4); }

/* ---------- okno ---------- */
.view-dlg { width: min(860px, calc(100% - 32px)); overflow: hidden; }
.v-wrap { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px 18px; }
.v-head { display: flex; align-items: center; gap: 12px; }
.v-head > div:first-child { flex: 1; min-width: 0; }
.v-head h2 { margin: 4px 0 0; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-close svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.v-tabs { display: inline-flex; background: var(--soft); border-radius: var(--pill); padding: 3px; }
.v-tabs[hidden] { display: none; }
.v-tabs button { border: 0; background: none; font: 600 13px Poppins, system-ui, sans-serif; color: var(--ink-2); padding: 6px 14px; border-radius: var(--pill); cursor: pointer; }
.v-tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.v-body { position: relative; }
.v-stage { position: relative; height: min(58vh, 460px); border-radius: 20px; overflow: hidden; perspective: 1500px; perspective-origin: 50% 35%;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; outline: none;
  background: radial-gradient(ellipse at 50% 40%, #3a2c22 0%, #1a1310 55%, #0d0907 100%); }
.v-stage:focus-visible { box-shadow: inset 0 0 0 3px var(--brand); }
.v-stage.grabbing { cursor: grabbing; }
.v-rig { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }
.v-help { position: absolute; left: 0; right: 0; bottom: 10px; margin: 0; text-align: center; font-size: 12px; color: rgba(255, 255, 255, .55); pointer-events: none; }
.v-photo { display: none; height: min(58vh, 460px); border-radius: 20px; overflow: hidden; background: var(--soft); }
.v-photo img { width: 100%; height: 100%; object-fit: contain; }
.view-dlg.show-photo .v-stage { display: none; }
.view-dlg.show-photo .v-photo { display: block; }
.view-dlg.show-photo .v-controls { visibility: hidden; }
.v-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.v-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.v-lid { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.v-lid input { accent-color: var(--brand); width: 150px; }
.v-note { margin: 0; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  .v-wrap { padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); }
  .v-stage, .v-photo { height: 52dvh; }
  .v-head h2 { font-size: 16px; }
  .v-lid input { width: 120px; }
}

/* ---------- model 3D ---------- */
.lap { --body: #2b2d31; --body-2: #232528; --deck: #27292d; --key: #141517; --key-top: #1d1f22; --legend: transparent;
  --screen-bezel: #0c0c0d; --edge: #1b1c1f; --pad: #222427; --pad-line: transparent;
  position: absolute; transform-style: preserve-3d; }
.lap .base, .lap .lid { position: absolute; transform-style: preserve-3d; }
.lap .lid { transform-origin: 0 0; }
.lap .f { position: absolute; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.lap .floor { backface-visibility: visible; -webkit-backface-visibility: visible; background: radial-gradient(ellipse at center, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .25) 35%, transparent 65%); }

/* podstawa */
.lap .b-top { background: var(--deck); border-radius: 6px 6px 10px 10px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), inset 0 -3px 0 rgba(255, 255, 255, .06); }
.lap .b-bottom { background: var(--body-2); border-radius: 8px; }
.lap .b-bottom .feet { position: absolute; inset: 14px 22px; border-top: 5px solid #0a0a0a; border-bottom: 5px solid #0a0a0a; border-radius: 4px; opacity: .8; }
.lap .b-front, .lap .b-back, .lap .b-left, .lap .b-right { background: linear-gradient(180deg, var(--body) 0%, var(--edge) 100%); }
.lap .b-front .notch { position: absolute; left: 50%; top: 0; width: 60px; height: 4px; margin-left: -30px; background: rgba(0, 0, 0, .45); border-radius: 0 0 4px 4px; }
.lap .b-back .vents { position: absolute; inset: 4px 60px; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .6) 0 3px, transparent 3px 7px); border-radius: 2px; }
.lap .ports { position: absolute; left: 30px; top: 50%; width: 110px; height: 6px; margin-top: -3px;
  background: linear-gradient(90deg, #050505 0 14px, transparent 14px 22px, #050505 22px 44px, transparent 44px 52px, #050505 52px 68px, transparent 68px 76px, #050505 76px 84px, transparent 84px); }
.lap .ports.r { left: auto; right: 40px; width: 70px; }
.deck-hinge { position: absolute; left: 22%; right: 22%; top: 0; height: 12px; background: linear-gradient(180deg, #0e0f10, var(--body-2)); border-radius: 0 0 6px 6px; }
.deck-power { position: absolute; right: 14px; top: 16px; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .35); }
.deck-sticker { position: absolute; right: 18px; bottom: 12px; width: 22px; height: 26px; border-radius: 3px; background: linear-gradient(160deg, #1d6fd1, #0b3d8c); color: #fff; font: 700 4.4px/1.3 Arial, sans-serif; text-align: center; padding-top: 5px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .5) inset; }
.deck-sticker b { font-size: 4px; }

.kb { position: absolute; left: 6%; right: 6%; top: 24px; height: 41%; display: flex; flex-direction: column; gap: 2.4px; padding: 4px; border-radius: 4px; background: rgba(0, 0, 0, .28); }
.kb-row { display: flex; gap: 6px; min-height: 0; }
.kb-main, .kb-num { display: flex; gap: 2.4px; }
.kb-main { flex: 15.4; }
.kb-num { flex: 4.2; }
.kb i { display: block; min-width: 0; border-radius: 2px; background: linear-gradient(180deg, var(--key-top), var(--key)); box-shadow: 0 1px 0 rgba(0, 0, 0, .6), inset 0 0 0 .5px rgba(255, 255, 255, .06); position: relative; }
.kb i::after { content: ""; position: absolute; left: 28%; top: 26%; width: 22%; height: 22%; border-radius: 1px; background: var(--legend); }
.kb .k-space::after { display: none; }
.pad { position: absolute; left: 50%; bottom: 16px; width: 31%; height: 28%; margin-left: -15.5%; border-radius: 6px; background: var(--pad); box-shadow: inset 0 0 0 1.5px var(--pad-line), inset 0 1px 2px rgba(0, 0, 0, .5); }

/* pokrywa */
.lap .l-front { background: var(--screen-bezel); border-radius: 8px 8px 2px 2px; }
.lap .l-back { background: linear-gradient(160deg, var(--body) 0%, var(--body-2) 100%); border-radius: 8px 8px 2px 2px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.lap .l-top, .lap .l-side { background: var(--edge); }
.bezel { position: absolute; inset: 0; }
.bezel .cam { position: absolute; left: 50%; top: 6px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #222; box-shadow: 0 0 0 1px #333; }
.bezel-brand { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font: 700 8px/1 Poppins, Arial, sans-serif; letter-spacing: .12em; color: rgba(255, 255, 255, .55); }
.scr { position: absolute; left: 12px; right: 12px; top: 16px; bottom: 18px; border-radius: 2px; overflow: hidden;
  background: radial-gradient(circle at 20% 20%, rgba(255, 175, 69, .9), transparent 55%), radial-gradient(circle at 85% 85%, rgba(255, 94, 0, .85), transparent 55%), linear-gradient(135deg, #2a140a, #120806); }
.scr::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .04) 35%, transparent 36%); pointer-events: none; }
.scr-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #fff; text-align: center; padding: 10px; font-family: Poppins, system-ui, sans-serif; }
.scr-in small { font-size: 9px; font-weight: 700; letter-spacing: .1em; padding: 2px 8px; border-radius: 99px; background: rgba(0, 0, 0, .35); }
.scr-in b { font-size: 17px; font-weight: 800; line-height: 1.15; text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.scr-in span { font-size: 9.5px; opacity: .9; }
.cover-logo { position: absolute; inset: 0; display: grid; place-items: center; }
.cover-logo b { font: 800 22px/1 Poppins, Arial, sans-serif; letter-spacing: .14em; color: rgba(255, 255, 255, .55); }

/* Dell Inspiron 3567 / inny Dell – matowy czarny */
.theme-dell { --body: #2a2b2e; --body-2: #1f2023; --deck: #25262a; --edge: #18191b; }
.theme-dell .b-top { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 4px), var(--deck); }
.theme-dell .cover-logo b, .theme-dell3n .cover-logo b, .theme-dell5 .cover-logo b { width: 64px; height: 64px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .5); display: grid; place-items: center; font-size: 15px; letter-spacing: .06em; }
/* Dell Inspiron 3581 – faktura „carbon” */
.theme-dell3n { --body: #2c2d31; --body-2: #212226; --deck: #2a2b2f; --edge: #1a1b1e; }
.theme-dell3n .b-top { background: repeating-linear-gradient(45deg, rgba(0, 0, 0, .22) 0 1.5px, transparent 1.5px 3px), repeating-linear-gradient(-45deg, rgba(255, 255, 255, .03) 0 1.5px, transparent 1.5px 3px), var(--deck); }
/* Dell Inspiron 5570 – szczotkowany */
.theme-dell5 { --body: #2e3034; --body-2: #232428; --deck: #222428; --edge: #1a1b1e; }
.theme-dell5 .b-top { background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px), linear-gradient(160deg, #2b2d31, #1d1e21); }
/* ASUS ROG Strix GL553V – szczotkowany czarny, czerwone akcenty */
.theme-rog { --body: #232325; --body-2: #19191b; --deck: #1e1e20; --edge: #141415; --pad-line: #d9262b; --legend: rgba(255, 255, 255, .5); }
.theme-rog .b-top, .theme-rog .l-back { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px), linear-gradient(160deg, #262628, #161617); }
.theme-rog .kb .k-wasd { background: linear-gradient(180deg, #5a5a5e, #3a3a3e); }
.theme-rog .cover-logo b { color: #e8333a; font-size: 18px; }
.theme-rog .rog-eye { position: absolute; left: 50%; top: 50%; width: 70px; height: 30px; margin: -46px 0 0 -35px; border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%; border: 3px solid #e8333a; border-bottom-color: transparent; transform: rotate(-12deg); opacity: .9; }
.deck-strix { position: absolute; left: 30px; top: 12px; font: italic 800 8px/1 Poppins, Arial, sans-serif; letter-spacing: .1em; color: rgba(255, 255, 255, .3); }
.theme-rog .bezel-brand { font-size: 7px; letter-spacing: .2em; }
/* ASUS TUF FX504G – czarny, czerwone podświetlenie i krawędź pokrywy */
.theme-tuf { --body: #222224; --body-2: #19191a; --deck: #1f1f21; --edge: #b3171d; --legend: #ff3b30; --pad-line: rgba(255, 59, 48, .45); }
.theme-tuf .b-top { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 3px), linear-gradient(160deg, #252527, #171718); }
.theme-tuf .b-front, .theme-tuf .b-back, .theme-tuf .b-left, .theme-tuf .b-right { background: linear-gradient(180deg, #232325, #111112); }
.theme-tuf .kb i { box-shadow: 0 1px 0 rgba(0, 0, 0, .6), 0 0 3px rgba(255, 40, 30, .35), inset 0 0 0 .5px rgba(255, 60, 50, .35); }
.theme-tuf .kb .k-wasd { box-shadow: 0 0 0 1px #ff3b30, 0 0 5px rgba(255, 59, 48, .7); }
.deck-vent { position: absolute; left: 24%; right: 24%; top: 15px; height: 6px; background: repeating-linear-gradient(100deg, rgba(0, 0, 0, .7) 0 2px, transparent 2px 5px); }
.theme-tuf .l-back { background: linear-gradient(135deg, #2a2a2c 0 40%, #1d1d1f 40% 60%, #262628 60%); }
.theme-tuf .cover-logo b { color: rgba(255, 255, 255, .7); font-size: 16px; }
@media (prefers-reduced-motion: reduce) { .view3d { transition: none; } }

/* model oklejony zdjęciami (tekstury z tools/tekstury-3d.ps1) */
.lap .tex { position: absolute; inset: 0; background-size: 100% 100%; background-repeat: no-repeat; }
.lap.has-tex .b-top { box-shadow: none; border-radius: 4px 4px 9px 9px; }
.lap.has-tex .l-front { border-radius: 6px 6px 2px 2px; }
.lap .tex-gloss { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, rgba(255, 255, 255, .07) 0%, rgba(255, 255, 255, .02) 38%, transparent 39%); }
