/* ==========================================================================
   JVSG Citas — página de reserva
   Identidad JVSG® 1931: papel blanco, tinta, Public Sans + EB Garamond, filetes
   finos. Hereda los tokens del tema JVSG Web (--ink, --rule…) y trae los suyos
   por si se usa con otro tema.
   ========================================================================== */

.jvsg-citas {
  --jc-paper: var(--paper, #ffffff);
  --jc-wash: var(--wash, #f5f5f3);
  --jc-open: #eeebe5;
  --jc-ink: var(--ink, #131211);
  --jc-ink-2: var(--ink-2, #45423d);
  --jc-ink-3: var(--ink-3, #767068);
  --jc-rule: var(--rule, #e5e2dc);
  --jc-rule-2: var(--rule-2, #cbc6bd);
  --jc-danger: #9b2c1f;
  --jc-sans: var(--sans, "Public Sans", "Helvetica Neue", Arial, sans-serif);
  --jc-serif: var(--serif, "EB Garamond", "Iowan Old Style", Georgia, serif);
  --jc-ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: var(--jc-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--jc-ink);
  text-align: left;
}
.jvsg-citas *, .jvsg-citas *::before, .jvsg-citas *::after { box-sizing: border-box; }
.jvsg-citas button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.jvsg-citas svg { display: block; }
.jvsg-citas :focus-visible { outline: 2px solid var(--jc-ink); outline-offset: 2px; }
/* Los títulos reciben el foco por código al cambiar de paso (lectores de pantalla): sin marco */
.jvsg-citas [tabindex="-1"]:focus { outline: none; }
.jvsg-citas .visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.jvsg-citas [hidden] { display: none !important; }

/* Con el tema JVSG Web: un poco menos de aire arriba que el resto de interiores */
main.page.jvsg-citas-main { padding-top: calc(var(--header-h, 88px) + clamp(24px, 5vw, 64px)); }

/* ---------- Tarjeta: panel del profesional | calendario | horas ---------- */
.jc-card {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  background: var(--jc-paper);
  border: 1px solid var(--jc-rule);
  min-height: 580px;
}

/* ---------- Panel izquierdo ---------- */
.jc-info { padding: 36px 30px; border-right: 1px solid var(--jc-rule); }
.jc-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin: 0 0 18px; }
.jc-eyebrow { margin: 0 0 12px; font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--jc-ink-3); }
.jc-host { margin: 0 0 6px; font-size: 15px; font-weight: 500; color: var(--jc-ink-2); line-height: 1.4; }
.jvsg-citas .jc-title {
  margin: 0 0 26px; font-family: var(--jc-serif); font-weight: 400;
  font-size: clamp(28px, 2.6vw, 34px); line-height: 1.08; letter-spacing: -0.005em; color: var(--jc-ink);
}
.jc-meta { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.jc-meta li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 15px; font-weight: 500; color: var(--jc-ink-2); line-height: 1.4; }
.jc-meta small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--jc-ink-3); }
.jc-when span, .jc-tzline span { color: var(--jc-ink); }
.jc-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.jc-desc { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--jc-rule); font-size: 15px; line-height: 1.6; color: var(--jc-ink-2); }
.jc-desc p { margin: 0 0 0.9em; }
.jc-desc p:last-child { margin-bottom: 0; }

/* ---------- Zona principal ---------- */
.jc-main { position: relative; min-width: 0; padding: 32px 32px 28px; }
.jc-select { display: grid; grid-template-columns: minmax(0, 1fr) 212px; gap: 32px; align-items: start; }
.jvsg-citas .jc-h { margin: 0 0 22px; font-family: var(--jc-serif); font-weight: 400; font-size: 24px; line-height: 1.2; }
.jvsg-citas .jc-h2 { margin: 0 0 14px; font-family: var(--jc-serif); font-weight: 400; font-size: clamp(26px, 2.4vw, 30px); line-height: 1.15; }
.jc-loading { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 360px; margin: 0; color: var(--jc-ink-3); font-size: 14px; }
.jc-spinner { width: 18px; height: 18px; border: 1.5px solid var(--jc-rule-2); border-top-color: var(--jc-ink); border-radius: 50%; animation: jc-spin 0.8s linear infinite; }
@keyframes jc-spin { to { transform: rotate(360deg); } }

/* Mes */
.jc-month { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.jvsg-citas .jc-month-label { margin: 0; font-family: var(--jc-sans); font-size: 15px; font-weight: 500; letter-spacing: 0.01em; }
.jc-nav { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; transition: background-color 200ms; }
.jc-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.jc-nav:hover:not(:disabled) { background: var(--jc-wash); }
.jc-nav:disabled { opacity: 0.25; cursor: default; }

/* Rejilla de días */
.jc-grid { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 0; border: 0; transition: opacity 250ms var(--jc-ease); }
.jc-grid th, .jc-grid td { border: 0; background: none; padding: 3px 0; text-align: center; }
.jc-grid th { padding-bottom: 10px; font-size: 11px; font-weight: 500; letter-spacing: 0.12em; color: var(--jc-ink-3); }
.jc-grid abbr { text-decoration: none; border: 0; cursor: default; }
.is-loading .jc-grid, .is-loading .jc-times { opacity: 0.4; pointer-events: none; }
.jc-day {
  position: relative; width: 44px; height: 44px; margin: 0 auto; display: grid; place-items: center;
  border-radius: 50%; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--jc-ink-3);
  transition: background-color 180ms, color 180ms, box-shadow 180ms;
}
.jc-day[aria-disabled="true"] { cursor: default; opacity: 0.55; }
.jc-day.is-open { background: var(--jc-open); color: var(--jc-ink); font-weight: 600; }
.jc-day.is-open:hover { box-shadow: inset 0 0 0 1px var(--jc-ink); }
.jc-day.is-selected, .jc-day.is-selected:hover { background: var(--jc-ink); color: var(--jc-paper); box-shadow: none; }
.jc-day.is-today::after { content: ""; position: absolute; bottom: 6px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }

.jc-empty { margin: 16px 0 0; padding: 14px 16px; background: var(--jc-wash); font-size: 14px; color: var(--jc-ink-2); }
.jc-empty p { margin: 0 0 6px; }

/* Zona horaria */
.jc-tz { margin-top: 26px; }
.jc-tz label { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--jc-ink-3); }
.jc-tz label svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.jc-tz select {
  width: 100%; max-width: 360px; appearance: none; -webkit-appearance: none;
  padding: 8px 28px 8px 0; border: 0; border-bottom: 1px solid var(--jc-rule-2); border-radius: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23131211' stroke-width='1.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 2px center / 16px;
  font: 500 14px/1.4 var(--jc-sans); color: var(--jc-ink); cursor: pointer;
}
.jc-tz select:hover, .jc-tz select:focus { border-bottom-color: var(--jc-ink); }

/* Horas */
.jc-times { min-width: 0; padding-top: 4px; transition: opacity 250ms var(--jc-ease); }
.jvsg-citas .jc-times-h { margin: 0 0 16px; font-family: var(--jc-sans); font-size: 15px; font-weight: 500; line-height: 1.35; }
.jc-times-empty p { margin: 40px 0 0; font-size: 14px; color: var(--jc-ink-3); }
.jc-slots {
  list-style: none; margin: 0; padding: 0 6px 0 0; display: grid; gap: 10px;
  max-height: 476px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--jc-rule-2) transparent;
}
.jc-slot { display: flex; gap: 8px; margin: 0; }
.jc-slot-time, .jc-slot-next {
  flex: 1 1 0; min-width: 0; height: 52px; display: grid; place-items: center;
  font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  transition: background-color 200ms, color 200ms, box-shadow 200ms, flex-basis 300ms var(--jc-ease);
}
.jvsg-citas .jc-slot-time { box-shadow: inset 0 0 0 1px var(--jc-rule-2); background: var(--jc-paper); color: var(--jc-ink); }
.jvsg-citas .jc-slot-time:hover { box-shadow: inset 0 0 0 1.5px var(--jc-ink); }
.jvsg-citas .jc-slot.is-selected .jc-slot-time { background: var(--jc-ink-2); color: var(--jc-paper); box-shadow: none; }
.jvsg-citas .jc-slot-next {
  background: var(--jc-ink); color: var(--jc-paper);
  font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  animation: jc-in 300ms var(--jc-ease);
}
.jvsg-citas .jc-slot-next:hover { background: #000; }
@keyframes jc-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }

/* ---------- Avisos ---------- */
.jc-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 24px; padding: 12px 16px; background: var(--jc-wash); font-size: 14px; }
.jc-banner p { margin: 0; }
.jc-notice { margin: 0 0 20px; padding: 10px 14px; border-left: 2px solid var(--jc-danger); background: #fbf4f2; font-size: 14px; color: var(--jc-ink); }
.jc-note { font-size: 14px; color: var(--jc-ink-3); }
.jc-note a { color: var(--jc-ink); text-decoration: underline; text-underline-offset: 3px; }
.jc-errorbox { max-width: 520px; padding: 40px 0; }
.jc-errorbox > p:first-child { font-size: 17px; }
.jc-noscript { padding: 24px; border: 1px solid var(--jc-rule); }

/* ---------- Formulario ---------- */
.jc-form-wrap { max-width: 540px; }
.jc-back { width: 40px; height: 40px; display: grid; place-items: center; margin: 0 0 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--jc-rule-2); transition: box-shadow 200ms; }
.jc-back:hover { box-shadow: inset 0 0 0 1px var(--jc-ink); }
.jc-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.jc-picked { margin: 0 0 26px; font-size: 15px; font-weight: 500; }
.jc-picked span { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--jc-ink-3); }
.jc-form { margin: 0; }
.jc-field { margin: 0 0 20px; }
.jc-field > label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--jc-ink-2); }
.jc-req { color: var(--jc-ink); }
.jc-opt { font-weight: 400; color: var(--jc-ink-3); }
.jvsg-citas .jc-field input[type="text"], .jvsg-citas .jc-field input[type="email"], .jvsg-citas .jc-field textarea {
  display: block; width: 100%; margin: 0; padding: 12px 14px;
  font: 400 16px/1.5 var(--jc-sans); color: var(--jc-ink);
  background: var(--jc-paper); border: 1px solid var(--jc-rule-2); border-radius: 0; box-shadow: none;
  transition: border-color 200ms, box-shadow 200ms;
}
.jvsg-citas .jc-field textarea { resize: vertical; min-height: 104px; }
.jvsg-citas .jc-field input:hover, .jvsg-citas .jc-field textarea:hover { border-color: var(--jc-ink-3); }
.jvsg-citas .jc-field input:focus, .jvsg-citas .jc-field textarea:focus { outline: none; border-color: var(--jc-ink); box-shadow: inset 0 0 0 1px var(--jc-ink); }
.jc-field.has-error input, .jc-field.has-error textarea { border-color: var(--jc-danger); }
.jc-err { margin: 6px 0 0; font-size: 13px; color: var(--jc-danger); }
.jc-err:empty { display: none; }
.jc-check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px 10px; align-items: start; }
.jc-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--jc-ink); }
.jc-check label { margin: 0; font-size: 14px; color: var(--jc-ink-2); cursor: pointer; }
.jc-check .jc-err { grid-column: 2; }
.jc-legal { margin: 4px 0 16px; font-size: 12.5px; line-height: 1.55; color: var(--jc-ink-3); }
.jc-legal a { color: var(--jc-ink-2); text-decoration: underline; text-underline-offset: 3px; }
.jc-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.jc-formerr { margin: 0 0 14px; font-size: 14px; color: var(--jc-danger); }
.jc-formerr:empty { display: none; }

