/* ============================================
   DAVTOOL AGENDA PÚBLICA — ENHANCED UX v2
   Estilo: Minimalismo refinado / App-like
   ============================================ */


/* Sobreescribir fuente base */
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #F5F5F7;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   HEADER MEJORADO
   ============================================ */
.header {
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: none;
}

.business-info h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.business-info p {
  font-size: 13px;
  color: #8E8E93;
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.main-content {
  padding: 20px 0 40px;
}

/* ============================================
   CARDS GENERALES — LIMPIEZA
   ============================================ */
.card {
  background: white;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  padding: 22px;
  margin-bottom: 14px;
  border: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  will-change: transform;
}

.card.hidden {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.card:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}

.card-header {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: #1C1C1E;
  margin: 0 0 2px;
  letter-spacing: -0.2px;
}

.card-description {
  font-size: 13px;
  color: #8E8E93;
  margin: 0;
}

/* Número de paso — pill */
.card-title::before {
  content: '';
  display: none; /* Se puede activar si se quiere añadir numeración visual */
}

/* ============================================
   SERVICE CARDS — DISEÑO APP-LIKE
   ============================================ */
.service-card {
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 16px;
  background: white;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin-bottom: 10px;
  overflow: hidden;
  cursor: pointer;
}

/* Tarjeta SIN imagen */
.service-card:not(.service-card-has-thumb) {
  padding: 16px 18px;
}

/* Tarjeta CON imagen — layout horizontal */
.service-card.service-card-has-thumb {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 0;
  gap: 0;
}

/* Hover sutil */
.service-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.09);
  transform: translateY(-2px);
  border-color: rgba(0,0,0,0.10);
}

/* Selected */
.service-card.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary), 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

/* ── Thumbnail (izquierda) ── */
.service-thumb-btn {
  position: relative;
  flex-shrink: 0;
  width: 100px;
  min-height: 100px;
  align-self: stretch;
  border: none;
  padding: 0;
  cursor: pointer;
  background: #F2F2F7;
  overflow: hidden;
  border-radius: 0;
}

@media (max-width: 480px) {
  .service-thumb-btn {
    width: 88px;
  }
}

.service-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.service-card:hover .service-thumb-img {
  transform: scale(1.04);
}

/* Badge contador de fotos */
.service-thumb-count {
  position: absolute;
  bottom: 7px;
  right: 7px;
  background: rgba(0,0,0,0.60);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: 20px;
  letter-spacing: 0.1px;
}

/* ── Content (derecha cuando hay imagen) ── */
.service-card__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 14px 16px;
  flex: 1;
  min-width: 0;
}

/* Tarjeta sin imagen — el content es directo */
.service-card:not(.service-card-has-thumb) .service-card__content {
  padding: 0;
}

/* Botón dentro de content */
.service-card__content .btn {
  margin-top: 12px;
  width: fit-content;
  min-width: 120px;
  height: 36px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  padding: 0 16px;
  letter-spacing: -0.1px;
}

/* ── Tipografía de la tarjeta ── */
.service-name {
  font-size: 15px;
  font-weight: 600;
  color: #1C1C1E;
  line-height: 1.3;
  letter-spacing: -0.15px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-duration {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-primary);
  margin: 0;
}

.service-description {
  font-size: 12.5px;
  color: #8E8E93;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.service-price {
  font-size: 14px;
  font-weight: 700;
  color: #1C1C1E;
  margin: 2px 0 0;
  letter-spacing: -0.2px;
}

/* ── Sin imagen — botón full width ── */
.service-card:not(.service-card-has-thumb) .btn {
  margin-top: 14px;
  width: 100%;
  height: 42px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

/* ============================================
   DATE PICKER — PILL ESTILO APP
   ============================================ */
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #3A3A3C;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

input[type="date"] {
  height: 50px;
  border-radius: 14px;
  border: 1.5px solid rgba(0,0,0,0.10);
  font-size: 16px;
  font-weight: 500;
  color: #1C1C1E;
  padding: 0 16px;
  background: #FAFAFA;
  transition: all 0.15s ease;
  font-family: 'DM Sans', sans-serif;
}

input[type="date"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-soft);
  background: white;
}

/* Botón confirmar fecha */
#confirmDateBtn {
  height: 50px;
  border-radius: 14px;
  width: 100%;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.1px;
  margin-top: 12px;
}

/* ============================================
   TIME SLOTS — ESTILO GRID TÁCTIL
   ============================================ */
#timeSlotsContainer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 640px) {
  #timeSlotsContainer {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }
}

@media (max-width: 380px) {
  #timeSlotsContainer {
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
  }
}

.time-slot-btn {
  height: 50px;
  border-radius: 12px;
  border: 1.5px solid rgba(0,0,0,0.08);
  background: white;
  font-size: 14px;
  font-weight: 500;
  color: #1C1C1E;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.14s ease;
  position: relative;
  overflow: hidden;
}

/* Ripple pseudo-element */
.time-slot-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.time-slot-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-soft);
  transform: scale(1.02);
}

.time-slot-btn:active {
  transform: scale(0.97);
  background: rgba(0,0,0,0.04);
}

.time-slot-btn.selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 14px var(--brand-glow);
  transform: scale(1.03);
}

/* ============================================
   RESUMEN DE FECHA SELECCIONADA
   ============================================ */
