/* ============================================================
   CLANDESTINO — Sección CARTA (integrada en el sitio)
   Usa los tokens de styles.css (oro, ink, Cormorant, Open Sauce).
   ============================================================ */

/* ---------- cabecera de la carta ---------- */
.carta-note {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 20px;
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(15px, 1.7vw, 18px); color: var(--cream-dim);
}
.carta-note .mini-coin { width: 20px; height: 20px; }
.carta-note b { color: var(--gold-2); font-style: normal; font-weight: 700; }

/* ---------- nav de categorías (chips) ---------- */
.carta-nav {
  position: sticky; top: 58px; z-index: 60;
  margin: 36px 0 40px;
  background: rgba(22, 6, 3, .82);
  backdrop-filter: blur(10px) saturate(1.1); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(228, 194, 110, .16); border-radius: 999px;
}
.carta-nav-inner {
  display: flex; gap: 8px; padding: 8px;
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
}
.carta-nav-inner::-webkit-scrollbar { display: none; }
.c-chip {
  flex: 0 0 auto; scroll-snap-align: start;
  font-family: var(--font-display); font-weight: 600; font-size: 12.5px;
  letter-spacing: .05em; text-transform: uppercase; color: var(--cream-dim);
  padding: 9px 16px; border-radius: 999px; border: 1px solid transparent;
  white-space: nowrap; cursor: pointer; transition: color .25s, background .25s;
}
.c-chip:hover { color: var(--cream); }
.c-chip.active { color: #3a230a; background: var(--gold-grad); }

/* ---------- categorías + grid ---------- */
.c-cat { margin-bottom: clamp(34px, 6vw, 56px); scroll-margin-top: 130px; }
.c-cat-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.c-cat-title {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  letter-spacing: .01em; font-size: clamp(18px, 3vw, 27px);
}
.c-cat-line { flex: 1; height: 1px; background: var(--gold-line); opacity: .5; }

.c-grid { display: grid; gap: clamp(12px, 2vw, 18px); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 680px) { .c-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .c-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- tarjeta ---------- */
.c-card {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--ink-900), var(--ink-950));
  border: 1px solid rgba(228, 194, 110, .14); border-radius: 18px;
  overflow: hidden; cursor: pointer;
  transition: transform .4s var(--ease), box-shadow .4s, border-color .3s;
}
.c-card:hover, .c-card:focus-visible {
  transform: translateY(-4px); border-color: rgba(228, 194, 110, .42);
  box-shadow: 0 18px 44px -18px rgba(199, 154, 63, .5);
}
.c-card:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
.c-card__media {
  position: relative; aspect-ratio: 1 / 1.04;
  background:
    radial-gradient(120% 90% at 50% 10%, rgba(228, 194, 110, .10), transparent 60%),
    linear-gradient(180deg, rgba(126, 35, 12, .10), rgba(22, 6, 3, .3));
  display: grid; place-items: center; overflow: hidden;
}
.c-card__media .ck-svg, .c-card__media .media-img { width: 100%; height: 100%; }
.c-card__media .media-img { object-fit: cover; }
.c-card__sheen {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .15) 48%, transparent 64%);
  transform: translateX(-120%);
}
.c-card.in .c-card__sheen { animation: cSheen 1.05s ease .15s 1 both; }
@keyframes cSheen { to { transform: translateX(120%); } }

