/* ═══════════════════════════════════════════════
   TIENDA DE RESERVAS — portal de socios Flora
   Mismo nocturno de la carta/portal (tokens td-*)
═══════════════════════════════════════════════ */
/* el fondo oscuro lo pone cada página (portal usa su propio style) */

:root {
  --td-bg:     #130d1c;
  --td-card:   #1b1326;
  --td-line:   rgba(183, 157, 230, 0.16);
  --td-cream:  #f4f1f7;
  --td-muted:  rgba(244, 241, 247, 0.55);
  --td-violet: #b79de6;
  --td-green:  #3cb492;
}

.td-main {
  min-height: 100svh;
  background: var(--td-bg);
  font-family: var(--font-ui);
  color: var(--td-cream);
  position: relative;
}
.td-main::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(55% 40% at 85% 0%, rgba(56, 31, 86, 0.45), transparent 70%),
    radial-gradient(50% 35% at 5% 100%, rgba(10, 80, 60, 0.14), transparent 70%);
  z-index: 0;
}
.td-main > * { position: relative; z-index: 1; }

.td-brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--td-violet); }
.td-brand svg { width: 30px; height: 30px; }
.td-brand-logo { height: 24px; width: auto; }
.td-brand-name { font-family: var(--font-display); font-size: 1.15rem; }
.td-brand-name em { font-style: italic; }
.td-title { font-family: var(--font-display); font-weight: 500; color: var(--td-cream); font-size: clamp(2rem, 5vw, 2.7rem); line-height: 1.05; }
.td-title em { font-style: italic; color: var(--td-violet); }
.td-sub { line-height: 1.6; color: var(--td-muted); font-size: 0.95rem; margin: 0; }
.td-msg { color: var(--td-violet); font-size: 0.9rem; }
.td-back { color: var(--td-muted); text-decoration: none; font-size: 0.9rem; }
.td-back:hover { color: var(--td-cream); }

/* ── Contenido ── */
.td-content { max-width: 1020px; margin: 0 auto; padding: clamp(24px, 3.5vw, 48px) clamp(18px, 3vw, 32px) 140px; }
.td-content[hidden] { display: none; }
.td-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.td-head .td-back { font-weight: 600; }
.td-logout {
  margin-left: auto;
  background: none; border: 1px solid var(--td-line); border-radius: 999px;
  color: var(--td-muted); font-family: var(--font-ui); font-size: 0.85rem; font-weight: 600;
  padding: 8px 18px; cursor: pointer; transition: color 0.2s ease, border-color 0.2s ease;
}
.td-logout:hover { color: var(--td-cream); border-color: var(--td-violet); }
.td-head-title { margin: 6px 0 4px; }
.td-head-sub { color: var(--td-muted); font-size: 0.95rem; max-width: 56ch; margin: 0 0 26px; }

/* Aviso de reserva en curso */
.td-activo {
  display: none; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(60, 180, 146, 0.1); border: 1px solid rgba(60, 180, 146, 0.35);
  border-radius: 14px; padding: 12px 16px; margin-bottom: 22px;
  font-size: 0.9rem; color: var(--td-cream);
}
.td-activo.is-on { display: flex; }
.td-activo strong { color: var(--td-green); }

/* ── Cards de producto (con foto) ── */
.td-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 700px) { .td-grid { grid-template-columns: repeat(var(--td-cols, 3), 1fr); } }
.td-item {
  background: var(--td-card); border: 1px solid var(--td-line); border-radius: 20px;
  overflow: hidden; display: flex; flex-direction: column;
}
.td-item-img { width: 100%; aspect-ratio: 4 / 3.4; object-fit: cover; display: block; }
.td-item-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.td-item-label { font-weight: 700; font-size: 1.05rem; color: var(--td-cream); }
.td-item-detalle { font-size: 0.85rem; color: var(--td-muted); }
.td-item-precio { font-size: 1.2rem; font-weight: 700; color: var(--td-green); font-variant-numeric: tabular-nums; margin-top: 6px; }

/* Menú sin foto (extracciones) */
.td-menu { display: flex; flex-direction: column; gap: 12px; }
.td-menu .td-item { flex-direction: row; align-items: center; }
.td-menu .td-item-icon { flex: 0 0 auto; width: 54px; height: 54px; margin-left: 16px; border-radius: 50%; background: rgba(183,157,230,0.14); color: var(--td-violet); display: flex; align-items: center; justify-content: center; }
.td-menu .td-item-icon svg { width: 26px; height: 26px; }
.td-menu .td-item-body { flex-direction: row; align-items: center; gap: 14px; }
.td-menu .td-item-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.td-menu .td-item-precio { margin: 0 6px 0 0; }

