/* ==========================================================================
   Novetats (js/novetats.js): regalet a baix a l'esquerra que salta mentre hi ha novetats
   per veure, i panell amb les novetats. A la dreta hi treu el cap el dimoni tafaner.
   ========================================================================== */
.novetats { position: fixed; left: 16px; bottom: 16px; z-index: 70; font-family: var(--font-text); opacity: 0; translate: 0 20px; pointer-events: none; transition: opacity .4s ease, translate .5s cubic-bezier(.34, 1.56, .64, 1); }
.novetats.visible { opacity: 1; translate: 0 0; pointer-events: auto; }
.novetats-boto { position: relative; display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%; background: var(--forest); box-shadow: 0 0 0 3px #FFFDF8, 0 14px 28px -10px rgba(23, 42, 55, .6); cursor: pointer; }
.novetats-boto svg { width: 40px; height: 40px; }
.novetats-num { position: absolute; top: -4px; right: -4px; min-width: 24px; height: 24px; padding: 0 6px; box-sizing: border-box; border-radius: 12px; background: var(--red); color: #fff; font-size: 13px; font-weight: 700; line-height: 24px; text-align: center; box-shadow: 0 0 0 2px #FFFDF8; }
.novetats-num:empty { display: none; }
/* Etiqueta «Novetat!» al costat mentre n'hi ha de noves */
.novetats.te-noves .novetats-boto::after { content: 'Novetat!'; position: absolute; left: calc(100% + 10px); top: 50%; translate: 0 -50%; padding: 6px 12px; border-radius: 999px; background: #FFFDF8; color: var(--red-text); font-family: var(--font-display); font-weight: 700; font-size: 15px; white-space: nowrap; box-shadow: 0 8px 18px -8px rgba(23, 42, 55, .5); }
.novetats.obert .novetats-boto::after { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .novetats.visible.te-noves .novetats-boto svg { animation: regal-salta 3.2s cubic-bezier(.3, 0, .3, 1) 1s infinite; transform-origin: 50% 90%; }
  .novetats.visible.te-noves .novetats-num { animation: regal-num 3.2s ease 1s infinite; }
}
@keyframes regal-salta {
  0%, 62%, 100% { transform: translateY(0) rotate(0) scale(1); }
  66% { transform: translateY(0) scale(1.12, .86); }
  72% { transform: translateY(-14px) rotate(-8deg) scale(.95, 1.06); }
  78% { transform: translateY(0) rotate(5deg) scale(1.08, .92); }
  83% { transform: translateY(-6px) rotate(-3deg); }
  88% { transform: translateY(0) rotate(0); }
}
@keyframes regal-num { 0%, 70%, 100% { transform: scale(1); } 75% { transform: scale(1.25); } 82% { transform: scale(1); } }

.novetats-panell { position: absolute; left: 0; bottom: calc(100% + 14px); width: min(340px, calc(100vw - 32px)); padding: 14px; box-sizing: border-box; border-radius: 18px; background: #FFFDF8; border: 1px solid var(--card-line); box-shadow: 0 24px 48px -18px rgba(23, 42, 55, .55); }
.novetats-cap { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.novetats-titol { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--forest); }
/* El títol rep el focus en obrir el panell (per als lectors de pantalla), però no és un control: sense anell */
.novetats-titol:focus, .novetats-titol:focus-visible { outline: none; box-shadow: none !important; }
.novetats-tanca { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--forest); cursor: pointer; }
.novetats-tanca:hover { background: var(--paper); }
.novetats-llista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.novetat { display: flex; gap: 12px; padding: 10px; border-radius: 12px; background: var(--paper); text-decoration: none; color: var(--ink); transition: background .2s ease; }
.novetat:hover { background: #E6E1D6; color: var(--ink); }
.novetat-img { flex: none; width: 72px; height: 90px; object-fit: cover; object-position: 50% 15%; border-radius: 8px; }
.novetat-cos { display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.4; }
.novetat-cos strong { font-size: 16px; color: var(--forest); }
.novetat-mes { font-weight: 700; color: var(--red-text); }
@media (prefers-reduced-motion: no-preference) {
  .novetats-panell:not([hidden]) { animation: panell-entra .35s cubic-bezier(.16, 1, .3, 1); transform-origin: 0 100%; }
}
@keyframes panell-entra { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@media (max-width: 600px) {
  .novetats { left: 12px; bottom: 12px; }
  .novetats-boto { width: 56px; height: 56px; }
  .novetats-boto svg { width: 34px; height: 34px; }
}
@media print { .novetats { display: none; } }
.novetats-totes { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 8px; border-radius: 10px; font-weight: 700; color: var(--forest); text-decoration: none; }
.novetats-totes:hover { background: var(--paper); color: var(--red-text); }
#patge-ull-viu { scroll-margin-top: 72px; }
/* Al mòbil, sense l'etiqueta «Novetat!» (taparia el text): n'hi ha prou amb el número */
@media (max-width: 900px) { .novetats.te-noves .novetats-boto::after { display: none; } }
#calendari-advent { scroll-margin-top: 72px; }