.c-badge {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  font-family: var(--font-display); font-weight: 700; font-size: 10px;
  letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px;
}
.c-badge--star { color: #3a230a; background: var(--gold-grad); }
.c-badge--new { color: var(--gold-1); background: rgba(126, 35, 12, .5); border: 1px solid rgba(228, 194, 110, .3); }

.c-card__body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.c-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.c-desc {
  font-size: 12.5px; color: var(--cream-dim); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.c-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; }
.c-price { font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.c-abv { font-size: 10.5px; color: var(--cream-faint); border: 1px solid rgba(228, 194, 110, .16); border-radius: 999px; padding: 2px 8px; }
.c-abv--0 { color: #9FD08C; border-color: rgba(159, 208, 140, .3); }

/* ============================================================
   ANIMACIONES COPA (SVG)
   ============================================================ */
.ck-svg { display: block; }
.ck-bubble { fill: rgba(255, 255, 255, .55); }
.ck-ice { fill: rgba(255, 255, 255, .12); stroke: rgba(255, 255, 255, .28); stroke-width: 1; }
/* gate de rendimiento: solo animan las copas visibles */
.c-card .ck-bubble, .c-card .ck-surface, .c-card .ck-shine, .c-card .ck-gold-flakes { animation-play-state: paused; }
.c-card.viz .ck-bubble, .c-card.viz .ck-surface, .c-card.viz .ck-shine, .c-card.viz .ck-gold-flakes { animation-play-state: running; }
.ck-bubble { transform-box: fill-box; animation: ckRise var(--bd, 3.4s) linear var(--bdl, 0s) infinite; }
@keyframes ckRise {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: .85; } 85% { opacity: .55; }
  100% { transform: translateY(calc(var(--rise, 150px) * -1)); opacity: 0; }
}
.ck-surface { transform-box: fill-box; transform-origin: center; animation: ckBob 3.6s ease-in-out infinite; }
@keyframes ckBob { 0%, 100% { transform: translateY(0) scaleX(1); } 50% { transform: translateY(1.5px) scaleX(.985); } }
.ck-shine { animation: ckShine 6s ease-in-out infinite; }
@keyframes ckShine { 0% { transform: translateX(0); } 55%, 100% { transform: translateX(270px); } }
.ck-gold-flakes { animation: ckFlake 3s ease-in-out infinite; transform-origin: center; }
@keyframes ckFlake { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }

/* ============================================================
   FICHA (modal)
   ============================================================ */
body.carta-lock { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }

.c-modal { position: fixed; inset: 0; z-index: 200; display: none; }
.c-modal.open {
  display: grid; place-items: center;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
}
.c-modal__backdrop {
  position: absolute; inset: 0; background: rgba(12, 3, 1, .74);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: cFade .25s ease;
}
@keyframes cFade { from { opacity: 0; } to { opacity: 1; } }
.c-modal__panel {
  position: relative; z-index: 2; width: min(560px, 100%);
  max-height: 90vh; max-height: 90svh; overflow-y: auto;
  background: linear-gradient(180deg, #2a0c05, var(--ink-950));
  border: 1px solid rgba(228, 194, 110, .28); border-radius: 20px;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8);
  display: grid; grid-template-columns: 1fr; animation: cPop .35s var(--ease);
}
@media (min-width: 620px) { .c-modal__panel { grid-template-columns: 44% 1fr; } }
@keyframes cPop { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }

.c-modal__close {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(228, 194, 110, .3); background: rgba(0, 0, 0, .35); color: var(--cream);
  font-size: 16px; cursor: pointer; transition: background .25s, transform .25s;
}
.c-modal__close:hover { background: rgba(126, 35, 12, .5); transform: rotate(90deg); }

.c-modal__media-wrap {
  position: relative;
  background:
    radial-gradient(120% 80% at 50% 8%, rgba(228, 194, 110, .14), transparent 60%),
    linear-gradient(180deg, rgba(126, 35, 12, .18), rgba(22, 6, 3, .4));
  display: grid; place-items: center; min-height: 230px; padding: 12px;
}
.c-modal__media { width: 100%; max-width: 230px; aspect-ratio: 1 / 1.2; }
@media (max-width: 619px) { .c-modal__media-wrap { min-height: auto; } .c-modal__media { max-width: 160px; aspect-ratio: 1 / 1; } }
.c-modal__media .ck-svg, .c-modal__media .media-img { width: 100%; height: 100%; }
.c-modal__media .media-img { object-fit: contain; }
.c-modal__badge { position: absolute; top: 12px; left: 12px; }

.c-modal__info {
  padding: 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
}
.c-modal__name {
  font-family: var(--font-display); font-weight: 800; line-height: 1.05;
  font-size: clamp(24px, 5vw, 32px); text-transform: uppercase; letter-spacing: -.01em; overflow-wrap: anywhere;
}
.c-modal__abv { font-family: var(--font-serif); font-style: italic; font-size: 14px; color: var(--gold-2); }
.c-modal__desc { color: var(--cream-dim); font-size: 15px; margin-top: 4px; }
.c-modal__ings-h { font-family: var(--font-display); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-top: 8px; }
.c-modal__ings { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; }
.c-modal__ings li {
  font-size: 12px; color: var(--gold-1); background: rgba(126, 35, 12, .3);
  border: 1px solid rgba(228, 194, 110, .25); padding: 5px 11px; border-radius: 999px;
}
.c-modal__foot {
  margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid rgba(228, 194, 110, .12);
}
.c-modal__price { font-family: var(--font-display); font-weight: 800; font-size: 28px; }
.c-modal__hint {
  font-family: var(--font-serif); font-style: italic; font-size: 13px; color: var(--cream-dim);
  border: 1px dashed rgba(228, 194, 110, .3); padding: 6px 12px; border-radius: 999px;
}

/* gota signature al abrir (CSS puro, sin librerías) */
.c-modal__media .ck-drop { opacity: 0; }
.c-modal__media.playing .ck-drop { animation: cDrop .55s ease-in both; }
@keyframes cDrop { 0% { opacity: 0; transform: translateY(0); } 14% { opacity: 1; } 88% { opacity: 1; transform: translateY(58px); } 100% { opacity: 0; transform: translateY(58px); } }
.c-modal__media.playing .ck-surface { animation: cFlash .5s .42s ease-out; }
@keyframes cFlash { 0% { opacity: .26; } 35% { opacity: .8; } 100% { opacity: .26; } }

/* ---------- reveal ---------- */
.c-reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .7s var(--ease); }
.c-reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .ck-bubble, .ck-surface, .ck-shine, .ck-gold-flakes,
  .c-card__sheen, .c-modal__media .ck-drop, .c-modal__media .ck-surface { animation: none !important; }
  .c-reveal { opacity: 1; transform: none; }
}