.selected-date-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-primary-soft);
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 500;
  color: #1C1C1E;
}

.change-link {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  padding: 0;
}

.change-link:hover {
  text-decoration: underline;
}

/* ============================================
   FORMULARIO DE CLIENTE — LIMPIO
   ============================================ */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  border-radius: 14px;
  border: 1.5px solid rgba(0,0,0,0.10);
  font-size: 16px;
  font-family: 'DM Sans', sans-serif;
  color: #1C1C1E;
  background: #FAFAFA;
  padding: 13px 16px;
  transition: all 0.15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-soft);
  background: white;
}

input.valid {
  border-color: #34C759;
}

input.invalid {
  border-color: #FF3B30;
  box-shadow: 0 0 0 3px rgba(255,59,48,0.10);
}

textarea {
  min-height: 90px;
  resize: none;
}

/* Alerta resumen cita */
.alert-info {
  background: #F2F2F7;
  border: none;
  border-radius: 14px;
  color: #1C1C1E;
  padding: 16px;
}

.alert-info h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #1C1C1E;
}

.alert-info p {
  font-size: 13.5px;
  margin-bottom: 5px;
  color: #3A3A3C;
}

.alert-info p:last-child {
  margin-bottom: 0;
}

/* ============================================
   BOTONES — REFINAMIENTO
   ============================================ */
.btn-primary {
  background: var(--color-primary);
  border-radius: 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.1px;
  transition: all 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 2px 8px var(--brand-glow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  box-shadow: 0 6px 18px var(--brand-glow);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 6px var(--brand-glow);
}

.btn-secondary {
  background: #F2F2F7;
  color: #3A3A3C;
  border-radius: 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  box-shadow: none;
}

.btn-secondary:hover:not(:disabled) {
  background: #E5E5EA;
  color: #1C1C1E;
  box-shadow: none;
  opacity: 1;
}

.btn-lg {
  height: 52px;
  font-size: 16px;
  border-radius: 14px;
}

/* ============================================
   ERROR INLINE FECHA
   ============================================ */
#dateAvailabilityError {
  border-radius: 12px !important;
  font-size: 13.5px !important;
  font-family: 'DM Sans', sans-serif;
}

/* ============================================
   CONFIRMACIÓN
   ============================================ */
#confirmationMessage > div {
  background: none !important;
}

#confirmationMessage h2 {
  font-size: 26px !important;
  font-weight: 700 !important;
  letter-spacing: -0.4px;
  margin-bottom: 8px !important;
}

#confirmationMessage p {
  font-size: 15px;
  color: #3A3A3C;
}

/* Caja de detalles */
#confirmationMessage > div > div[style*="background"] {
  background: #F2F2F7 !important;
  border-radius: 16px !important;
  padding: 18px !important;
  text-align: left !important;
}

#confirmationMessage > div > div > p {
  font-size: 14px;
  color: #3A3A3C;
  margin-bottom: 6px;
}

/* Botones de confirmación */
#confirmationMessage .btn {
  border-radius: 14px;
  font-weight: 600;
  margin: 6px auto;
  display: block;
  max-width: 300px;
}

/* ============================================
   LIGHTBOX — ESTILO NATIVO
   ============================================ */
.at-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.at-lightbox.hidden {
  display: none !important;
}

.at-lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.88);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.at-lightbox-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 480px;
}

.at-lightbox-close {
  position: absolute;
  top: -52px;
  right: 0;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.at-lightbox-close:hover {
  background: rgba(255,255,255,0.22);
}

.at-lightbox-stage {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.at-lightbox-img-wrap {
  flex: 1;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.at-lightbox-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.at-lightbox-arrow {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
  line-height: 1;
}

.at-lightbox-arrow:hover {
  background: rgba(255,255,255,0.22);
}

.at-lightbox-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.at-lb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.at-lb-dot.active {
  background: white;
  width: 18px;
  border-radius: 3px;
}

.at-lightbox-counter {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin: 0;
  font-family: 'DM Sans', sans-serif;
}

/* ============================================
   FORM ERRORS REFINADOS
   ============================================ */
.form-error {
  font-size: 12.5px;
  color: #FF3B30;
  margin-top: 5px;
  font-weight: 500;
}

/* ============================================
   FOOTER
   ============================================ */
footer p {
  font-size: 12px !important;
  color: #AEAEB2 !important;
}

/* ============================================
   ANIMACIÓN DE ENTRADA DE STEPS
   ============================================ */
@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:not(.hidden) {
  animation: stepIn 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ============================================
   LOADING STATE (texto "Cargando...")
   ============================================ */
#timeSlotsContainer p {
  grid-column: 1 / -1;
  text-align: center;
  color: #AEAEB2;
  font-size: 14px;
  padding: 24px 0;
}

/* ============================================
   RESPONSIVE AJUSTES FINALES
   ============================================ */
@media (max-width: 480px) {
  .card {
    border-radius: 14px;
    padding: 18px 16px;
    margin-bottom: 10px;
  }

  .main-content {
    padding: 14px 0 32px;
  }

  .service-card.service-card-has-thumb {
    border-radius: 14px;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  textarea {
    font-size: 16px; /* evita zoom en iOS */
  }
}

/* ============================================
   SCROLLBAR SUTIL (Chrome/Edge)
   ============================================ */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 2px;
}