/* Stepper */
/* Misma "pastilla" que resolvimos en la carta de flores (.gn-qty): contorno
   redondeado que se enciende con el color del producto cuando hay cantidad,
   en vez de dos cajas sueltas con borde suelto. --oil lo pisan las fichas de
   aceites/cremas/extracciones; sin eso cae al violeta de marca. */
.td-stepper {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  border: 1px solid var(--td-line); border-radius: 10px; padding: 6px 10px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.td-menu .td-stepper { margin: 0; }
.td-stepper.has-qty {
  border-color: var(--oil, var(--td-violet));
  background: color-mix(in srgb, var(--oil, var(--td-violet)) 16%, transparent);
}
.td-step-num {
  min-width: 22px; text-align: center; font-weight: 800; font-size: 1.1rem;
  font-variant-numeric: tabular-nums; color: var(--td-muted); transition: color 0.2s ease;
}
.td-stepper.has-qty .td-step-num { color: var(--oil, var(--td-violet)); }
.td-step-col { display: flex; flex-direction: column; gap: 3px; flex-shrink: 0; }
.td-step-btn {
  width: 30px; height: 21px; border-radius: 7px; border: none;
  background: rgba(244,241,247,0.1); color: var(--td-cream); font-size: 1rem; font-weight: 800; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0; transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.td-step-btn:hover:not(:disabled) { background: var(--oil, var(--td-violet)); color: #170c2b; }
.td-step-btn:active:not(:disabled) { transform: scale(0.92); }
.td-step-btn:disabled { opacity: 0.3; cursor: default; }

/* ── Barra de reserva flotante ── */
.td-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(140%);
  z-index: 50; display: flex; align-items: center; gap: 16px;
  background: var(--td-card); border: 1px solid rgba(183,157,230,0.4);
  border-radius: 999px; padding: 10px 12px 10px 22px;
  box-shadow: 0 18px 50px -12px rgba(0,0,0,0.8);
  transition: transform 0.35s cubic-bezier(0.33, 1, 0.68, 1);
  max-width: min(92vw, 560px);
}
.td-bar.is-on { transform: translateX(-50%) translateY(0); }
.td-bar-info { font-size: 0.92rem; color: var(--td-cream); white-space: nowrap; }
.td-bar-info strong { color: var(--td-green); }
.td-bar-btn {
  border: none; background: var(--td-violet); color: #170c2b;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.95rem;
  padding: 12px 22px; border-radius: 999px; cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease; white-space: nowrap;
}
.td-bar-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.td-bar-btn:disabled { opacity: 0.5; cursor: default; }

/* Confirmación */
.td-done {
  display: none; background: var(--td-card); border: 1px solid rgba(60,180,146,0.4);
  border-radius: 18px; padding: 22px 24px; margin-top: 26px;
}
.td-done.is-on { display: block; }
.td-done h3 { color: var(--td-green); font-size: 1.05rem; margin: 0 0 8px; }
.td-done p { color: var(--td-muted); font-size: 0.9rem; margin: 0 0 4px; }
.td-done .td-done-items { color: var(--td-cream); font-size: 0.92rem; margin: 8px 0; }

/* ── Compra dentro de cards claras (fichas técnicas) ── */
.td-content-wide { max-width: 1240px; }
.td-spec-grid { margin-top: 6px; }
.td-buy {
  display: flex; flex-direction: column; gap: 6px;
  margin: 16px 0 4px; padding: 12px 14px; border-radius: 12px;
  background: rgba(10, 80, 60, 0.06);
}
/* El [hidden] nativo perdía contra "display: flex" (misma especificidad,
   la regla de autor gana al estilo por defecto del browser) */
.td-buy[hidden] { display: none; }
.td-buy-label {
  font-family: var(--font-ui); font-size: 0.64rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fl-green, #0A503C); opacity: 0.8;
}
.td-buy-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.td-buy .td-precio {
  font-size: 1.5rem; font-weight: 800; color: var(--fl-green, #0A503C);
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.td-onlight .td-stepper { border-color: rgba(56, 31, 86, 0.18); }
.td-onlight .td-stepper.has-qty { border-color: var(--oil, var(--fl-violet, #381F56)); }
.td-onlight .td-step-btn { color: var(--fl-ink, #1C1626); background: rgba(28, 22, 38, 0.06); }
.td-onlight .td-step-btn:hover:not(:disabled) { background: var(--oil, var(--fl-violet, #381F56)); color: #fff; }
.td-onlight .td-step-num { color: rgba(28, 22, 38, 0.55); }
.td-onlight .td-stepper.has-qty .td-step-num { color: var(--oil, var(--fl-violet, #381F56)); }

/* Sección de la landing embebida en la tienda (fondo blanco, full-bleed suave) */
.td-landing-section { border-radius: 26px; margin-top: 10px; }
.td-content-wide { max-width: 1300px; }

/* ═══ Páginas públicas de catálogo (fondo claro de la landing) ═══ */
/* Nav = .site-nav compartido con el resto del sitio (global.css), siempre
   forzado a "scrolled" acá porque no hay hero oscuro debajo — por eso el
   padding-top: compensa que .site-nav es fixed (60px de alto). */
.td-public { background: var(--fl-paper, #fff); min-height: 100svh; padding-top: 60px; }

/* Categoría activa dentro del dropdown "Servicios" (el home no la usa,
   ninguno de sus links de categoría es "actual" de forma persistente) */
.nav-dropdown-menu a.is-active,
.drawer-dropdown-menu a.is-active { color: var(--fl-violet, #381F56) !important; background: var(--fl-paper-2, #F6F4F2); }

.td-activo-pub { margin: 18px clamp(24px, 6vw, 80px) 0; background: rgba(10,80,60,0.07); border-color: rgba(10,80,60,0.3); color: var(--fl-ink, #1C1626); }
.td-activo-pub strong { color: var(--fl-green, #0A503C); }
.td-done-pub { margin: 0 clamp(24px, 6vw, 80px) 26px; background: #fff; border-color: rgba(10,80,60,0.35); }
.td-done-pub h3 { color: var(--fl-green, #0A503C); }
.td-done-pub p { color: rgba(28,22,38,0.6); }
.td-done-pub .td-done-items { color: var(--fl-ink, #1C1626); }

/* Cremas: una sola card centrada, mismo tamaño de foto/tipografía que usa
   .td-ext-grid en Extracciones (antes 520px de ancho, se veía desproporcionada
   frente al resto del catálogo) */
.td-grid-1-compact { grid-template-columns: minmax(0, 300px) !important; justify-content: center; }
/* El aspect-ratio de la IMG no alcanza solo: hereda width/height:100% de
   .fl-oil-photo img (global.css), así que la forma real la define el
   contenedor — sin esto seguía saliendo 4:5 (alto), no cuadrada */
.td-grid-1-compact .fl-oil-photo { aspect-ratio: 1 / 1; }
.td-grid-1-compact .fl-oil-photo img, .td-grid-1-compact .td-ext-visual { aspect-ratio: 1 / 1; }
.td-grid-1-compact .fl-oil-body { padding: 14px 16px 16px; }
.td-grid-1-compact .fl-oil-title { font-size: 14px; margin-bottom: 6px; }
.td-grid-1-compact .fl-oil-desc { font-size: 12.5px; line-height: 1.5; margin-bottom: 12px; }
.td-grid-1-compact .fl-oil-badge { font-size: 11px; padding: 5px 10px; }
.td-grid-1-compact .fl-oil-btn { font-size: 12.5px; padding: 10px 14px; }
.td-grid-1-compact .fl-oil-btn svg { width: 14px; height: 14px; }
.td-grid-1-compact .td-buy { margin: 10px 0 2px; padding: 8px 10px; }
.td-grid-1-compact .td-buy .td-precio { font-size: 1.2rem; font-weight: 800; }
.td-grid-1-compact .td-onlight .td-step-btn { width: 24px; height: 17px; }
.td-grid-1-compact .td-step-num { font-size: 0.95rem; min-width: 18px; }
.td-grid-1-compact .fl-oil-para { padding-top: 12px; margin-bottom: 14px; }
.td-grid-1-compact .fl-oil-para-label { font-size: 10px; margin-bottom: 7px; }
.td-grid-1-compact .fl-oil-para-list { gap: 5px; }
.td-grid-1-compact .fl-oil-para-list li { font-size: 12px; padding-left: 15px; }
.td-grid-1-compact .fl-oil-para-list li::before { width: 6px; height: 6px; top: 5px; }

/* Socio logueado en fichas: fuera Acceso socios/Asociarme, entra Carrito */
body.is-socio .td-pub-socios, body.is-socio .td-pub-cta { display: none; }
.td-pub-carrito {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--fl-violet, #381F56); color: #fff; text-decoration: none;
  font-family: var(--font-ui); font-weight: 700; font-size: 13px;
  padding: 10px 20px; border-radius: 999px;
}
.td-pub-carrito[hidden] { display: none; }
.td-pub-carrito .nav-carrito-n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #4FC79E; color: #14231b; font-size: 11px; font-weight: 800;
}
.td-pub-carrito .nav-carrito-n[hidden] { display: none; }

/* ═══ Panel de carrito de reservas (drawer) ═══ */
#td-cart { position: fixed; inset: 0; z-index: 100000; pointer-events: none; }
#td-cart .td-cart-overlay {
  position: absolute; inset: 0; background: rgba(10, 6, 16, 0.55);
  opacity: 0; transition: opacity 0.3s ease;
}
#td-cart .td-cart-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(420px, 94vw);
  background: var(--td-card, #1b1326); color: var(--td-cream, #f4f1f7);
  font-family: var(--font-ui);
  box-shadow: -24px 0 60px rgba(0,0,0,0.5);
  transform: translateX(105%); transition: transform 0.35s cubic-bezier(0.33, 1, 0.68, 1);
  display: flex; flex-direction: column;
}
#td-cart.is-open { pointer-events: auto; }
#td-cart.is-open .td-cart-overlay { opacity: 1; }
#td-cart.is-open .td-cart-panel { transform: translateX(0); }

.td-cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 14px; border-bottom: 1px solid var(--td-line, rgba(183,157,230,0.16));
}
.td-cart-head h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.4rem; margin: 0; }
.td-cart-head h2 em { font-style: italic; color: var(--td-violet, #b79de6); }
.td-cart-close {
  background: none; border: 1px solid var(--td-line, rgba(183,157,230,0.16)); border-radius: 50%;
  width: 34px; height: 34px; color: var(--td-muted, rgba(244,241,247,0.55));
  cursor: pointer; font-size: 0.9rem;
}
.td-cart-close:hover { color: #fff; border-color: var(--td-violet, #b79de6); }

.td-cart-body { padding: 18px 22px 26px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 18px; }
.td-cart-sec h3 {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--td-violet, #b79de6); margin: 0 0 10px; display: flex; align-items: center; gap: 8px;
}
.td-cart-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--td-line, rgba(183,157,230,0.16));
}
.td-cart-row:first-child { border-top: none; }
.td-cart-row-nombre { flex: 1; font-size: 0.9rem; font-weight: 600; min-width: 0; }
.td-cart-row-nombre i { font-style: normal; font-weight: 400; color: var(--td-muted, rgba(244,241,247,0.55)); font-size: 0.8rem; }
.td-cart-row-precio { font-size: 0.9rem; font-weight: 700; color: var(--td-green, #3cb492); white-space: nowrap; font-variant-numeric: tabular-nums; }
.td-cart-row-cant { font-weight: 700; color: var(--td-green, #3cb492); white-space: nowrap; }
.td-cart-quitar {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  background: none;
  border: 1px solid var(--td-line, rgba(244,241,247,0.18));
  border-radius: 8px;
  color: rgba(242, 129, 138, 0.9);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}
.td-cart-quitar:hover { border-color: rgba(242, 129, 138, 0.6); }
.td-cart-row .td-stepper { margin: 0; gap: 8px; }
.td-cart-row .td-step-btn { width: 26px; height: 18px; font-size: 0.85rem; }
.td-cart-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--td-line, rgba(183,157,230,0.16));
  font-size: 0.85rem; color: var(--td-muted, rgba(244,241,247,0.55));
}
.td-cart-total strong { font-size: 1.2rem; color: var(--td-green, #3cb492); font-variant-numeric: tabular-nums; }
.td-cart-send { width: 100%; margin-top: 12px; padding: 14px; }
.td-cart-badge { font-size: 0.66rem; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.08em; }
.td-cart-badge.is-pendiente { background: rgba(183,157,230,0.16); color: var(--td-violet, #b79de6); }
.td-cart-badge.is-listo { background: rgba(60,180,146,0.18); color: var(--td-green, #3cb492); }
.td-cart-cancel {
  margin-top: 10px; background: none; border: 1px solid var(--td-line, rgba(183,157,230,0.16));
  border-radius: 999px; color: var(--td-muted, rgba(244,241,247,0.55));
  font-family: var(--font-ui); font-size: 0.82rem; font-weight: 600; padding: 9px 18px; cursor: pointer;
}
.td-cart-cancel:hover { color: #ff9d9d; border-color: rgba(255,120,120,0.5); }
.td-cart-vacio { color: var(--td-muted, rgba(244,241,247,0.55)); font-size: 0.9rem; line-height: 1.55; margin: 0; }
.td-cart-vacio[hidden] { display: none; }
.td-cart-msg { color: #4FC79E; font-weight: 700; font-size: 0.9rem; margin: 0; }
/* .td-cart-body es flex-column sin align-items (default: stretch), y la
   tarjeta black tiene su propio width fijo — sin esto quedaba pegada a
   la izquierda en vez de centrada. */
.td-cart-body .fl-acceso-card { align-self: center; }
.td-cart-hint { font-size: 0.78rem; color: var(--td-muted, rgba(244,241,247,0.55)); line-height: 1.5; margin: 0; }
@media (max-width: 560px) {
  #td-cart .td-cart-panel { width: 100vw; }
}

/* Edición de la reserva activa */
.td-cart-act-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.td-cart-guardar { flex: 1; padding: 12px; }
.td-cart-row-activo.is-quitado .td-cart-row-nombre { opacity: 0.45; text-decoration: line-through; }
.td-cart-row-activo.is-quitado .td-cart-row-nombre i { font-style: normal; text-decoration: none; color: #ff9d9d; font-size: 0.75rem; }
.td-stepper-act .td-step-num { min-width: 40px; font-size: 0.95rem; }
.td-cart-row-activo .td-stepper { margin-top: 0; }

/* Pie del carrito: cuenta + logout, discretos */
.td-cart-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--td-line, rgba(183,157,230,0.16));
}
.td-cart-cuenta { color: var(--td-muted, rgba(244,241,247,0.55)); font-size: 0.85rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.td-cart-cuenta:hover { color: #fff; }
.td-cart-logout {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--font-ui); font-size: 0.85rem; font-weight: 600;
  color: var(--td-muted, rgba(244,241,247,0.55));
}
.td-cart-logout:hover { color: #ff9d9d; }

/* Extracciones: 4 fichas compactas en fila (desktop) / 2 (tablet) / 1 (mobile) */
.td-ext-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 14px; }
@media (max-width: 1000px) { .td-ext-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 600px) { .td-ext-grid { grid-template-columns: 1fr !important; } }
/* compactar la anatomía de la card en esta grilla */
.td-ext-grid .fl-oil-photo img, .td-ext-grid .td-ext-visual { aspect-ratio: 1 / 1; }
.td-ext-grid .fl-oil-body { padding: 14px 16px 16px; }
.td-ext-grid .fl-oil-title { font-size: 14px; margin-bottom: 6px; }
.td-ext-grid .fl-oil-desc { font-size: 12.5px; line-height: 1.5; margin-bottom: 12px; }
.td-ext-grid .fl-oil-badge { font-size: 11px; padding: 5px 10px; }
.td-ext-grid .fl-oil-btn { font-size: 12.5px; padding: 10px 14px; }
.td-ext-grid .fl-oil-btn svg { width: 14px; height: 14px; }
.td-ext-grid .td-buy { margin: 10px 0 2px; padding: 8px 10px; }
.td-ext-grid .td-buy .td-precio { font-size: 1.2rem; font-weight: 800; }
.td-ext-grid .td-onlight .td-step-btn { width: 24px; height: 17px; }
.td-ext-grid .td-step-num { font-size: 0.95rem; min-width: 18px; }
.td-ext-visual {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(60% 50% at 70% 20%, rgba(56, 31, 86, 0.1), transparent 70%),
    linear-gradient(160deg, #F6F1E9 0%, #EFE6F2 100%);
}
.td-ext-visual svg { width: 88px; height: 88px; opacity: 0.9; }
