/* Tía Vicenta v519 · colores más nítidos y luces con menos trabajo gráfico. */

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f4ee !important;
  --bg2: #f1e9de !important;
  --surface: #fffdf9 !important;
  --surface2: #f7f1e8 !important;
  --card: #fffefa !important;
  --text: #27231f !important;
  --muted: #6d665d !important;
  --line: rgba(70, 53, 34, .14) !important;
  --accent: #e98219 !important;
  --accent2: #c96812 !important;
  --shadow: 0 14px 34px rgba(68, 48, 26, .09) !important;
  --shadow2: 0 7px 18px rgba(68, 48, 26, .07) !important;
  --tv-bg: #f7f4ee !important;
  --tv-bg-end: #f7f4ee !important;
  --tv-text: #27231f !important;
  --tv-muted: #6d665d !important;
  --tv-surface: #fffdf9 !important;
  --tv-surface-2: #f7f1e8 !important;
  --tv-surface-3: #fffefa !important;
  --tv-line: rgba(70, 53, 34, .14) !important;
  --tv-line-strong: rgba(201, 104, 18, .28) !important;
  --tv-glass: #fffdf9 !important;
  --tv-input: #fffefa !important;
  --tv-shadow: 0 14px 34px rgba(68, 48, 26, .09) !important;
  --tv-shadow-sm: 0 7px 18px rgba(68, 48, 26, .07) !important;
  --tv-accent: #e98219 !important;
  --tv-accent-2: #c96812 !important;
  --tv-focus: rgba(201, 104, 18, .27) !important;
  --tv-overlay: rgba(20, 17, 13, .56) !important;
  --tv-modal-foot: #f7f1e8 !important;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17191b !important;
  --bg2: #1b1d1f !important;
  --surface: #222426 !important;
  --surface2: #292a2a !important;
  --card: #222426 !important;
  --text: #f5f1e8 !important;
  --muted: #c3b9aa !important;
  --line: rgba(245, 230, 207, .13) !important;
  --accent: #f0a23e !important;
  --accent2: #de7e1e !important;
  --shadow: 0 16px 38px rgba(0, 0, 0, .28) !important;
  --shadow2: 0 8px 22px rgba(0, 0, 0, .23) !important;
  --tv-bg: #17191b !important;
  --tv-bg-end: #17191b !important;
  --tv-text: #f5f1e8 !important;
  --tv-muted: #c3b9aa !important;
  --tv-surface: #222426 !important;
  --tv-surface-2: #292a2a !important;
  --tv-surface-3: #1e2022 !important;
  --tv-line: rgba(245, 230, 207, .13) !important;
  --tv-line-strong: rgba(240, 162, 62, .34) !important;
  --tv-glass: #202224 !important;
  --tv-input: #1c1e20 !important;
  --tv-shadow: 0 16px 38px rgba(0, 0, 0, .28) !important;
  --tv-shadow-sm: 0 8px 22px rgba(0, 0, 0, .23) !important;
  --tv-accent: #f0a23e !important;
  --tv-accent-2: #de7e1e !important;
  --tv-focus: rgba(240, 162, 62, .32) !important;
  --tv-overlay: rgba(0, 0, 0, .68) !important;
  --tv-modal-foot: #242526 !important;
}

/* Aplana los fondos decorativos grandes para que el cambio de tema y el scroll
   no vuelvan a pintar varias capas radiales en cada fotograma. */
html body {
  background: var(--tv-bg) !important;
  background-image: none !important;
  transition: background-color .18s ease, color .18s ease !important;
}

html body .topbar-inner {
  background: var(--tv-glass) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html body .drawer-backdrop.show,
html body .modal-backdrop.show,
html body #drawerBackdrop.show,
html body #tv-connection-status-v518 {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html body .category,
html body .product,
html body #cartDrawer,
html body .drawer,
html body .modal-card,
html body .cart-item,
html body .checkout-panel {
  transition: background-color .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease !important;
}

html body :focus-visible {
  outline: 3px solid var(--tv-focus) !important;
  outline-offset: 3px !important;
}

/* La imagen de ojos cerrados se monta sobre la imagen original sin editarla. */
html body header.topbar .brand#brandTap .brand-logo #brandLogoBlinkV519 {
  position: absolute !important;
  z-index: 3 !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  opacity: 0 !important;
  visibility: visible !important;
  pointer-events: none !important;
  filter: drop-shadow(0 8px 13px rgba(23, 34, 72, .18)) !important;
  transition: opacity 45ms linear !important;
}
html body header.topbar .brand#brandTap .brand-logo.tv-v519-logo-blinking #brandLogoBlinkV519 {
  opacity: 1 !important;
}

/* Bombitas con brillo de vidrio; solo cambia la opacidad del halo, sin filtros
   animados ni escalado del SVG, para que el destello sea más ligero. */
