/* ==========================================================================
   TITÁN STUDIOS — Base: tokens, tipografía, componentes compartidos
   Paleta tomada del prototipo de NEXORA.
   ========================================================================== */
:root {
  --bg: #111111;
  --bg-2: #161616;
  --surface: #1f1f1f;
  --surface-2: #262626;
  --field: #353535;
  --field-hover: #3f3f3f;
  --line: #2e2e2e;
  --line-2: #3a3a3a;

  --text: #f4f2ee;
  --text-2: #b9b6b0;
  --muted: #8a8782;
  --sand: #e9e2d6;        /* botones primarios */
  --sand-2: #c8b8a0;      /* barras, subtítulos, estados */
  --sand-ink: #121212;

  --ok: #9fc8a6;
  --warn: #e3c07b;
  --danger: #e38b7b;
  --info: #9fb4c8;

  --ring: conic-gradient(from 210deg, #f9ce34, #ee2a7b, #6228d7, #ee2a7b, #f9ce34);

  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .45);

  --font: "Helvetica Neue", Helvetica, Inter, "Segoe UI", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --container: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
svg { width: 1.25em; height: 1.25em; flex: none; }
:focus-visible { outline: 2px solid var(--sand-2); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--sand-2); color: var(--sand-ink); }

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sand-2); }
.muted { color: var(--muted); }
.sand { color: var(--sand-2); }

/* ---------- botones ---------- */
.btn {
  --h: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 22px; border-radius: var(--r-sm);
  font-weight: 700; font-size: 16px; white-space: nowrap;
  transition: transform .2s var(--ease), background-color .2s, color .2s, box-shadow .2s, opacity .2s;
  position: relative; overflow: hidden;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn--primary { background: var(--sand); color: var(--sand-ink); }
.btn--primary:hover { background: #fff; box-shadow: 0 8px 24px rgba(233, 226, 214, .15); }
.btn--dark { background: var(--surface-2); color: var(--text); }
.btn--dark:hover { background: var(--field); }
.btn--ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--sand-2); color: var(--sand); }
.btn--danger { background: var(--danger); color: var(--sand-ink); }
.btn--wa { background: #25d366; color: #0b2614; }
.btn--wa:hover { background: #3be07a; }
.btn--sm { --h: 36px; padding: 0 14px; font-size: 14px; }
.btn--lg { --h: 52px; padding: 0 26px; }
.btn--block { width: 100%; }
/* brillo al pasar (inferido del acabado "premium" de los CTA) */
.btn--primary::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
}
.btn--primary:hover::after { transition: transform .7s var(--ease); transform: translateX(120%) skewX(-18deg); }

.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: var(--r-sm);
  color: var(--text-2); transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- formularios ---------- */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px; border-radius: var(--r-sm);
  background: var(--field); border: 1px solid transparent; color: var(--text);
  transition: border-color .2s, background .2s;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { background: var(--field-hover); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--sand-2); }
.input.is-invalid { border-color: var(--danger); }
.select { appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b9b6b0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.hint { font-size: 12px; color: var(--muted); }
.error-text { font-size: 12px; color: var(--danger); }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { width: 42px; height: 24px; border-radius: 99px; background: var(--field); position: relative; transition: background .25s; flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-2); transition: transform .25s var(--ease-out), background .25s; }
.switch input:checked + .switch__track { background: var(--sand-2); }
.switch input:checked + .switch__track::after { transform: translateX(18px); background: var(--sand-ink); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--sand-2); outline-offset: 2px; }

