/* ============ DP Home Banner + Flip Cards ============ */
.dphb-wrap{
  position:relative; left:50%; transform:translateX(-50%);
  width:min(1560px, 93vw);
  display:flex; gap:14px; align-items:stretch;
  margin:-12px auto 34px;
  box-sizing:border-box;
}
.dphb-wrap *{ box-sizing:border-box; }

/* ---------- HERO SLIDER ---------- */
.dphb-hero{
  position:relative; flex:1 1 70%; min-width:0;
  overflow:hidden; aspect-ratio:1920 / 600; background:#1d1d1f;
}
.dphb-track{ display:flex; height:100%; transition:transform .55s cubic-bezier(.4,0,.2,1); will-change:transform; }
.dphb-slide{ flex:0 0 100%; min-width:100%; height:100%; }
.dphb-slide-link{ display:block; height:100%; }
.dphb-slide picture,
.dphb-slide-img{ display:block; width:100%; height:100%; }
.dphb-slide-img{ object-fit:cover; }

.dphb-dots{ position:absolute; left:0; right:0; bottom:6px; display:flex; justify-content:center; gap:0; z-index:3; }
/* widoczna kropka 9px, ale obszar dotyku 24x24 (przezroczysta ramka + background-clip) — wymóg dostępności */
.dphb-dot{ box-sizing:content-box; width:9px; height:9px; border-radius:12.5px; border:8px solid transparent; padding:0; cursor:pointer; background:rgba(255,255,255,.55); background-clip:content-box; transition:all .2s ease; }
.dphb-dot.is-active{ background:#fff; background-clip:content-box; width:26px; border-radius:12.5px; }
.dphb-nav{ position:absolute; top:50%; transform:translateY(-50%); z-index:3; width:42px; height:42px; border:0; cursor:pointer;
  background:rgba(0,0,0,.28); color:#fff; font-size:24px; line-height:1; display:flex; align-items:center; justify-content:center;
  opacity:0; transition:opacity .2s ease, background .2s ease; }
.dphb-hero:hover .dphb-nav{ opacity:1; }
.dphb-nav:hover{ background:rgba(0,0,0,.5); }
.dphb-prev{ left:12px; } .dphb-next{ right:12px; }

/* ---------- TILES / FLIP CARDS ---------- */
.dphb-tiles{
  flex:1 1 30%; min-width:0;
  display:grid; grid-template-columns:1fr 1fr; grid-auto-rows:1fr; gap:12px;
}
/* single card row when only 1 */
.dphb-tiles[data-count="1"]{ grid-template-columns:1fr; }

.dphb-card{ position:relative; display:block; text-decoration:none; color:#fff; min-height:0; background:#fafafa; perspective:1200px; }
.dphb-card-inner{ position:absolute; inset:0; }
.dphb-card-front,
.dphb-card-back{ position:absolute; inset:0; display:flex; overflow:hidden; }
/* pointer-events: only the visible face is interactive.
   backface-visibility does NOT stop hit-testing of child elements, so we toggle
   pointer-events explicitly — otherwise the front's video/text intercept clicks
   meant for the flipped-in back button. */
.dphb-card-back{ pointer-events:none; }
.dphb-card-front{ pointer-events:auto; }
.mode-flip:hover .dphb-card-back,
.mode-flip:focus-within .dphb-card-back,
.mode-flip.is-flipped .dphb-card-back,
.mode-darken:hover .dphb-card-back,
.mode-darken:focus-within .dphb-card-back,
.mode-darken.is-flipped .dphb-card-back{ pointer-events:auto; }
.mode-flip:hover .dphb-card-front,
.mode-flip:focus-within .dphb-card-front,
.mode-flip.is-flipped .dphb-card-front,
.mode-darken:hover .dphb-card-front,
.mode-darken:focus-within .dphb-card-front,
.mode-darken.is-flipped .dphb-card-front{ pointer-events:none; }

/* front media */
.dphb-card-front{ flex-direction:column; justify-content:flex-end; }
.dphb-card-media{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:0;
  /* kadr ustawiony w adminie osobno na komputer i telefon (Dphomebanner::frameStyle) */
  object-position:var(--dphb-pos, 50% 50%); transform:scale(var(--dphb-z, 1)); transform-origin:var(--dphb-pos, 50% 50%); }
@media (max-width: 991px){
  .dphb-card-media{ object-position:var(--dphb-pos-m, 50% 50%); transform:scale(var(--dphb-z-m, 1)); transform-origin:var(--dphb-pos-m, 50% 50%); }
}
.dphb-badge{ position:absolute; top:10px; left:10px; z-index:2; background:#fff; color:#1d1d1f;
  font-size:11px; font-weight:700; letter-spacing:.03em; text-transform:uppercase; padding:4px 10px; border-radius:20px;
  box-shadow:0 2px 8px rgba(0,0,0,.18); }
.dphb-front-text{ position:relative; z-index:1; padding:26px 12px 12px; width:100%; color:#fff;
  font-size:13px; font-weight:700; line-height:1.28;
  background:linear-gradient(to top, rgba(0,0,0,.78) 8%, rgba(0,0,0,.42) 55%, rgba(0,0,0,0) 100%); }

/* back */
.dphb-card-back{ flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:9px; padding:12px 14px; color:#1d1d1f; }
.dphb-back-text{ font-size:12.5px; font-weight:700; line-height:1.25;
  display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; }
/* promo code pill (like the app) */
.dphb-code{ display:inline-block; background:rgba(255,255,255,.34); border:1.5px solid rgba(255,255,255,.8);
  color:#1d1d1f; font-weight:800; letter-spacing:.1em; padding:4px 16px; border-radius:22px; font-size:13px; line-height:1.2; }
/* button */
.dphb-card-btn{ display:inline-flex; align-items:center; justify-content:center;
  background:#fff; color:#1d1d1f; font-size:12px; font-weight:700;
  padding:7px 18px; border-radius:22px; border:0; cursor:pointer; letter-spacing:.01em; white-space:nowrap;
  box-shadow:0 3px 10px rgba(0,0,0,.12); transition:transform .15s ease; }
.dphb-card-btn:hover{ transform:translateY(-1px); }

/* when cards are large (few of them) allow a bit more room */
@media (min-width:992px){
  .dphb-tiles[data-count="1"] .dphb-back-text,
  .dphb-tiles[data-count="2"] .dphb-back-text{ font-size:14px; -webkit-line-clamp:5; }
  .dphb-tiles[data-count="1"] .dphb-code,
  .dphb-tiles[data-count="2"] .dphb-code{ font-size:15px; padding:6px 20px; }
  .dphb-tiles[data-count="1"] .dphb-card-btn,
  .dphb-tiles[data-count="2"] .dphb-card-btn{ font-size:13px; padding:9px 22px; }
}

/* --- FLIP mode: independent faces (reliable hit-testing, no preserve-3d) --- */
.mode-flip .dphb-card-front,
.mode-flip .dphb-card-back{
  transition:transform .55s cubic-bezier(.4,0,.2,1), opacity .4s ease;
}
/* resting: front visible & on top (transform:none => hit-testable), back hidden behind */
.mode-flip .dphb-card-front{ transform:none; opacity:1; z-index:2; -webkit-backface-visibility:hidden; backface-visibility:hidden; }
.mode-flip .dphb-card-back{ transform:rotateY(-180deg); opacity:0; z-index:1; }
/* flipped: back visible & on top (transform:none => hit-testable), front rotated away */
.mode-flip:hover .dphb-card-front,
.mode-flip:focus-within .dphb-card-front,
.mode-flip.is-flipped .dphb-card-front{ transform:rotateY(180deg); opacity:0; z-index:1; }
.mode-flip:hover .dphb-card-back,
.mode-flip:focus-within .dphb-card-back,
.mode-flip.is-flipped .dphb-card-back{ transform:none; opacity:1; z-index:2; }

/* --- DARKEN mode --- */
.mode-darken .dphb-card-back{ transform:none; z-index:3; opacity:0; transition:opacity .3s ease; }
.mode-darken .dphb-card-back::before{ content:""; position:absolute; inset:0; background:rgba(0,0,0,.35); z-index:-1; }
.mode-darken:hover .dphb-card-back,
.mode-darken:focus-within .dphb-card-back,
.mode-darken.is-flipped .dphb-card-back{ opacity:1; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 991px){
  .dphb-wrap{ flex-direction:column; gap:12px; width:100%; left:0; transform:none; padding:0 12px; }
  .dphb-hero{ flex:1 1 auto; width:100%; aspect-ratio:767 / 720; max-height:78vh; }
  .dphb-tiles{ flex:1 1 auto; width:100%; grid-auto-rows:auto; }
  .dphb-card{ aspect-ratio:1 / 1; }
}
@media (max-width: 479px){
  .dphb-tiles{ grid-template-columns:1fr; }
}