#tv-xmas-intro-v516 .tv-in-spotlight { filter: none !important; }
#tv-xmas-intro-v516 .tv-in-tree-svg { filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .22)) !important; }
#tv-xmas-intro-v516 .tv-in-bulb-unit { overflow: visible; }
#tv-xmas-intro-v516 .tv-in-bulb-halo {
  opacity: .08;
  filter: none !important;
  transform: none !important;
}
#tv-xmas-intro-v516.tv-in-running .tv-in-bulb-halo {
  animation: tv-v519-bulb-glow 5.4s ease-in-out var(--delay) infinite;
}
#tv-xmas-intro-v516 .tv-in-bulb {
  stroke: rgba(255, 244, 214, .82);
  stroke-width: .65;
}
#tv-xmas-intro-v516 .tv-in-bulb-center {
  fill: #fff4cc;
  opacity: .76;
}
#tv-xmas-intro-v516 .tv-in-bulb-glint {
  fill: #fff;
  opacity: .9;
}
@keyframes tv-v519-bulb-glow {
  0%, 100% { opacity: .08; }
  18%, 28% { opacity: .34; }
  43% { opacity: .13; }
}
#tv-xmas-intro-v516 .tv-in-tree-star { filter: drop-shadow(0 0 5px rgba(255, 217, 145, .62)); }
#tv-xmas-intro-v516.tv-in-running .tv-in-tree-star { animation: tv-v519-star-breathe 3.8s ease-in-out .7s infinite alternate; }
@keyframes tv-v519-star-breathe { from { opacity: .78; } to { opacity: 1; } }
#tv-xmas-intro-v516 .tv-in-spark { box-shadow: 0 0 4px 1px rgba(255, 202, 115, .18); }

