/* ==========================================================================
   tivé · piezas compartidas: menú 3D, explosión de especias, carrito, avisos
   (todo con prefijo tv- para no interferir con los estilos del inicio)
   ========================================================================== */
:root {
  --bosque: #26332a; --bosque-2: #1d2821; --musgo: #4a5e4d; --crema: #efece6;
  --arena: #e6dccb; --dorado: #c9a25a; --canela: #8a4a26;
  --ease: cubic-bezier(.2,.7,.2,1); --ease-out: cubic-bezier(.16,1,.3,1);
}

/* Botones de la barra */
.tv-menu-btn, .tv-cart-btn {
  font: inherit; color: inherit; background: none; border: 1px solid currentColor; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer; height: 42px; padding: 0 18px;
  font-size: 12px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase;
  transition: background .5s var(--ease), color .5s var(--ease);
}
.tv-menu-btn .tv-burger { width: 18px; height: 8px; position: relative; }
.tv-menu-btn .tv-burger::before, .tv-menu-btn .tv-burger::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform .5s var(--ease);
}
.tv-menu-btn .tv-burger::before { top: 0; }
.tv-menu-btn .tv-burger::after { bottom: 0; right: 5px; }
.tv-menu-btn:hover .tv-burger::after { right: 0; }
.tv-cart-btn { padding: 0 14px; gap: 8px; }
.tv-cart-btn svg { width: 18px; height: 18px; }
.tv-cart-count { min-width: 18px; height: 18px; border-radius: 9px; background: var(--dorado); color: var(--bosque); font-size: 11px; letter-spacing: 0; display: inline-grid; place-items: center; font-weight: 500; padding: 0 5px; }
.tv-cart-count[data-n="0"] { display: none; }
.tv-menu-btn:focus-visible, .tv-cart-btn:focus-visible { outline: 2px solid var(--dorado); outline-offset: 3px; }

/* ---------- Menú a pantalla completa ---------- */
.tv-menu { position: fixed; inset: 0; z-index: 80; visibility: hidden; color: var(--crema); }
.tv-menu.open { visibility: visible; }
.tv-menu-bg { position: absolute; inset: 0; background: radial-gradient(120% 90% at 70% 40%, #2f4135 0%, var(--bosque) 45%, var(--bosque-2) 100%);
  clip-path: circle(0px at var(--ox, 90%) var(--oy, 40px)); transition: clip-path .9s var(--ease-out); }
.tv-menu.open .tv-menu-bg { clip-path: circle(150vmax at var(--ox, 90%) var(--oy, 40px)); }
.tv-menu-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 22px clamp(16px, 5vw, 64px); z-index: 2; }
.tv-menu-top img { height: 44px; width: auto; opacity: 0; transition: opacity .6s .2s; }
.tv-menu.open .tv-menu-top img { opacity: 1; }
.tv-menu-close { opacity: 0; transition: opacity .5s .3s, background .4s, color .4s; }
.tv-menu.open .tv-menu-close { opacity: 1; }
.tv-menu-close:hover { background: var(--crema); color: var(--bosque); }
.tv-menu-close .tv-x { width: 12px; height: 12px; position: relative; }
.tv-menu-close .tv-x::before, .tv-menu-close .tv-x::after { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1.5px; background: currentColor; }
.tv-menu-close .tv-x::before { transform: rotate(45deg); } .tv-menu-close .tv-x::after { transform: rotate(-45deg); }

.tv-menu-inner { position: relative; z-index: 1; height: 100%; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; padding: 100px clamp(16px, 7vw, 120px) 90px; gap: 4vw; }
.tv-menu-list { display: grid; gap: clamp(2px, 1vh, 10px); perspective: 900px; }
.tv-menu-list a { display: grid; grid-template-columns: 44px 1fr; align-items: baseline; column-gap: 18px; text-decoration: none; color: inherit;
  transform-origin: 0 100%; opacity: 0; transform: translateY(60px) rotateX(-75deg); transition: opacity .7s var(--ease-out), transform .9s var(--ease-out), color .4s; }
