/* Valores por defecto; css/theme.css (generado desde clinic.config.mjs) los reemplaza con los colores de cada clínica */
:root {
  --bg: #fdfaff; --alt: #f6eff9; --ink: #2a1b33; --muted: #6d5c78; --line: #eadff0;
  --accent: #7b3fa0; --accent-dark: #5a2b7a; --pink: #d6559f; --gold: #c9a45c;
  --ok: #2f7d4f; --bad: #b3261e;
  --nav-bg: #3d1757; --nav-ink: #ead6a4; --nav-line: #5a2b7a;
  --shadow: 0 10px 30px rgba(61, 23, 87, .08);
  --radius: 20px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.6; }
h1, h2, h3 { font-family: "Cormorant Garamond", Georgia, serif; line-height: 1.15; margin: 0 0 .6em; }
h1 { font-size: clamp(2.3rem, 6.5vw, 4rem); }
h2 { font-size: clamp(2rem, 4.5vw, 2.8rem); text-align: center; color: var(--accent-dark); }
h2.left { text-align: left; }
a { color: var(--accent); }
img { max-width: 100%; }

.kicker { text-align: center; text-transform: uppercase; letter-spacing: .22em; font-size: .78rem; font-weight: 600;
  color: color-mix(in srgb, var(--pink) 72%, #000); margin: 0 0 .5rem; }
.kicker-left { text-align: left; }
.note, .sub { text-align: center; color: var(--muted); }
.sub { margin-top: 2.5rem; color: var(--ink); font-size: 1.6rem; }

/* Barra superior */
.nav { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: .35rem 1.2rem; background: var(--nav-bg); border-bottom: 1px solid var(--nav-line); box-shadow: 0 2px 14px rgba(0, 0, 0, .18); }
.nav nav { display: flex; gap: 1.2rem; align-items: center; }
.nav nav a:not(.btn) { text-decoration: none; color: var(--nav-ink); font-size: .95rem; }
.nav nav a:not(.btn):hover { color: #fff; }
.logo { display: block; line-height: 0; }
.logo img { height: 54px; width: auto; display: block; }
@media (max-width: 680px) { .nav nav a:not(.btn) { display: none; } }

/* Botones */
.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; padding: .8rem 1.6rem; border-radius: 999px;
  font: 600 1rem Inter, sans-serif; text-decoration: none; cursor: pointer; transition: background .2s, transform .2s, box-shadow .2s; }
.btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-small { padding: .45rem 1rem; font-size: .9rem; }
.btn-gold { background: linear-gradient(135deg, #ecd394, var(--gold)); color: var(--nav-bg); box-shadow: 0 6px 18px rgba(201, 164, 92, .35); }
.btn-gold:hover { background: linear-gradient(135deg, #f3dea8, var(--gold)); }
.btn-outline-light { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .6); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .12); }
.actions { text-align: center; display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }

/* Portada: morado de la clínica con la luz del foco sobre el logo dorado */
.hero { position: relative; display: grid; place-items: center; text-align: center; min-height: 88vh;
  padding: 3rem 1.2rem 4.5rem; color: #f7eefb; background: var(--nav-bg);
  background:
    radial-gradient(ellipse 55% 40% at 50% 0%, rgba(255, 255, 255, .22), transparent 70%),
    radial-gradient(ellipse 70% 55% at 100% 100%, color-mix(in srgb, var(--pink) 50%, transparent), transparent 70%),
    linear-gradient(160deg, var(--nav-bg) 0%, var(--accent-dark) 55%, var(--accent) 100%); }
.hero-inner { max-width: 720px; width: 100%; }
.hero-logo { width: min(360px, 78vw); height: auto; display: block; margin: 0 auto 1.2rem;
  filter: drop-shadow(0 6px 22px rgba(0, 0, 0, .35)); }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .2em; font-size: .82rem; color: var(--nav-ink); margin: 0; }
.hero h1 { color: #fff; margin: .35em 0 .4em; }
.hero .lead { font-size: 1.1rem; color: rgba(255, 255, 255, .88); max-width: 560px; margin: 0 auto 1.8rem; }

/* Secciones */
.section { padding: 4.5rem 1.2rem; max-width: 1100px; margin: 0 auto; }
.section.alt { max-width: none; background: var(--alt); }
.section.alt > * { max-width: 1100px; margin-left: auto; margin-right: auto; }

/* Tratamientos por categoría */
.category { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem;
  margin-top: 1.4rem; box-shadow: var(--shadow); }
.category > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.category > summary::-webkit-details-marker { display: none; }
.cat-title { font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(1.5rem, 3.5vw, 1.9rem); font-weight: 700; color: var(--accent-dark); }
.cat-title::before { content: "✦ "; color: var(--gold); }
.cat-count { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.cat-count::after { content: " ▾"; color: var(--accent); }
.category[open] .cat-count::after { content: " ▴"; }
.cat-intro { color: var(--muted); margin: .5rem 0 1rem; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .8rem; }
.service { position: relative; display: flex; flex-direction: column; gap: .3rem; padding: 1.1rem 1.1rem .9rem; border-radius: 14px;
  border: 1px solid var(--line); background: linear-gradient(180deg, #fff, #fcf8fe); color: var(--ink); text-decoration: none;
  overflow: hidden; transition: border-color .2s, transform .2s, box-shadow .2s; }
.service::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--pink)); }
.service:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.service h3 { font: 600 1rem/1.3 Inter, sans-serif; margin: 0; color: var(--accent-dark); }
.service p { margin: 0; font-size: .9rem; color: var(--muted); flex: 1; }
.service-meta { display: flex; justify-content: space-between; align-items: center; margin-top: .5rem; font-size: .8rem; }
.dur { background: var(--alt); color: var(--accent-dark); padding: .1rem .6rem; border-radius: 999px; }
.go { color: var(--pink); font-weight: 600; }

/* Sobre mí */
.about { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 2.5rem; align-items: center; }
.photo-frame { position: relative; z-index: 0; margin: 0 14px 14px 0; }
.photo-frame::after { content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 2px solid var(--gold); border-radius: var(--radius); z-index: -1; }
.photo { position: relative; width: 100%; min-height: 320px; max-height: 480px; object-fit: cover; object-position: center 25%;
  display: block; border-radius: var(--radius); box-shadow: var(--shadow); }
.credentials { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .7rem; }
.credentials li { position: relative; padding-left: 1.7rem; }
.credentials li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--gold); font-weight: 700; }

/* Galería de la clínica */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; margin-top: 1.6rem; }
.gallery figure { margin: 0; overflow: hidden; border-radius: 18px; aspect-ratio: 3 / 4; box-shadow: var(--shadow); background: var(--alt); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.gallery figure:hover img { transform: scale(1.04); }
@media (max-width: 820px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Opiniones */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem; margin: 0; }
.card cite { display: block; margin-top: .6rem; color: var(--muted); font-size: .9rem; }

/* Agenda */
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; display: block; }
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; }
.booking { max-width: 560px !important; margin: 1.5rem auto 0; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--pink);
  border-radius: var(--radius); padding: 1.6rem; display: grid; gap: 1rem; box-shadow: var(--shadow); }