.jvsg-citas .jc-btn {
  position: relative; display: block; width: 100%; min-height: 54px; padding: 0 24px;
  background: var(--jc-ink); color: var(--jc-paper); border: 0; border-radius: 0;
  font: 500 12px/54px var(--jc-sans); letter-spacing: 0.14em; text-transform: uppercase; text-align: center; text-decoration: none;
  transition: background-color 200ms;
}
.jvsg-citas .jc-btn:hover { background: #000; color: var(--jc-paper); }
.jvsg-citas .jc-btn:disabled { cursor: progress; }
.jvsg-citas .jc-btn.is-busy { color: transparent; }
.jvsg-citas .jc-btn.is-busy::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 1.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: jc-spin 0.8s linear infinite;
}
.jvsg-citas .jc-btn--inline { display: inline-block; width: auto; }
.jvsg-citas .jc-btn--danger { background: var(--jc-danger); }
.jvsg-citas .jc-btn--danger:hover { background: #7d2016; }
.jvsg-citas .jc-link {
  font-size: 14px; font-weight: 500; color: var(--jc-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px;
}
.jvsg-citas .jc-link:hover { color: var(--jc-ink-2); }

/* ---------- Confirmación y gestión ---------- */
.jc-done { max-width: 560px; }
.jc-done-icon svg { width: 48px; height: 48px; margin: 0 0 18px; fill: none; stroke: var(--jc-ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.jc-done-icon path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: jc-draw 600ms 150ms var(--jc-ease) forwards; }
@keyframes jc-draw { to { stroke-dashoffset: 0; } }
.jc-lede { margin: 0 0 24px; font-size: 16px; color: var(--jc-ink-2); }
.jc-mail { color: var(--jc-ink-3); }
.jc-summary { margin: 0 0 26px; border-top: 1px solid var(--jc-rule); }
.jc-summary > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 4px 16px; padding: 14px 0; border-bottom: 1px solid var(--jc-rule); }
.jc-summary dt { padding-top: 3px; font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--jc-ink-3); }
.jc-summary dd { margin: 0; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.jc-summary dd small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--jc-ink-3); }
.jc-summary a { text-decoration: underline; text-underline-offset: 4px; }
.jc-add { margin: 0 0 22px; }
.jc-add-h { margin: 0 0 10px; font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--jc-ink-3); }
.jc-add-links { display: flex; flex-wrap: wrap; gap: 8px; }
.jvsg-citas .jc-btn-ghost {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  box-shadow: inset 0 0 0 1px var(--jc-rule-2); font-size: 14px; font-weight: 500; color: var(--jc-ink); text-decoration: none;
  transition: box-shadow 200ms;
}
.jvsg-citas .jc-btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--jc-ink); }
.jc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 18px 0 0; color: var(--jc-ink-3); }
.jc-done--off .jc-summary dd { color: var(--jc-ink-2); }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .jc-card { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .jc-info { border-right: 0; border-bottom: 1px solid var(--jc-rule); padding: 28px 28px 24px; }
  .jvsg-citas .jc-title { margin-bottom: 18px; }
  .jc-meta { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px; }
  .jc-desc { margin-top: 20px; padding-top: 18px; }
}
@media (max-width: 719px) {
  .jc-info { padding: 24px 20px 20px; }
  .jc-main { padding: 24px 16px 22px; }
  .jc-select { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .jc-times { border-top: 1px solid var(--jc-rule); padding-top: 22px; scroll-margin-top: calc(var(--header-h, 64px) + var(--adminbar, 0px) + 12px); }
  .jc-times-empty p { margin: 0; }
  .jc-slots { max-height: none; overflow: visible; padding: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jc-slot.is-selected { grid-column: 1 / -1; }
  .jvsg-citas .jc-h { font-size: 22px; margin-bottom: 16px; }
  .jc-summary > div { grid-template-columns: 1fr; gap: 2px; }
  .jc-summary dt { padding-top: 0; }
  .jvsg-citas { scroll-margin-top: calc(var(--header-h, 64px) + var(--adminbar, 0px)); }
}
@media (max-width: 380px) {
  .jc-day { width: 38px; height: 38px; font-size: 14px; }
  .jc-main { padding-left: 12px; padding-right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .jvsg-citas *, .jvsg-citas *::before, .jvsg-citas *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
  .jc-done-icon path { stroke-dashoffset: 0; }
}

@media print {
  .jc-tz, .jc-add, .jc-actions, .jc-back { display: none !important; }
  .jc-card { border: 0; }
}