/* chips / opciones seleccionables (servicio, horario, talle) */
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 16px; border-radius: var(--r-sm);
  background: var(--field); color: var(--text); font-size: 16px; text-align: left;
  border: 1px solid transparent;
  transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease);
}
.chip:hover { background: var(--field-hover); }
.chip.is-selected { background: var(--sand); color: var(--sand-ink); font-weight: 700; }
.chip:disabled, .chip.is-disabled { opacity: .32; text-decoration: line-through; pointer-events: none; }
.chip.pop { animation: pop .32s var(--ease-out); }
@keyframes pop { 0% { transform: scale(.94); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge--sand { background: rgba(200, 184, 160, .16); color: var(--sand-2); }
.badge--ok { background: rgba(159, 200, 166, .14); color: var(--ok); }
.badge--warn { background: rgba(227, 192, 123, .14); color: var(--warn); }
.badge--danger { background: rgba(227, 139, 123, .14); color: var(--danger); }
.badge--info { background: rgba(159, 180, 200, .14); color: var(--info); }
.badge--solid { background: var(--sand); color: var(--sand-ink); }

.card { background: var(--surface); border-radius: var(--r); }

/* ---------- logo con anillo tipo "historia" ---------- */
.logo { display: inline-flex; align-items: center; gap: 14px; }
.logo__mark { width: 62px; height: 62px; border-radius: 50%; padding: 3px; background: var(--ring); position: relative; flex: none; }
.logo__mark img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #000; background: #000; }
.logo:hover .logo__mark { animation: ring-spin 2.4s linear infinite; }
.logo:hover .logo__mark img { animation: ring-spin 2.4s linear infinite reverse; }
@keyframes ring-spin { to { transform: rotate(360deg); } }
.logo__text { display: grid; line-height: 1; }
.logo__text b { font-size: 26px; letter-spacing: .02em; }
.logo__text small { font-size: 11.5px; letter-spacing: .32em; margin-top: 6px; color: var(--text-2); }

/* ---------- capas: modal / drawer ---------- */
.layer { position: fixed; inset: 0; z-index: 100; }
.layer__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); backdrop-filter: blur(3px); opacity: 0; transition: opacity .28s; }
.layer__panel { position: absolute; background: var(--surface); color: var(--text); box-shadow: var(--shadow); outline: none; overflow: auto; transition: transform .32s var(--ease-out), opacity .28s; }
.layer__close { position: absolute; top: 12px; right: 12px; z-index: 2; }
.layer__body { padding: 28px; }
.layer.is-open .layer__backdrop { opacity: 1; }
.layer--modal .layer__panel { left: 50%; top: 50%; width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px); border-radius: var(--r-lg); transform: translate(-50%, -46%) scale(.97); opacity: 0; }
.layer--modal.is-open .layer__panel { transform: translate(-50%, -50%); opacity: 1; }
.layer--sm .layer__panel { width: min(420px, calc(100vw - 24px)); }
.layer--lg .layer__panel { width: min(960px, calc(100vw - 24px)); }
.layer--drawer .layer__panel { top: 0; right: 0; bottom: 0; width: min(440px, 100vw); transform: translateX(100%); display: flex; flex-direction: column; }
.layer--drawer.is-open .layer__panel { transform: none; }
.layer--drawer .layer__body { flex: 1; display: flex; flex-direction: column; padding: 0; min-height: 0; }
.dialog-title { font-size: 20px; padding-right: 32px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 200; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r); background: var(--sand); color: var(--sand-ink); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); transform: translateY(16px); opacity: 0; transition: transform .3s var(--ease-out), opacity .3s; }
.toast.is-in { transform: none; opacity: 1; }
.toast--error { background: var(--danger); }
.toast__icon { display: grid; }

/* ---------- reveal al hacer scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease) var(--d, 0ms), transform .7s var(--ease-out) var(--d, 0ms); }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* transición entre vistas */
.view-enter { animation: view-in .45s var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* skeleton de carga de imágenes */
.img-wrap { position: relative; overflow: hidden; background: linear-gradient(100deg, #1d1d1d 30%, #262626 50%, #1d1d1d 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.img-wrap img { opacity: 0; transition: opacity .5s, transform .7s var(--ease-out); }
.img-wrap img.is-loaded { opacity: 1; }
.img-wrap.is-loaded { animation: none; background: var(--surface); }
@keyframes shimmer { to { background-position: -150% 0; } }

/* tablas */
.table-wrap { overflow-x: auto; border-radius: var(--r); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .025); }
.table tr:last-child td { border-bottom: 0; }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.empty svg { width: 36px; height: 36px; color: var(--line-2); }

/* qty stepper */
.qty { display: inline-flex; align-items: center; background: var(--field); border-radius: var(--r-sm); }
.qty button { width: 34px; height: 34px; display: grid; place-items: center; color: var(--text-2); }
.qty button:hover { color: var(--text); }
.qty button svg { width: 16px; height: 16px; }
.qty span { min-width: 26px; text-align: center; font-weight: 700; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
