/* ==========================================================================
   Venda d'entrades (js/venda.js): compte enrere per a l'estrena (targeta de la portada)
   i pop-up «Les entrades ja estan a la venda!» (totes les pàgines públiques).
   ========================================================================== */

/* ---------- Compte enrere ---------- */
.estrena { margin: 18px 0 4px; padding: 14px 16px 12px; border-radius: 16px; background: linear-gradient(160deg, var(--forest), #2A4556); color: #FFFDF8; box-shadow: 0 14px 30px -18px rgba(23, 42, 55, .8); }
.estrena[hidden] { display: none; }
.estrena-titol { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.estrena-xifres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.estrena-xifres > span { display: flex; flex-direction: column; align-items: center; padding: 8px 0 6px; border-radius: 12px; background: rgba(255, 253, 248, .08); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: rgba(255, 253, 248, .85); }
.estrena-xifres b { font-family: var(--font-display); font-size: 30px; line-height: 1.05; color: #FFFDF8; font-variant-numeric: tabular-nums; }
.estrena-xifres .is-seg b { color: #FFE08A; }
.estrena-quan { margin: 10px 0 0; font-size: 14px; text-align: center; color: rgba(255, 253, 248, .88); }
.estrena-quan strong { color: #FFE08A; }
@media (prefers-reduced-motion: no-preference) {
  .estrena-xifres .is-seg b { animation: estrena-seg 1s steps(1) infinite; }
}
@keyframes estrena-seg { 50% { opacity: .6; } }

/* ---------- Pop-up ---------- */
.pv { width: min(440px, calc(100vw - 28px)); max-width: none; max-height: none; margin: auto; padding: 0; border: 0; border-radius: 24px; background: #FFFDF8; color: var(--forest); overflow: visible; box-shadow: 0 0 0 3px var(--gold), 0 30px 70px -20px rgba(0, 0, 0, .7); font-family: var(--font-text); }
.pv::backdrop { background: rgba(10, 21, 29, .62); backdrop-filter: blur(3px); }
.pv-cos { position: relative; padding: 26px 24px 18px; text-align: center; }
.pv-tanca-form { position: absolute; top: 8px; right: 8px; z-index: 2; margin: 0; }
.pv-tanca { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--forest); font-size: 28px; line-height: 1; cursor: pointer; }
.pv-tanca:hover { background: var(--paper); }

.pv-tiquet { position: relative; width: 250px; max-width: 80%; margin: -80px auto 14px; padding: 14px 62px 14px 26px; box-sizing: border-box; border-radius: 12px; background: linear-gradient(135deg, var(--red), #E2563E); color: #FFFDF8; text-align: left; rotate: -4deg; box-shadow: 0 16px 26px -12px rgba(120, 20, 10, .7);
  -webkit-mask: radial-gradient(circle at 0 50%, #0000 11px, #000 12px) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, #0000 11px, #000 12px) right / 51% 100% no-repeat;
          mask: radial-gradient(circle at 0 50%, #0000 11px, #000 12px) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, #0000 11px, #000 12px) right / 51% 100% no-repeat; }
.pv-tiquet::after { content: ''; position: absolute; top: 10px; bottom: 10px; right: 52px; border-left: 2px dashed rgba(255, 253, 248, .55); }
.pv-tiquet small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .1em; white-space: nowrap; text-transform: uppercase; opacity: .9; }
.pv-tiquet strong { display: block; font-family: var(--font-display); font-size: 22px; line-height: 1.05; }
.pv-tiquet span { display: block; margin-top: 4px; font-size: 12px; opacity: .92; }
.pv-tiquet i { position: absolute; right: -8px; top: 50%; translate: 0 -50%; rotate: 90deg; font-style: normal; font-family: var(--font-display); font-size: 13px; line-height: 1; color: #FFE08A; white-space: nowrap; text-transform: uppercase; }

.pv-estels { position: absolute; inset: -30px 0 auto; height: 110px; pointer-events: none; }
.pv-estels b { position: absolute; color: var(--gold); font-size: 18px; }
.pv-estels b:nth-child(1) { left: 10%; top: 40px; }
.pv-estels b:nth-child(2) { left: 86%; top: 22px; animation-delay: .6s; }
.pv-estels b:nth-child(3) { left: 72%; top: 84px; font-size: 12px; animation-delay: 1.1s; }
.pv-estels b:nth-child(4) { left: 22%; top: 92px; font-size: 12px; animation-delay: 1.6s; }

.pv-eyebrow { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--red-text); }
.pv-titol { margin: 4px 0 8px; font-family: var(--font-display); font-size: clamp(26px, 6.5vw, 32px); line-height: 1.05; color: var(--forest); }
.pv-text { margin: 0 0 14px; font-size: 15px; line-height: 1.5; color: #3B4A55; }
.pv-dies { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pv-dies li { padding: 7px 4px; border-radius: 10px; background: var(--paper); font-size: 12px; line-height: 1.25; font-weight: 600; color: #3B4A55; }
.pv-dies b { display: block; font-family: var(--font-display); font-size: 16px; color: var(--forest); }
.pv-dies em { display: block; font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--red-text); }
.pv-dies .is-estrena { background: #FFF1C9; box-shadow: inset 0 0 0 2px var(--gold); }
.pv-dies .is-exhaurides { opacity: .7; }
.pv-dies .is-exhaurides b { text-decoration: line-through; }
.pv-compte { margin: 0 0 16px; font-size: 14px; font-weight: 700; }
.pv-compte strong { font-family: var(--font-display); font-size: 18px; color: var(--red-text); }
.pv-cta { justify-content: center; width: 100%; min-height: 52px; font-size: 18px; }
.pv-cta:hover { background: #B82B17; color: #fff; }
.pv form { margin: 0; }
.pv-no { min-height: 44px; margin-top: 6px; padding: 0 16px; border: 0; background: none; color: #4E5A63; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* Pantalles baixes (mòbils petits, portàtils amb zoom): més compacte, perquè hi càpiga tot */
@media (max-height: 720px) {
  .pv-tiquet { margin-top: -64px; padding-block: 10px; }
  .pv-tiquet strong { font-size: 18px; }
  .pv-text { display: none; }
  .pv-titol { font-size: 24px; }
}
@media (max-height: 600px) { .pv-dies { display: none; } }

@media (prefers-reduced-motion: no-preference) {
  .pv[open] { animation: pv-entra .7s cubic-bezier(.3, 1.5, .5, 1) both; }
  .pv[open]::backdrop { animation: pv-fons .4s ease both; }
  .pv-tiquet { animation: pv-tiquet 3.2s ease-in-out 1s infinite; }
  .pv-estels b { animation: pv-estel 2.4s ease-in-out infinite; }
}
@keyframes pv-entra { from { opacity: 0; transform: translateY(40px) scale(.85); } }
@keyframes pv-fons { from { opacity: 0; } }
@keyframes pv-tiquet { 0%, 70%, 100% { rotate: -4deg; translate: 0 0; } 78% { rotate: -9deg; translate: 0 -6px; } 86% { rotate: 1deg; translate: 0 0; } 93% { rotate: -5deg; } }
@keyframes pv-estel { 50% { opacity: .3; transform: scale(.6) rotate(40deg); } }
@media print { .pv { display: none; } }
