/* ==============================================================
   BOOKING-CALENDAR.CSS — TuEstilo
   Flujo de Reserva Cliente: Booking View, Date Strip, Month Calendar, Time Slots
   Extraído de sidebar.css (Fase 2.5 — Refinamiento CSS)
   ============================================================== */

.booking-view {
  position: fixed;
  top: 56px;
  left: 0;
  width: 100%;
  height: calc(100vh - 56px);
  background: var(--color-surface);
  z-index: 50;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 0;
}

.booking-view-inner {
  padding-top: 16px;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-bottom: 100px;
  margin: 0;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.booking-view.hidden {
  display: none !important;
}

/* --- Modal de Reserva (contenido interno) --- */
.booking-step {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.booking-modal-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(90vh - 40px);
}

.booking-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.booking-modal-card {
  margin-bottom: 0;
}

/* Week-First: mes + tira de 7 días + calendario desplegable */
.booking-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Encabezado de mes (abre calendario mensual) */
.booking-month-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background: transparent;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  border-radius: var(--radius-2xs);
  transition: background 0.2s, color 0.2s;
}

.booking-month-header:hover {
  background: #f1f5f9;
  color: var(--color-primary);
}

.booking-month-chevron {
  font-size: 0.75rem;
  color: #64748b;
  transition: transform 0.25s ease;
}

#booking-month-trigger[aria-expanded="true"] .booking-month-chevron {
  transform: rotate(180deg);
}

/* Overlay calendario mensual (oculto por defecto, transición al cerrar) */
.booking-month-calendar {
  max-height: 0;
  margin-bottom: 0;
  padding: 0 0.75rem;
  background: var(--color-surface);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  box-shadow: none;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease, opacity 0.2s ease, border-color 0.2s, box-shadow 0.2s;
}