.install { max-width: 560px; margin: 1.5rem auto 0; background: var(--alt); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.4rem; display: grid; gap: .6rem; }
.install p { margin: 0; }
.install-title { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.4rem; font-weight: 700; color: var(--accent-dark); }
.install-text, .install-steps { font-size: .95rem; color: var(--muted); }
.install ol { margin: .3rem 0 0; padding-left: 1.2rem; }
.install .btn { justify-self: start; }
label, .label { display: grid; gap: .3rem; font-weight: 500; font-size: .95rem; margin: 0; }
input, select { font: inherit; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; width: 100%; color: var(--ink); }
input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.check input { width: auto; margin-top: .3rem; }
form { display: grid; gap: .9rem; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: .5rem; }
.slots > :not(.slot) { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .95rem; }
.slot { padding: .6rem; border-radius: 12px; border: 1px solid var(--accent); background: #fff; color: var(--accent-dark); font: 600 .9rem Inter; cursor: pointer; }
.slot:hover, .slot.sel { background: var(--accent); color: #fff; }
.slot:disabled { border-color: var(--line); color: #b9afa9; background: #f4eff6; text-decoration: line-through; cursor: not-allowed; }
.warn { background: #fff3cd; padding: .7rem; border-radius: 10px; margin: 0; }
.result { padding: 1.2rem 1.3rem; border-radius: var(--radius); margin: 0; background: var(--alt); color: var(--ink);
  border: 1px solid var(--line); border-left: 4px solid var(--ok); display: grid; gap: .6rem; line-height: 1.5; }
.result strong { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.5rem; color: var(--accent-dark); font-weight: 700; }
.result small { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.result .btn { justify-self: start; text-decoration: none; }
.result.err { background: #fff8f7; border-left-color: var(--bad); color: var(--bad); }

/* Página de la cita (enlace privado del paciente) */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem; margin: 0 0 1rem;
  display: grid; gap: .8rem; box-shadow: var(--shadow); }
.panel p { margin: 0; }
.panel .tag { font-size: .8rem; font-weight: 600; padding: .15rem .7rem; border-radius: 999px; background: #fff3cd; }
.panel .tag.confirmada { background: #e8f5ec; color: var(--ok); }
.panel .tag.cancelada { background: #fdecea; color: var(--bad); }

/* Ubicación */
.info-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem; box-shadow: var(--shadow); }
.map-embed { width: 100%; min-height: 320px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }

/* Pie de página */
footer { background: var(--nav-bg); color: rgba(255, 255, 255, .78); text-align: center; padding: 2.5rem 1rem 5rem; }
footer p { margin: .3rem 0; }
footer .small { font-size: .85rem; color: rgba(255, 255, 255, .6); }
.footer-logo { width: min(220px, 60vw); height: auto; margin-bottom: .6rem; }
.footer-link { color: var(--nav-ink); }
.wa-float { position: fixed; right: 1rem; bottom: 1rem; z-index: 20; background: #0f7d47; color: #fff; padding: .7rem 1.1rem;
  border-radius: 999px; font-weight: 600; text-decoration: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }

/* El atributo hidden debe ganar siempre: sin esto, clases como .panel (display: grid) lo anulan */
[hidden] { display: none !important; }

.btn-ghost { background: #fff; color: var(--accent-dark); border: 1px solid var(--accent); }
.btn-ghost:hover { background: var(--alt); }

/* El aviso dentro de la grilla de horarios ocupa todo el ancho */
.slots > p { grid-column: 1 / -1; }

/* Preguntas frecuentes */
.faq { max-width: 780px; margin: 1.6rem auto 0; display: grid; gap: .7rem; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: .2rem 1.2rem; box-shadow: var(--shadow); }
.faq-item > summary { cursor: pointer; list-style: none; padding: .9rem 2rem .9rem 0; position: relative; font-weight: 600; color: var(--accent-dark); }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after { content: "+"; position: absolute; right: 0; top: .7rem; font-size: 1.4rem; line-height: 1; color: var(--pink); }
.faq-item[open] > summary::after { content: "−"; }
.faq-item p { margin: 0 0 1rem; color: var(--muted); }

/* Política de cancelación */
.policy { margin: 0; padding: .7rem .9rem; border-radius: 12px; background: var(--alt); color: var(--accent-dark); font-size: .9rem; }
.policy::before { content: "ⓘ "; color: var(--pink); font-weight: 700; }

/* Cómo llegar */
.directions { justify-content: flex-start; margin: .3rem 0 .8rem; }

/* Tarjeta de tratamiento: toda la tarjeta lleva a su página; "Agendar" queda encima y lleva a la agenda */
.service h3 a { color: inherit; text-decoration: none; }
.service h3 a::after { content: ""; position: absolute; inset: 0; }
.service .go { position: relative; z-index: 1; text-decoration: none; }
.service .go:hover { text-decoration: underline; }

/* Páginas de tratamiento */
.hero-small { min-height: 0; padding: 2.5rem 1.2rem 3.2rem; }
.breadcrumbs { font-size: .85rem; color: rgba(255, 255, 255, .75); margin-bottom: 1.2rem; }
.breadcrumbs a { color: var(--nav-ink); }
.treatment-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 2rem; align-items: start; }
@media (max-width: 820px) { .treatment-grid { grid-template-columns: 1fr; } }

/* Aviso de cookies de medición */
.cookie-banner { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 30; max-width: 640px; margin: 0 auto;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.2rem; box-shadow: 0 12px 40px rgba(61, 23, 87, .25);
  display: grid; gap: .6rem; }
.cookie-banner p { margin: 0; font-size: .9rem; color: var(--ink); }
.cookie-banner .actions { justify-content: flex-end; }

/* Página de la cita: el pie queda pegado al fondo aunque haya poco contenido */
body.page-cita { min-height: 100vh; display: flex; flex-direction: column; }
body.page-cita main { width: 100%; flex: 1; }
body.page-cita footer { padding-bottom: 2.5rem; }