/* Destellos discretos del desplazamiento y libro de cierre al llegar al final. */
.tv-v519-magic-layer {
  position: fixed;
  inset: 0;
  z-index: 49;
  pointer-events: none;
  overflow: hidden;
  background: transparent !important;
  contain: layout style paint;
}
.tv-v519-scroll-spark {
  position: absolute;
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--spark-color);
  box-shadow: 0 0 6px 1px color-mix(in srgb, var(--spark-color) 44%, transparent);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  animation: tv-v519-scroll-sparkle .76s ease-out forwards;
}
@keyframes tv-v519-scroll-sparkle {
  0% { opacity: 0; transform: translate3d(0, 5px, 0) scale(.4); }
  22% { opacity: .8; }
  100% { opacity: 0; transform: translate3d(var(--spark-dx), var(--spark-dy), 0) scale(.35); }
}
.tv-v519-finale {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(940px, calc(100% - 32px));
  margin: clamp(46px, 8vw, 88px) auto clamp(72px, 10vw, 124px);
  padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 42px) clamp(26px, 4vw, 42px);
  border: 1px solid rgba(229, 192, 128, .28);
  border-radius: 30px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(203, 160, 82, .12), transparent 58%),
    linear-gradient(145deg, #102a28, #0b1c20 62%, #111821);
  color: #f8edd8;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 245, 219, .08);
}
.tv-v519-finale::before,
.tv-v519-finale::after {
  content: "✦";
  position: absolute;
  top: 17px;
  color: rgba(246, 210, 151, .56);
  font: 17px/1 Georgia, serif;
  pointer-events: none;
}
.tv-v519-finale::before { left: 20px; }
.tv-v519-finale::after { right: 20px; }
.tv-v519-finale-inner { position: relative; z-index: 1; }
.tv-v519-finale-kicker {
  margin: 0 0 20px;
  color: #e8c58e;
  font: 700 10px/1.4 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.tv-v519-book-stage {
  position: relative;
  width: min(560px, calc(100vw - 78px));
  height: clamp(215px, 40vw, 310px);
  margin: 0 auto;
  perspective: 1500px;
  transform-style: preserve-3d;
  filter: drop-shadow(0 20px 20px rgba(0, 0, 0, .27));
}
.tv-v519-book-spread {
  position: absolute;
  inset: 12px 5px 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border-radius: 17px 17px 12px 12px;
  background: #ebdfc4;
  box-shadow: inset 0 0 0 1px rgba(121, 89, 44, .24), 0 5px 9px rgba(0, 0, 0, .17);
}
.tv-v519-page {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #fff7e4, #f2e7cd 72%, #e7d6b8);
}
.tv-v519-page-left {
  border-radius: 16px 4px 4px 12px;
  box-shadow: inset -13px 0 18px -18px rgba(72, 49, 22, .6);
}
.tv-v519-page-right {
  border-radius: 4px 16px 12px 4px;
  background: linear-gradient(225deg, #fff8e7, #f4e9d2 72%, #e9d9bc);
  box-shadow: inset 13px 0 18px -18px rgba(72, 49, 22, .6);
}
.tv-v519-page-rule {
  position: absolute;
  top: 19%;
  width: 38%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(157, 115, 57, .35), transparent);
}
.tv-v519-page-left .tv-v519-page-rule { left: 12%; }
.tv-v519-page-right .tv-v519-page-rule { right: 12%; }
.tv-v519-page-flourish {
  position: absolute;
  bottom: 11%;
  color: rgba(168, 123, 59, .54);
  font: 18px/1 Georgia, serif;
}
.tv-v519-page-left .tv-v519-page-flourish { left: 17%; }
.tv-v519-page-right .tv-v519-page-flourish { right: 17%; }
.tv-v519-spread-message {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .72s ease .78s, transform .72s ease .78s;
}
.tv-v519-message-spark { margin-bottom: 7px; color: #b17a32; font: 16px/1 Georgia, serif; }
.tv-v519-spread-message h2 {
  margin: 0;
  color: #754139;
  font: 400 clamp(26px, 6vw, 45px)/1.06 Georgia, "Times New Roman", serif;
  letter-spacing: -.035em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .52);
}
.tv-v519-spread-message p {
  margin: 10px 0 8px;
  color: #665243;
  font: 400 clamp(10px, 2.4vw, 13px)/1.55 Georgia, "Times New Roman", serif;
}
.tv-v519-spread-message small {
  color: #9b764b;
  font: 700 8px/1.4 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.tv-v519-book-cover {
  position: absolute;
  top: 12px;
  z-index: 4;
  width: 50%;
  height: calc(100% - 30px);
  transform-style: preserve-3d;
  transition: transform 1.55s cubic-bezier(.2, .78, .16, 1);
}
.tv-v519-cover-left { left: 5px; transform-origin: right center; }
.tv-v519-cover-right { right: 5px; transform-origin: left center; }
.tv-v519-cover-face,
.tv-v519-cover-inside {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
}
.tv-v519-cover-face {
  border: 1px solid rgba(227, 192, 119, .65);
  background:
    radial-gradient(circle at 50% 44%, rgba(77, 113, 85, .48), transparent 39%),
    linear-gradient(145deg, #173c32, #0e2b27 65%, #173a32);
  color: #e4c17e;
  box-shadow: inset 0 0 0 5px rgba(211, 173, 99, .1), inset 0 0 0 6px rgba(211, 173, 99, .28);
}
.tv-v519-cover-left .tv-v519-cover-face { border-radius: 16px 3px 3px 12px; }
.tv-v519-cover-right .tv-v519-cover-face { border-radius: 3px 16px 12px 3px; }
.tv-v519-cover-face i {
  color: #f1d595;
  font: italic 500 clamp(35px, 8vw, 62px)/1 Georgia, "Times New Roman", serif;
  text-shadow: 0 2px 3px rgba(0, 0, 0, .28);
}
.tv-v519-cover-face b { margin: 8px 0; color: #d7b369; font: 16px/1 Georgia, serif; }
.tv-v519-cover-face small {
  color: #efdba9;
  font: 600 clamp(8px, 1.8vw, 10px)/1.2 Georgia, "Times New Roman", serif;
  letter-spacing: .1em;
}
.tv-v519-cover-inside {
  transform: rotateY(180deg);
  border: 1px solid rgba(136, 102, 54, .4);
  background: linear-gradient(135deg, #d8c7a7, #efe4ce 56%, #d6c4a3);
  box-shadow: inset 0 0 0 5px rgba(255, 248, 226, .28);
}
.tv-v519-book-spine {
  position: absolute;
  z-index: 5;
  top: 13px;
  bottom: 19px;
  left: calc(50% - 5px);
  width: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(90, 58, 32, .2), rgba(243, 218, 164, .74), rgba(90, 58, 32, .22));
  opacity: .7;
  pointer-events: none;
}
.tv-v519-finale.is-open .tv-v519-cover-left { transform: rotateY(-154deg); }
.tv-v519-finale.is-open .tv-v519-cover-right { transform: rotateY(154deg); }
.tv-v519-finale.is-open .tv-v519-spread-message { opacity: 1; transform: translateY(0); }
.tv-v519-finale-caption {
  margin: 19px 0 0;
  color: rgba(248, 237, 216, .74);
  font: 400 12px/1.5 Georgia, "Times New Roman", serif;
  letter-spacing: .045em;
}

@media (max-width: 650px) {
  #tv-xmas-intro-v516 .tv-in-tree-svg { filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .2)) !important; }
  .tv-v519-finale { width: calc(100% - 20px); border-radius: 23px; }
  .tv-v519-book-stage { width: calc(100vw - 66px); height: clamp(205px, 57vw, 255px); }
  .tv-v519-book-spread { inset-inline: 3px; }
  .tv-v519-cover-left { left: 3px; }
  .tv-v519-cover-right { right: 3px; }
  .tv-v519-book-spine { left: calc(50% - 4px); width: 8px; }
  .tv-v519-spread-message { padding: 10px; }
  .tv-v519-spread-message p { margin: 7px 0; }
  .tv-v519-finale-caption { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html body,
  html body .category,
  html body .product,
  html body #cartDrawer,
  html body .drawer,
  html body .modal-card,
  html body .cart-item,
  html body .checkout-panel { transition-duration: .01ms !important; }
  #tv-xmas-intro-v516 .tv-in-bulb-halo { animation: none !important; opacity: .2; }
  html body header.topbar .brand#brandTap .brand-logo #brandLogoBlinkV519 { transition: none !important; }
  .tv-v519-magic-layer { display: none !important; }
  .tv-v519-book-cover { transition: none !important; }
  .tv-v519-spread-message { transition: none !important; }
}
