/* Kalendarz adwentowy — wersja 2 (skrzynka z okienkami). Szablon: v2.php, skrypt: js/v2.js */
:root {
    --gold: #f2b705;
    --gold-l: #f6c731;
    --frame: rgba(242, 183, 5, .75);
    --txt: #e9e4da;
    --muted: #b9b1a3;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; color: var(--txt); background: #0d0a07;
    font: 400 14px/1.5 Poppins, system-ui, sans-serif;
}
/* Tło jako warstwa fixed (background-attachment:fixed nie działa na iOS) */
body::before {
    content: ''; position: fixed; inset: 0; z-index: -2;
    background: #0d0a07 url(../img/v2/tlo.jpg) center top / cover no-repeat;
}
#snow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.v2-page { position: relative; z-index: 1; max-width: 1920px; margin: 0 auto; padding: 34px 2.6vw 40px; }
.v2--preview .v2-page { padding-top: 60px; }
.v2-preview-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: #cc0019; color: #fff; text-align: center;
                  font: 600 13px/1.4 Poppins, sans-serif; padding: 6px 10px; }
a { color: inherit; }

/* ---- Nagłówek ---- */
.v2-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 2.2vw; }
.v2-logo img { display: block; width: clamp(170px, 17vw, 330px); height: auto; }
.v2-title { margin: 0; font: 600 clamp(26px, 3.4vw, 66px)/1.1 Cinzel, serif; color: #fff; letter-spacing: .02em; text-align: right;
            text-shadow: 0 2px 18px rgba(0,0,0,.55); }

/* ---- Układ ---- */
.v2-main { display: grid; grid-template-columns: minmax(280px, 19%) 1fr; gap: 2.4vw; align-items: start; }
.v2-main--msg { grid-template-columns: minmax(280px, 460px) auto; justify-content: center; align-items: center; min-height: 60vh; }

/* ---- Lewa kolumna / karta dnia ---- */
.v2-label { margin: 0 0 18px; font: 600 clamp(14px, 1vw, 19px)/1.2 Poppins, sans-serif; letter-spacing: .28em; text-transform: uppercase; color: #fff; }
/* „Okienko N grudnia” / „Dziś w okienku” nad kartą — wyśrodkowane; padding-left = letter-spacing,
   bo rozstrzelenie dodaje odstęp także za ostatnią literą i tekst uciekałby w lewo */
.v2-slide .v2-label { text-align: center; padding-left: .28em; }
.v2-frame { position: relative; display: block; border: 1px dashed var(--frame); padding: clamp(10px, .9vw, 16px); background: rgba(10,7,4,.55); }
.v2-card { text-decoration: none; transition: box-shadow .25s; }
.v2-card img { display: block; width: 100%; height: auto; }
.v2-card--img { border: 0; padding: 0; background: none; }   /* gotowa grafika ma własną ramkę */
a.v2-card:hover, a.v2-card:focus-visible { box-shadow: 0 0 28px rgba(242,183,5,.35); outline: none; }
.v2-card.is-sold img, .v2-card.is-sold .v2-auto { filter: grayscale(.6) brightness(.8); }
.v2-sold { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-8deg); padding: 8px 20px; border: 3px solid #fff;
           border-radius: 6px; background: rgba(120,0,12,.9); color: #fff; font: 700 22px/1 Poppins, sans-serif; letter-spacing: 2px;
           text-transform: uppercase; white-space: nowrap; box-shadow: 0 6px 20px rgba(0,0,0,.45); }