.tv-menu.open .tv-menu-list a { opacity: 1; transform: none; }
.tv-menu.open .tv-menu-list a:nth-child(1) { transition-delay: .18s; } .tv-menu.open .tv-menu-list a:nth-child(2) { transition-delay: .24s; }
.tv-menu.open .tv-menu-list a:nth-child(3) { transition-delay: .30s; } .tv-menu.open .tv-menu-list a:nth-child(4) { transition-delay: .36s; }
.tv-menu.open .tv-menu-list a:nth-child(5) { transition-delay: .42s; } .tv-menu.open .tv-menu-list a:nth-child(6) { transition-delay: .48s; }
.tv-menu-list .n { font-size: 12px; letter-spacing: .2em; color: var(--dorado); }
.tv-menu-list .w { font-style: italic; font-weight: 400; font-size: clamp(44px, 7.4vh, 96px); line-height: 1.04; letter-spacing: -0.01em; display: inline-block; transition: transform .6s var(--ease-out), letter-spacing .6s var(--ease-out); }
.tv-menu-list .d { grid-column: 2; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; opacity: 0; max-height: 0; overflow: hidden; transition: opacity .4s, max-height .5s var(--ease); }
.tv-menu-list:hover a { color: rgba(239,236,230,.32); }
.tv-menu-list a:hover, .tv-menu-list a:focus-visible { color: var(--crema); outline: none; }
.tv-menu-list a:hover .w, .tv-menu-list a:focus-visible .w { transform: translateX(14px) skewX(-4deg); letter-spacing: .005em; }
.tv-menu-list a:hover .d, .tv-menu-list a:focus-visible .d { opacity: .75; max-height: 30px; }
.tv-menu-list a[aria-current="page"] .n::after { content: " ●"; }

.tv-orbit { position: relative; height: min(70vh, 640px); perspective: 900px; opacity: 0; transition: opacity 1s .35s; }
.tv-menu.open .tv-orbit { opacity: 1; }
.tv-orbit-stage { position: absolute; inset: 0; transform-style: preserve-3d; }
.tv-orbit img { position: absolute; left: 50%; top: 50%; will-change: transform, opacity; filter: drop-shadow(0 18px 24px rgba(0,0,0,.35)); pointer-events: none; }
.tv-orbit .tv-hero-img { width: min(48%, 300px); filter: drop-shadow(0 40px 50px rgba(0,0,0,.45)); }
.tv-orbit-glow { position: absolute; left: 50%; top: 50%; width: 70%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(201,162,90,.22), rgba(201,162,90,0) 65%); }
.tv-menu-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 22px clamp(16px, 7vw, 120px); font-size: 13px; letter-spacing: .08em; opacity: 0; transition: opacity .6s .5s; }
.tv-menu.open .tv-menu-foot { opacity: .75; }
.tv-menu-foot a { text-decoration: none; margin-right: 22px; }
.tv-menu-foot a:hover { color: var(--dorado); }

/* ---------- Lienzo de la explosión ---------- */
.tv-burst { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 120; pointer-events: none; }

/* ---------- Carrito ---------- */
.tv-cart { position: fixed; inset: 0; z-index: 90; visibility: hidden; }
.tv-cart.open { visibility: visible; }
.tv-cart-scrim { position: absolute; inset: 0; background: rgba(20,28,23,.5); opacity: 0; transition: opacity .5s var(--ease); }
.tv-cart.open .tv-cart-scrim { opacity: 1; }
.tv-cart-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--crema); color: var(--bosque);
  transform: translateX(100%); transition: transform .7s var(--ease-out); display: grid; grid-template-rows: auto 1fr auto; }
