/* Candela — página pública de reservas. Diseño propio con color ajustable. */

/*
 * Blindaje frente al tema. Muchos temas (OceanWP, Astra...) estilan de forma
 * agresiva botones, labels e inputs: botones enormes, line-height gigante,
 * márgenes y text-transform. Estas reglas van scoped bajo .candela-shell y con
 * !important en lo que el tema suele pisar, para que el formulario se vea igual
 * en cualquier web sin tocar el tema del cliente.
 */
.candela-shell button,
.candela-shell input,
.candela-shell textarea,
.candela-shell select,
.candela-shell label {
  line-height: 1.3;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: none;
  min-height: 0;
  margin: 0;
  max-width: 100%;
  float: none;
}
.candela-shell .candela-btn-primary {
  padding: 1rem 1.5rem !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.2 !important;
  text-align: center;
  text-decoration: none;
}

.candela-shell {
  /* Valores por defecto; se sobrescriben en línea desde los ajustes. */
  --candela-primary: #042b6a;
  --candela-surface: #ffffff;
  --candela-ink: #0f172a;
  --candela-border: #e2e8f0;
  --candela-muted-c: #64748b;
  --candela-success-c: #16a34a;
  --candela-radius: 14px;
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 0 2rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--candela-ink);
  line-height: 1.5;
}

/* Modo integrado: hereda la tipografía del tema y quita la caja/sombra. */
.candela-shell.candela-integrated,
.candela-shell.candela-theme-font {
  font-family: inherit;
}
.candela-shell.candela-integrated .candela-box {
  box-shadow: none;
  border: 0;
  padding: 0;
}

body.candela-standalone {
  margin: 0;
  background: #f8fafc;
  padding: 1.5rem 1rem;
}

.candela-header {
  text-align: center;
  padding: 0.5rem 0 1.5rem;
}

.candela-heading {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.candela-subtitle {
  margin: 0.5rem auto 0;
  color: var(--candela-muted-c);
  max-width: 32rem;
}

.candela-alert {
  padding: 0.875rem 1rem;
  border-radius: var(--candela-radius);
  font-weight: 600;
  margin-bottom: 1.25rem;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.candela-box {
  background: var(--candela-surface);
  border: 1px solid var(--candela-border);
  border-radius: calc(var(--candela-radius) + 2px);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.candela-step + .candela-step {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--candela-border);
}

.candela-hidden {
  display: none;
}

.candela-step-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.candela-step-head h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}

.candela-step-num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--candela-ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.candela-day-label {
  color: var(--candela-primary);
  font-weight: 700;
}

/* Calendario */

.candela-calendar {
  width: 100%;
}

.candela-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.candela-cal-month {
  font-weight: 700;
  text-transform: capitalize;
}

.candela-cal-nav button {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--candela-radius);
  border: 1px solid var(--candela-border);
  background: var(--candela-surface);
  color: var(--candela-ink);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.candela-cal-nav button:disabled {
  opacity: 0.35;
  cursor: default;
}

.candela-cal-weekdays,
.candela-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.candela-cal-weekdays span {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--candela-muted-c);
  padding: 0.375rem 0;
}

.candela-cal-day {
  height: 3.25rem;
  border: none;
  background: transparent;
  border-radius: var(--candela-radius);
  font-size: 0.9375rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  font-weight: 500;
}

.candela-cal-day.available {
  background: color-mix(in srgb, var(--candela-primary) 8%, white);
  color: var(--candela-primary);
  font-weight: 700;
  cursor: pointer;
}

.candela-cal-day.available:hover {
  background: var(--candela-primary);
  color: #fff;
}

.candela-cal-day.selected {
  background: var(--candela-ink);
  color: #fff;
}

/* Huecos */

.candela-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.candela-slot {
  border: 1px solid var(--candela-border);
  background: var(--candela-surface);
  border-radius: var(--candela-radius);
  padding: 0.75rem 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--candela-ink);
  cursor: pointer;
  text-align: center;
}

.candela-slot:hover {
  border-color: var(--candela-primary);
  color: var(--candela-primary);
}

.candela-slot.selected {
  background: var(--candela-ink);
  border-color: var(--candela-ink);
  color: #fff;
}

/* Formulario */

.candela-selected {
  background: color-mix(in srgb, var(--candela-primary) 8%, white);
  border: 1px solid color-mix(in srgb, var(--candela-primary) 25%, white);
  border-radius: var(--candela-radius);
  padding: 0.875rem 1rem;
  font-weight: 700;
  color: var(--candela-primary);
  margin-bottom: 1.25rem;
}

.candela-form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.candela-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.candela-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.candela-label {
  font-size: 0.875rem;
  font-weight: 600;
}