.v2-stock { margin-top: 10px; font-size: 14px; color: #fceeb8; }
.v2-stock b { color: var(--gold-l); font-size: 18px; }
.v2-prices { margin-top: 12px; font-family: Cinzel, serif; }
.v2-prices s { color: var(--muted); margin-right: 10px; font-size: 17px; }
.v2-prices b { color: var(--gold-l); font-size: 28px; }
.v2-desc-h { margin: 22px 0 8px; font: 500 13px/1.2 Poppins, sans-serif; text-transform: uppercase; letter-spacing: .04em; color: #fff; }
.v2-desc { font-size: 12.5px; line-height: 1.55; color: var(--txt); text-align: justify; -webkit-hyphens: auto; hyphens: auto; }
.v2-desc p { margin: 0 0 .7em; }
.v2-desc a { color: var(--gold-l); }
/* Desktop: opis zawsze tej samej wysokości (karta nie skacze między dniami), dłuższy tekst — przewijanie ze stałym paskiem */
@media (min-width: 1100px) {
    .v2-desc { height: 170px; overflow-y: scroll; padding-right: 10px; overscroll-behavior: contain;
               scrollbar-width: thin; scrollbar-color: var(--gold) rgba(255,255,255,.08); }
    .v2-desc::-webkit-scrollbar { width: 6px; }
    .v2-desc::-webkit-scrollbar-track { background: rgba(255,255,255,.08); border-radius: 3px; }
    .v2-desc::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }
    .v2-desc::-webkit-scrollbar-thumb:hover { background: var(--gold-l); }
    .v2-desc p:last-child { margin-bottom: 0; }
    /* Ściemnienie u dołu = „jest więcej tekstu”. Maska (nie nakładka), bo tło strony to zdjęcie;
       pas po prawej (pasek przewijania) zostaje bez maski. Klasę is-end ustawia js/v2.js. */
    .v2-desc:not(.is-end) {
        -webkit-mask: linear-gradient(to bottom, #000 calc(100% - 48px), transparent) left top / calc(100% - 10px) 100% no-repeat,
                      linear-gradient(#000, #000) right top / 10px 100% no-repeat;
                mask: linear-gradient(to bottom, #000 calc(100% - 48px), transparent) left top / calc(100% - 10px) 100% no-repeat,
                      linear-gradient(#000, #000) right top / 10px 100% no-repeat;
    }
}
.v2-code { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 12px; border: 1px dashed var(--gold-l); font-size: 13px; }
.v2-code b { color: var(--gold-l); font-size: 18px; letter-spacing: 2px; }
.v2-code button { margin-left: auto; background: var(--gold); color: #1a1206; border: 0; padding: 6px 12px; font: 600 12px/1 Poppins, sans-serif;
                  text-transform: uppercase; letter-spacing: .08em; cursor: pointer; }
.v2-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.v2-cta { display: inline-block; padding: 13px 18px; background: var(--gold); color: #1a1206; text-decoration: none; text-transform: uppercase;
          font: 500 clamp(14px, .95vw, 17px)/1 Poppins, sans-serif; letter-spacing: .12em; border: 2px solid var(--gold);
          transition: background .2s, color .2s, transform .2s, box-shadow .2s; }
.v2-cta:hover, .v2-cta:focus-visible { background: var(--gold-l); border-color: var(--gold-l); color: #1a1206; transform: translateY(-2px);
                                       box-shadow: 0 8px 22px rgba(242,183,5,.3); outline: none; }
.v2-cta--ghost { background: transparent; color: var(--gold-l); }
.v2-cta--ghost:hover, .v2-cta--ghost:focus-visible { background: rgba(242,183,5,.12); color: var(--gold-l); }
.v2-count { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: 16px; font-size: 13px; color: var(--muted);
            letter-spacing: .06em; text-transform: uppercase; }
.v2-count b { font: 700 20px/1 Cinzel, serif; color: var(--gold-l); letter-spacing: .02em; font-variant-numeric: tabular-nums; text-transform: none; }
.v2-count--next { display: flex; margin-top: 22px; padding-top: 14px; border-top: 1px dashed rgba(242,183,5,.35); }

.v2-msg__box p { margin: 0; font: 400 17px/1.6 Poppins, sans-serif; color: #fceeb8; }
.v2-msg .v2-cta { margin-top: 20px; }

/* Okienko składane automatycznie (brak gotowej grafiki) — biała karta jak w projekcie */
.v2-auto { display: flex; width: 100%; height: 100%; padding: 7%; border: 1px dashed var(--frame); background: #0b0805; }
.v2-auto__in { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; background: #f2f2f2;
               color: #1b1b1b; text-align: center; padding: 6%; overflow: hidden; }
.v2-auto__in img { width: 78%; max-height: 58%; object-fit: contain; }
.v2-auto__t { margin-top: 5%; font: 500 clamp(7px, .55vw, 11px)/1.25 Poppins, sans-serif; letter-spacing: .1em; text-transform: uppercase;
              display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.v2-auto__d { margin-top: 4%; padding-top: 4%; border-top: 1px solid var(--gold); font: 700 clamp(8px, .7vw, 13px)/1 Poppins, sans-serif;
              letter-spacing: .15em; text-transform: uppercase; }
.v2-auto--big { aspect-ratio: 539 / 572; padding: 0; border: 0; }
.v2-auto--big .v2-auto__in { padding: 8%; }
.v2-auto--big .v2-auto__t { font-size: clamp(12px, .9vw, 16px); }
.v2-auto--big .v2-auto__d { font-size: clamp(15px, 1.2vw, 22px); }

/* ---- Siatka okienek + skrzynka ----
   Szerokość planszy W = 6 okienek + 6 odstępów (0,06) + skrzynka (2,548) = 8,908 × okienko */
.v2-board { container-type: inline-size; }
.v2-grid { --t: calc(100cqi / 8.908); --g: calc(var(--t) * .06);
           display: grid; grid-template-columns: repeat(3, var(--t)) calc(var(--t) * 2.548) repeat(3, var(--t));
           grid-auto-rows: calc(var(--t) * 1.0674); gap: var(--g); }
.v2-tile { position: relative; display: block; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; background: #0b0805;
           color: inherit; font: inherit; overflow: visible; }
.v2-tile > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.v2-tile.is-open { cursor: pointer; transition: transform .25s, box-shadow .25s, filter .25s; }
.v2-tile.is-open:hover, .v2-tile.is-open:focus-visible { transform: translateY(-3px) scale(1.03); z-index: 2; outline: none;
                                                         box-shadow: 0 10px 28px rgba(0,0,0,.55), 0 0 0 1px var(--gold); }
.v2-tile.is-sel { box-shadow: 0 0 0 2px var(--gold-l), 0 0 26px rgba(242,183,5,.55); z-index: 1; }
.v2-tile.is-today { animation: v2-glow 2.4s ease-in-out infinite; }
@keyframes v2-glow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(246,199,49,.35)); }
    50%      { filter: drop-shadow(0 0 18px rgba(246,199,49,.9)) brightness(1.06); }
}
.v2-tile.is-gone > img, .v2-tile.is-gone .v2-auto { filter: grayscale(1) brightness(.5); }
.v2-tag { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); padding: 3px 9px; background: rgba(20,20,20,.9);
          border: 1px solid rgba(255,255,255,.25); color: #ddd; font: 600 clamp(8px, .6vw, 11px)/1 Poppins, sans-serif;
          letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.v2-tile.is-closed > img { transition: filter .25s; }
.v2-tile.is-closed:hover > img { filter: brightness(1.15); }
.v2-tile.is-shake { animation: v2-shake .45s; }
@keyframes v2-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

.v2-chest { position: relative; }
.v2-chest img { position: absolute; left: 50%; top: -6%; height: 112%; width: auto; max-width: none; transform: translateX(-47%);
                filter: drop-shadow(0 18px 40px rgba(0,0,0,.6)); pointer-events: none; }
.v2-chest--solo img { position: static; height: min(70vh, 760px); transform: none; }

/* ---- Pasek dni (telefon) ---- */
.v2-pills { display: none; }

/* ---- Stopka: klocki z hasłami ---- */
.v2-feats { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px; margin-top: 3.4vw; }
.v2-feats img { display: block; height: clamp(44px, 3.4vw, 66px); width: auto; max-width: 100%; }

/* Nawigacja suwaka — tylko poniżej układu komputerowego */
.v2-nav { display: none; }
.v2-track > .v2-slide { display: none; }
.v2-track > .v2-slide.is-active { display: block; animation: v2-in .35s ease; }
@keyframes v2-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ================= Tablet i telefon: każdy dzień osobno ================= */
/* Desktop: wszystkie dni leżą w tej samej komórce siatki (ukryte = visibility), więc kolumna ma zawsze
   wysokość najwyższego dnia i stopka pod nią nie skacze przy przerzucaniu. Opis wypełnia wolne miejsce
   (min. 170 px, dalej przewijanie) — przyciski są w każdym dniu na tej samej wysokości. */
@media (min-width: 1100px) {
    .v2-track { display: grid; }
    .v2-track > .v2-slide, .v2-track > .v2-slide.is-active { display: flex; flex-direction: column; grid-area: 1 / 1; visibility: hidden; }
    .v2-track > .v2-slide.is-active { visibility: visible; }
    .v2-track > .v2-slide > * { flex: 0 0 auto; }
    .v2-track > .v2-slide > .v2-desc { flex: 1 1 0; height: auto; min-height: 170px; }
    .v2-card--img img { aspect-ratio: 539 / 572; }   /* miejsce na kartę zanim obrazek się wczyta */
}

@media (max-width: 1099px) {
    .v2-page { padding: 22px 16px 32px; }
    .v2-head { flex-direction: column; gap: 10px; margin-bottom: 22px; }
    .v2-title { text-align: center; font-size: clamp(24px, 6vw, 44px); }
    .v2-main, .v2-main--msg { display: block; min-height: 0; }
    .v2-side { max-width: 560px; margin: 0 auto; }
    .v2-chest--solo { display: none; }
    .v2-board { margin-top: 34px; }

    .v2-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
    .v2-nav__btn { flex: 0 0 auto; width: 46px; height: 46px; border: 1px dashed var(--frame); background: rgba(10,7,4,.6); color: var(--gold-l);
                   font: 400 30px/1 Cinzel, serif; cursor: pointer; padding: 0 0 4px; transition: background .2s, opacity .2s; }
    .v2-nav__btn:hover:not(:disabled) { background: rgba(242,183,5,.15); }
    .v2-nav__btn:disabled { opacity: .25; cursor: default; }
    .v2-nav__lbl { flex: 1; text-align: center; font: 600 14px/1.2 Poppins, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: #fff; }

    .v2-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain;
                gap: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .v2-track::-webkit-scrollbar { display: none; }
    .v2-track > .v2-slide, .v2-track > .v2-slide.is-active { display: block; flex: 0 0 100%; min-width: 0; scroll-snap-align: center;
                                                             scroll-snap-stop: always; animation: none; }
    .v2-nav:not([hidden]) ~ .v2-track .v2-label { display: none; }   /* nazwa dnia jest w pasku nawigacji */
    .v2-desc { font-size: 14px; }
    .v2-cta { flex: 1 1 auto; text-align: center; }
    .v2-feats { justify-content: center; gap: 10px; margin-top: 30px; }
    /* wspólna wysokość = ten sam rozmiar tekstu; najszerszy klocek (561 px) mieści się w ekranie */
    .v2-feats { flex-direction: column; }
    .v2-feats img { width: auto; height: min(50px, calc((100vw - 32px) * 70 / 561)); }
}
/* Telefon: zamiast planszy — pasek 24 dni */
@media (max-width: 699px) {
    .v2-board { display: none; }
    .v2-pills { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; max-width: 560px; margin: 26px auto 0; }
    .v2-pill { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border: 1px dashed rgba(242,183,5,.35);
               background: rgba(10,7,4,.6); color: rgba(255,255,255,.35); font: 700 16px/1 Cinzel, serif; padding: 0; }
    .v2-pill.is-gone { color: rgba(255,255,255,.22); text-decoration: line-through; }
    .v2-pill.is-open { border-color: var(--frame); color: #fff; cursor: pointer; }
    .v2-pill.is-today { animation: v2-glow 2.4s ease-in-out infinite; }
    .v2-pill.is-sel { background: var(--gold); border-style: solid; color: #1a1206; }
}

@media (prefers-reduced-motion: reduce) {
    .v2-tile.is-today, .v2-pill.is-today { animation: none; filter: drop-shadow(0 0 12px rgba(246,199,49,.8)); }
    .v2-track { scroll-behavior: auto; }
    .v2-track > .v2-slide.is-active { animation: none; }
}