.booking-month-calendar--open {
  max-height: 380px;
  margin-bottom: 12px;
  padding: 0.75rem;
  border-color: var(--color-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  opacity: 1;
}

.booking-month-calendar-inner {
  max-width: 320px;
  margin: 0 auto;
}

.booking-month-nav {
  padding: 0.35rem 0.6rem;
  border: none;
  background: #f1f5f9;
  color: #475569;
  font-size: 1.1rem;
  border-radius: var(--radius-2xs);
  cursor: pointer;
  transition: background 0.2s;
}

.booking-month-nav:hover {
  background: #e2e8f0;
}

.booking-month-calendar-title {
  text-transform: capitalize;
}

.calendar-day {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.calendar-day:hover:not(:disabled):not(.active) {
  background: var(--color-primary-bg-light);
  color: var(--color-primary);
}

.calendar-day.active {
  background: var(--color-primary);
  color: var(--color-surface);
}

.calendar-day.disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}

.booking-date-strip-wrap {
  margin-bottom: 16px;
  overflow: hidden;
  padding: 0 1rem 4px 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.booking-date-strip-wrap::-webkit-scrollbar {
  display: none;
}

.booking-date-strip--week {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  width: max-content;
}

.booking-date-strip {
  display: flex;
  align-items: center;
  gap: 0;
}

/* Píldora compacta vertical (día arriba, número abajo) */
.booking-date-pill {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.booking-date-pill--micro {
  flex: 0 0 auto;
  width: calc((100vw - 6rem) / 7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-weight: 600;
  gap: 2px;
}

.booking-date-pill--micro .booking-date-pill-day {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 500;
}

.booking-date-pill--micro .booking-date-pill-num {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.booking-date-pill--micro.booking-date-pill--active .booking-date-pill-day,
.booking-date-pill--micro.booking-date-pill--active .booking-date-pill-num {
  color: var(--color-surface);
}

.booking-date-pill--micro.booking-date-pill--active {
  background: var(--color-primary);
  border-radius: 50%;
  aspect-ratio: 1;
  max-width: 48px;
  margin: 0 auto;
}

.booking-date-pill--micro:hover:not(:disabled):not(.booking-date-pill--active) .booking-date-pill-num {
  color: var(--color-primary);
}

.booking-date-pill--micro.booking-date-pill--disabled .booking-date-pill-day,
.booking-date-pill--micro.booking-date-pill--disabled .booking-date-pill-num {
  color: #cbd5e1;
}

/* ========== BARRITA DE SCROLL DRAGGABLE (Date Strip) ========== */
.date-strip-scrollbar {
  position: relative;
  width: 60%;
  max-width: 180px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 4px;
  margin: 8px auto 0;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.date-strip-thumb {
  position: absolute;
  top: -2px;
  left: 0;
  width: 36px;
  height: 8px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: 4px;
  cursor: grab;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  touch-action: none;
}

.date-strip-thumb:hover {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  transform: scaleY(1.3);
}

.date-strip-thumb:active,
.date-strip-thumb.dragging {
  cursor: grabbing;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
  transform: scaleY(1.5);
}

.booking-date-pill:hover:not(:disabled):not(.booking-date-pill--active) {
  background: var(--color-surface-subtle);
  border-color: var(--color-text-disabled);
}

.booking-date-pill--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-surface);
}

.booking-date-pill--disabled {
  background: var(--color-surface-subtle);
  color: var(--color-text-placeholder);
  cursor: not-allowed;
  border-color: var(--color-border-light);
}

.booking-times-section {
  flex: 1;
  min-width: 0;
}

.booking-modal-footer {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, var(--color-surface) 70%, rgba(255, 255, 255, 0.98));
  padding: 16px;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  z-index: 5;
}

.booking-confirm-btn {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  display: block;
  background: var(--color-primary);
  color: var(--color-surface);
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  transition: background 0.2s, transform 0.1s;
  cursor: pointer;
}

.booking-confirm-btn:hover {
  background: var(--color-primary-dark);
}

.booking-confirm-btn:active {
  transform: scale(0.98);
}

.booking-time-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (min-width: 768px) {
  .booking-time-slots-grid {
    gap: 10px;
  }
}

/* Calendar Styling */


.calendar-day:hover:not(.active):not(.disabled) {
  background-color: #ebecf0;
}


/* Time Slot Button (compacto para grid 4 columnas) */
.time-slot {
  border: 1px solid #dfe1e6;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.8125rem;
  text-align: center;
  transition: all 0.2s;
  background: white;
  color: #0052cc;
  font-weight: 500;
}

.time-slot:hover:not(:disabled) {
  border-color: #0052cc;
  background-color: #deebff;
}

.time-slot.selected {
  background-color: #0052cc;
  color: white;
  border-color: #0052cc;
  transform: scale(1.02);
  box-shadow: 0 2px 6px -1px rgba(0, 82, 204, 0.3);
}

/* Modificador para tarjetas temporales de citas de muy corta duración (<= 25 min) */
.timeline-block--micro {
  padding: 2px 6px !important;
  gap: 0 !important;
  justify-content: flex-start !important;
}

.timeline-block--micro .reservas-agenda-block-time,
.timeline-block--micro .reservas-agenda-block-client,
.timeline-block--micro .reservas-agenda-block-service,
.timeline-block--micro .reservas-agenda-block-waiting-text {
  font-size: 0.7rem !important;
  line-height: 1.1 !important;
  margin: 0 !important;
  min-height: 0 !important;
}

.timeline-block--micro .reservas-agenda-block-service {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  white-space: normal !important;
}

.time-slot:disabled {
  background-color: #f4f5f7;
  color: #a5adba;
  border-color: transparent;
  cursor: not-allowed;
  opacity: 0.8;
}

/* Slot libre pero el servicio es demasiado largo para ese hueco */
.time-slot--too-short {
  background-color: #fff0f3;
  color: #c0566a;
  border-color: #fbb6c2;
  cursor: help;
  opacity: 1;
  position: relative;
}

.time-slot--too-short::after {
  content: '?';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #e8637a;
  line-height: 1;
}

/* Service Category Icon (Circles) */
.category-icon {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.icon-circle {
  position: relative;
  overflow: hidden;
}

.icon-circle img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-icon.active .icon-circle {
  background-color: #0052cc;
  color: white;
  box-shadow: 0 10px 15px -3px rgba(0, 82, 204, 0.3);
}

.category-icon:hover .icon-circle {
  color: #0052cc;
}

/* Animation Fade In */
.fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animation Slide Up for Modals */
.animate-slideUp {
  animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Rating Stars Hover Effect */
.rating-star:hover {
  transform: scale(1.2);
}

/* --- CORRECCIÓN INPUTS MODAL --- */
input:not(#login-container *),
select:not(#login-container *),
textarea:not(#login-container *) {
  background-color: white !important;
  color: #333 !important;
  border: 1px solid #ccc !important;
}

/* --- PANEL RESERVAS SIDEBAR --- */
#reservas-sidebar {
  background: linear-gradient(to bottom, var(--color-surface), var(--color-surface-subtle));
}

#reservas-store-list::-webkit-scrollbar {
  width: 6px;
}

#reservas-store-list::-webkit-scrollbar-track {
  background: transparent;
}

#reservas-store-list::-webkit-scrollbar-thumb {
  background: var(--color-text-disabled);
  border-radius: 3px;
}

#reservas-store-list::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-placeholder);
}

@media (min-width: 1024px) {

  /* min-height en lugar de height: permite que la lista crezca y use el scroll de .main-content-wrap (sticky headers) */
  #panel-gestion-reservas>div {
    min-height: calc(100vh - 64px);
    height: auto;
  }

  /* Ocultar "Filtrar por Tienda" en escritorio: el botón Volver del header hace la barra redundante */
  #reservas-sidebar {
    display: none !important;
  }
}

/* --- ESTRELLAS DE CALIFICACIÓN --- */
.rating-star:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.rating-star:not(:disabled) {
  cursor: pointer;
}

.rating-star:not(:disabled):hover {
  transform: scale(1.2);
  transition: transform 0.2s ease;
}

/* --- TOAST NOTIFICATIONS --- */

/* ===== RESERVA ÉXITO — Premium Animated Modal ===== */
.reserva-exito-card {
  animation: reservaCardEntrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transform-origin: center center;
}

@keyframes reservaCardEntrance {
  0% { opacity: 0; transform: scale(0.85) translateY(30px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Circulo que aparece con scale bounce */
.reserva-success-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  animation: reservaCircleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes reservaCircleIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Check path que se dibuja */
.reserva-check-draw {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: reservaCheckDraw 0.6s 0.3s ease forwards;
}

@keyframes reservaCheckDraw {
  to { stroke-dashoffset: 0; }
}