.tv-cart.open .tv-cart-panel { transform: none; }
.tv-cart-head { display: flex; justify-content: space-between; align-items: center; padding: 26px 28px; border-bottom: 1px solid rgba(38,51,42,.14); }
.tv-cart-head h2 { font-style: italic; font-weight: 400; font-size: 28px; }
.tv-cart-body { overflow: auto; padding: 8px 28px; }
.tv-cart-item { display: grid; grid-template-columns: 84px 1fr auto; gap: 16px; align-items: center; padding: 20px 0; border-bottom: 1px solid rgba(38,51,42,.12); }
.tv-cart-item img { width: 84px; height: 100px; object-fit: contain; background: #e4ddd0; border-radius: 10px; padding: 6px; }
.tv-cart-item h3 { font-weight: 500; font-size: 16px; } .tv-cart-item p { font-size: 13px; opacity: .7; margin-top: 2px; }
.tv-qty { display: inline-flex; align-items: center; border: 1px solid rgba(38,51,42,.3); border-radius: 999px; margin-top: 10px; }
.tv-qty button { width: 34px; height: 34px; border: 0; background: none; font: inherit; font-size: 18px; cursor: pointer; color: inherit; border-radius: 50%; }
.tv-qty button:hover { background: rgba(38,51,42,.08); }
.tv-qty span { min-width: 26px; text-align: center; font-size: 15px; }
.tv-cart-price { font-size: 15px; font-weight: 500; white-space: nowrap; }
.tv-cart-empty { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 70px 10px; }
.tv-cart-empty img { width: 90px; opacity: .9; }
.tv-cart-empty p { opacity: .75; max-width: 28ch; line-height: 1.6; }
.tv-cart-foot { padding: 22px 28px 28px; border-top: 1px solid rgba(38,51,42,.14); display: grid; gap: 12px; }
.tv-cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.tv-cart-total strong { font-size: 24px; font-weight: 400; }
.tv-cart-note { font-size: 12.5px; opacity: .78; line-height: 1.5; }
.tv-btn-solid { display: inline-flex; justify-content: center; align-items: center; gap: 10px; background: var(--bosque); color: var(--crema); border: 0; border-radius: 999px;
  padding: 17px 26px; font: inherit; font-size: 13px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background .4s, transform .4s var(--ease); }
.tv-btn-solid:hover { background: var(--musgo); transform: translateY(-1px); }
.tv-btn-line { display: inline-flex; justify-content: center; align-items: center; gap: 10px; background: none; color: inherit; border: 1px solid currentColor; border-radius: 999px;
  padding: 16px 24px; font: inherit; font-size: 13px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.tv-btn-line:hover { background: var(--bosque); color: var(--crema); }

/* Aviso flotante */
.tv-toast { position: fixed; left: 50%; bottom: 28px; z-index: 130; transform: translate(-50%, 30px); opacity: 0; background: var(--bosque); color: var(--crema);
  padding: 14px 22px; border-radius: 999px; font-size: 14px; letter-spacing: .02em; box-shadow: 0 18px 40px rgba(0,0,0,.25); transition: opacity .5s var(--ease), transform .5s var(--ease-out); pointer-events: none; }
.tv-toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .tv-menu-inner { grid-template-columns: 1fr; align-content: center; padding-top: 90px; }
  .tv-orbit { position: absolute; inset: auto 0 60px 0; height: 34vh; opacity: .55 !important; pointer-events: none; }
  .tv-menu-list .w { font-size: clamp(40px, 11vw, 60px); }
  .tv-menu-list { position: relative; z-index: 2; }
  .tv-menu-btn { padding: 0 14px; height: 40px; }
  .tv-menu-btn .tv-label { display: none; }
  .tv-cart-btn { height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .tv-menu-bg { transition: none; } .tv-menu-list a { transition: opacity .2s; transform: none; }
  .tv-cart-panel { transition: none; }
}

/* Mientras carga una página a la que se llegó con explosión: telón cerrado (evita parpadeo) */
html.tv-arriving::after { content: ""; position: fixed; inset: 0; background: #26332a; z-index: 119; }

/* Telón de llegada: lo anima el navegador, no depende del lienzo */
.tv-veil { position: fixed; inset: 0; z-index: 119; background: #26332a; pointer-events: none; opacity: 1; transform: scale(1); transition: opacity .85s cubic-bezier(.65,0,.35,1); }
.tv-veil.open { opacity: 0; }

/* Botón flotante de WhatsApp */
.tv-wa { position: fixed; right: clamp(16px, 2.4vw, 32px); bottom: clamp(16px, 2.4vw, 32px); z-index: 70; display: flex; align-items: center; gap: 0;
  text-decoration: none; color: var(--bosque); opacity: 0; transform: translateY(20px) scale(.9); transition: opacity .7s var(--ease), transform .7s var(--ease-out); }
.tv-wa.in { opacity: 1; transform: none; }
.tv-wa-icon { position: relative; width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center;
  box-shadow: 0 14px 34px rgba(0,0,0,.28); transition: transform .4s var(--ease-out); }
.tv-wa-icon svg { width: 30px; height: 30px; }
.tv-wa-icon::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #25d366; animation: tvWaPulse 2.6s var(--ease) infinite; }
@keyframes tvWaPulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }
.tv-wa-label { background: var(--crema); color: var(--bosque); font-size: 13px; letter-spacing: .08em; padding: 10px 16px; border-radius: 999px; margin-right: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,.18); opacity: 0; transform: translateX(10px); transition: opacity .4s, transform .5s var(--ease-out); pointer-events: none; white-space: nowrap; }
.tv-wa:hover .tv-wa-label, .tv-wa:focus-visible .tv-wa-label { opacity: 1; transform: none; }
.tv-wa:hover .tv-wa-icon { transform: scale(1.08) rotate(-6deg); }
.tv-wa:focus-visible { outline: none; } .tv-wa:focus-visible .tv-wa-icon { outline: 2px solid var(--dorado); outline-offset: 4px; }
html.tv-lock .tv-wa { display: none; }
@media (max-width: 900px) { .tv-wa-icon { width: 54px; height: 54px; } .tv-wa-label { display: none; } }
@media (prefers-reduced-motion: reduce) { .tv-wa-icon::before { animation: none; } .tv-wa { transition: none; } }
/* Legibilidad: números del menú y texto sobre fotos */
.tv-menu-list .n { color: #d8b46f; }
.nav.over-photo ul a, .nav.over-photo .tv-label { text-shadow: 0 1px 10px rgba(20,28,23,.6); }

/* Idioma: botón de bandera y sin parpadeo mientras se traduce */
html.tv-i18n body { opacity: 0; }
.tv-lang { font: inherit; color: inherit; background: none; border: 1px solid currentColor; border-radius: 999px; height: 42px; padding: 0 14px 0 8px;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; letter-spacing: .2em; transition: background .4s, color .4s; }
.tv-lang .tv-flag { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; display: block; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.tv-lang .tv-flag svg { width: 39px; height: 26px; margin-left: -6.5px; display: block; }
.tv-lang:hover { background: rgba(239,236,230,.12); }
.tv-lang:focus-visible { outline: 2px solid var(--dorado); outline-offset: 3px; }
@media (max-width: 900px) { .tv-lang { height: 40px; padding: 0 7px; } .tv-lang .tv-lang-txt { display: none; } }

/* Firma del creador del sitio */
.tv-credit { display: flex; justify-content: center; padding: 18px 16px 6px; }
.tv-credit-link { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .08em; text-decoration: none; color: inherit; opacity: .72;
  padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(127,127,127,.28); transition: opacity .4s, border-color .4s, background .4s; }
.tv-credit-link b { font-weight: 500; border-bottom: 1px solid currentColor; }
.tv-credit-link:hover, .tv-credit-link:focus-visible { opacity: 1; border-color: var(--dorado); background: rgba(201,162,90,.08); }
.tv-credit-spark { width: 7px; height: 7px; border-radius: 50%; background: var(--dorado); box-shadow: 0 0 0 0 rgba(201,162,90,.6); animation: tvSpark 2.8s ease-in-out infinite; }
@keyframes tvSpark { 0%, 100% { box-shadow: 0 0 0 0 rgba(201,162,90,.5); } 50% { box-shadow: 0 0 0 6px rgba(201,162,90,0); } }
.tv-leave { position: fixed; left: 50%; bottom: 28px; z-index: 140; width: min(92vw, 420px); transform: translate(-50%, 20px); opacity: 0;
  background: var(--bosque); color: var(--crema); border-radius: 18px; padding: 16px 18px; box-shadow: 0 20px 50px rgba(0,0,0,.3);
  transition: opacity .4s var(--ease), transform .5s var(--ease-out); font-size: 14px; line-height: 1.5; }
.tv-leave.on { opacity: 1; transform: translate(-50%, 0); }
.tv-leave div { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.tv-leave-go { background: #25d366; color: #0b2e17; text-decoration: none; font-weight: 500; padding: 9px 16px; border-radius: 999px; font-size: 13px; }
.tv-leave-x { background: none; border: 1px solid rgba(239,236,230,.4); color: inherit; font: inherit; font-size: 13px; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .tv-credit-spark { animation: none; } }

/* Aviso de cookies (solo aparece si hay IDs de analítica) */
.tv-consent { position: fixed; left: 16px; bottom: 16px; z-index: 60; max-width: 420px; background: #efece6; color: #26332a; border-radius: 18px; padding: 16px 18px; box-shadow: 0 20px 50px rgba(0,0,0,.25); display: grid; gap: 12px; font-size: 14px; line-height: 1.5; }
.tv-consent a { color: inherit; }
.tv-consent div { display: flex; gap: 10px; justify-content: flex-end; }
.tv-consent button { font: inherit; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; padding: 10px 16px; border-radius: 999px; border: 1px solid rgba(38,51,42,.35); background: transparent; color: inherit; cursor: pointer; min-height: 40px; }
.tv-consent button[data-c="yes"] { background: #26332a; color: #efece6; border-color: #26332a; }
@media (max-width: 520px) { .tv-consent { right: 16px; max-width: none; } }