.candela-field input,
.candela-field textarea {
  border: 1px solid var(--candela-border);
  border-radius: var(--candela-radius);
  padding: 0.75rem 0.875rem;
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.candela-field input:focus,
.candela-field textarea:focus {
  border-color: var(--candela-primary);
  outline: 2px solid color-mix(in srgb, var(--candela-primary) 20%, transparent);
}

/*
 * Elementor añade margen a labels e inputs, lo que abre un hueco enorme entre
 * la etiqueta y su campo. Se anula SOLO dentro del formulario (el espaciado lo
 * da `gap` de .candela-field). No toca el calendario ni nada más.
 */
.candela-shell .candela-field > .candela-label,
.candela-shell .candela-field > label,
.candela-shell .candela-field > input,
.candela-shell .candela-field > textarea {
  margin: 0 !important;
}

/*
 * Selector de modalidad. Blindado frente al tema: cada propiedad que un tema
 * suele pisar (display, width, margin, float...) va con !important. La
 * selección se marca con la clase .is-active (la pone el JS) y, como respaldo
 * sin JS, también con input:checked. No depende solo del selector de hermano
 * adyacente, que algunos temas rompen al re-renderizar los radios.
 */
.candela-shell .candela-modes {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
  width: 100%;
}
.candela-shell .candela-mode {
  flex: 1 1 140px !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  min-width: 0;
  cursor: pointer;
  float: none !important;
}
.candela-shell .candela-mode input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  margin: 0 !important;
  pointer-events: none;
}
.candela-shell .candela-mode-box {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  min-height: 0;
  height: auto;
  margin: 0 !important;
  border: 1.5px solid var(--candela-border);
  border-radius: var(--candela-radius);
  padding: 0.9rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--candela-ink);
  background: var(--candela-surface);
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.candela-shell .candela-mode-box svg {
  flex-shrink: 0;
  max-width: none;
  width: 18px;
  height: 18px;
}
.candela-shell .candela-mode:hover .candela-mode-box {
  border-color: var(--candela-primary);
}
.candela-shell .candela-mode.is-active .candela-mode-box,
.candela-shell .candela-mode input:checked + .candela-mode-box {
  border-color: var(--candela-primary);
  background: var(--candela-primary);
  color: #fff;
}
/* Foco por teclado accesible. */
.candela-shell .candela-mode input:focus-visible + .candela-mode-box {
  outline: 2px solid var(--candela-primary);
  outline-offset: 2px;
}

.candela-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
}

.candela-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--candela-primary);
  color: #fff;
  border: none;
  border-radius: var(--candela-radius);
  padding: 1rem 1.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

.candela-btn-primary:hover {
  filter: brightness(1.15);
}

.candela-btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.candela-btn-secondary {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--candela-border);
  border-radius: var(--candela-radius);
  background: var(--candela-surface);
  color: var(--candela-ink);
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.candela-legal {
  text-align: center;
}

.candela-muted {
  color: var(--candela-muted-c);
}

.candela-small {
  font-size: 0.8125rem;
}

/* Confirmación y estados */

.candela-success,
.candela-unavailable {
  text-align: center;
  padding: 3rem 1.5rem;
}

.candela-success {
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 60%);
  border: 1px solid #bbf7d0;
  border-radius: 18px;
}

.candela-success-icon {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: var(--candela-success-c);
  color: #fff;
  font-size: 2.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px -6px rgba(22, 163, 74, 0.45);
  animation: candela-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes candela-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.candela-success-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 0.35rem;
  color: #14532d;
}

.candela-unavailable h3 {
  font-size: 1.375rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
}

.candela-success-lead {
  font-size: 1.1rem;
  margin: 0 0 1.5rem;
  color: var(--candela-muted-c);
}

.candela-success-card {
  display: inline-block;
  min-width: 260px;
  padding: 1.1rem 1.75rem;
  margin: 0 auto 1.5rem;
  background: var(--candela-surface);
  border: 1px solid #dcfce7;
  border-radius: 14px;
  box-shadow: 0 2px 10px -4px rgba(20, 83, 45, 0.15);
}

.candela-success-date {
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin: 0;
  color: var(--candela-ink);
}

.candela-success-mode {
  margin: 0.4rem 0 0;
  font-weight: 600;
  color: var(--candela-muted-c);
}

.candela-footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.8125rem;
  color: var(--candela-muted-c);
}

.candela-footer a {
  color: var(--candela-muted-c);
  font-weight: 600;
}

@media (max-width: 560px) {
  .candela-form-row {
    grid-template-columns: 1fr;
  }

  .candela-heading {
    font-size: 1.5rem;
  }

  .candela-box {
    padding: 1.25rem 1rem;
  }
}
