/* ==========================================
   1. RESET Y CONFIGURACIÓN GLOBAL
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  user-select: none;
  /* Centrado en PC estilo Instagram Web */
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* ==========================================
   2. CONTENEDOR Y TARJETAS DE REELS
   ========================================== */
.reels-container {
  width: 100vw;
  height: 100vh;
  /* Ancho máximo tipo celular para pantallas de PC */
  max-width: 420px;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  position: relative;
  background-color: #000;
}

.reels-container::-webkit-scrollbar {
  display: none;
}

.reel-card {
  width: 100%;
  height: 100vh;
  scroll-snap-align: start;
  position: relative;
  background-color: #000000;
  overflow: hidden;
}

.reel-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================
   3. HEADER FLOTANTE ULTRAMINIMALISTA
   ========================================== */
.reels-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
}

.reels-header .back-btn,
.reels-header .search-btn {
  background: transparent;
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.15s ease;
}

.reels-header .back-btn:active,
.reels-header .search-btn:active {
  opacity: 0.6;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-title {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.3px;
  color: rgba(255, 255, 255, 0.95);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #3b82f6;
  box-shadow: 0 0 8px #3b82f6;
}

/* ==========================================
   4. BARRA DE FILTROS FLOTANTE (CHIPS)
   ========================================== */
.filter-bar {
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-bar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

.filter-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  font-weight: 600;
}

/* ==========================================
   5. OVERLAYS (MAPA TAG, AUDIO, INFO, ACCIONES)
   ========================================== */

/* Mini Mapa Tag Flotante */
.reel-map-overlay {
  position: absolute;
  top: 70px;
  left: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 4px 12px 4px 4px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.15s ease;
}

.reel-map-overlay:active {
  background: rgba(0, 0, 0, 0.6);
}

.mini-map {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.map-info h4 {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1;
}

.map-info p {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
  margin-top: 2px;
}

/* Botón de Mute / Unmute */
.audio-toggle-btn {
  position: absolute;
  top: 70px;
  right: 16px;
  z-index: 30;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Info Inferior de la Propiedad */
.reel-info-overlay {
  position: absolute;
  bottom: 28px;
  left: 16px;
  right: 75px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.reel-owner-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reel-owner-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.reel-owner-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.1px;
}

.reel-badge-status {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.reel-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.2px;
  line-height: 1.25;
}

.reel-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.reel-price {
  font-size: 1.2rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.reel-price-period {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}

.reel-desc {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 400;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Acciones Flotantes Laterales */
.reel-actions {
  position: absolute;
  right: 14px;
  bottom: 32px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: -0.1px;
  transition: transform 0.15s ease, opacity 0.15s ease;
  background: transparent;
  border: none;
  cursor: pointer;
}

.action-btn:active {
  transform: scale(0.92);
  opacity: 0.8;
}

.action-btn .icon-box {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* Botón Destacado: Reservar Directo */
.action-btn.reserve .icon-box {
  background: #ffffff;
  border: none;
  color: #000000;
}

.action-btn.reserve {
  color: #ffffff;
  font-weight: 600;
}

/* ==========================================
   6. SKELETON LOADER
   ========================================== */
.reel-skeleton {
  width: 100%;
  height: 100vh;
  position: relative;
  background: #09090b;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.skeleton-pill {
  width: 130px;
  height: 32px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  margin-top: 50px;
}

.skeleton-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.skeleton-line {
  height: 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.skeleton-line.w-36 { width: 140px; }
.skeleton-line.w-24 { width: 90px; }
.skeleton-line.w-full { width: 80%; }

/* ==========================================
   7. MODALES (MAPA Y RESERVA - GLASSMORPHISM)
   ========================================== */
.map-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.map-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.map-modal-content {
  width: 100%;
  max-width: 380px;
  height: 70vh;
  max-height: 520px;
  background: #09090b;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.map-modal-header {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.map-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.map-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.map-header-info h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.2px;
}

.map-header-info p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.close-map-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.close-map-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

.expanded-map-body {
  flex: 1;
  width: 100%;
}

.map-modal-footer {
  padding: 16px 20px;
  background: #09090b;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-gmaps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: #ffffff;
  color: #000000;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 14px;
  text-decoration: none;
  letter-spacing: -0.2px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-gmaps:active {
  transform: scale(0.98);
}

/* Estilos de botones personalizados */
.btn-gmaps.\!bg-emerald-600 {
  background-color: #059669 !important;
  color: #ffffff !important;
}

.btn-gmaps.\!bg-emerald-600:active {
  background-color: #047857 !important;
}

/* ==========================================
   8. ESTILIZACIÓN DE FLATPICKR Y FORMULARIO DE RESERVA
   ========================================== */
.flatpickr-calendar {
  background: #18181b !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.8) !important;
}

.flatpickr-day.selected, 
.flatpickr-day.startRange, 
.flatpickr-day.endRange {
  background: #2563eb !important;
  border-color: #2563eb !important;
}

.flatpickr-day.inRange {
  background: rgba(37, 99, 235, 0.25) !important;
  box-shadow: -5px 0 0 rgba(37, 99, 235, 0.25), 5px 0 0 rgba(37, 99, 235, 0.25) !important;
}

/* ==========================================
   MODAL DE RESERVA HIGH-END (BOOOKING SHEET)
   ========================================== */

/* Contenedor principal del modal */
.booking-card-modal {
  width: 100%;
  max-width: 390px;
  background: #0c0c0e;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Header con etiqueta y precio */
.booking-header {
  padding: 20px 20px 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.booking-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.booking-title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.booking-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: #2563eb;
  margin-top: 4px;
}

.close-booking-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #a1a1aa;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.close-booking-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

/* Cuerpo con campos estilizados */
.booking-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.booking-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.booking-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: #a1a1aa;
  display: flex;
  align-items: center;
  gap: 6px;
}

.booking-label svg {
  width: 14px;
  height: 14px;
  color: #3b82f6;
}

.input-container {
  position: relative;
  width: 100%;
}

.input-container input,
.input-container select {
  width: 100%;
  background: #141417;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #ffffff;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  appearance: none;
}

.input-container input:focus,
.input-container select:focus {
  border-color: #3b82f6;
  background: #18181c;
}

/* Resumen del Precio */
.booking-summary-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 12px 14px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.summary-label {
  color: #a1a1aa;
}

.summary-val {
  color: #e4e4e7;
  font-weight: 500;
}

.summary-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.summary-row.total {
  font-weight: 600;
  color: #ffffff;
  font-size: 0.88rem;
}

.total-val {
  color: #10b981;
  font-size: 1.05rem;
  font-weight: 700;
}

/* Botón de WhatsApp */
.booking-footer {
  padding: 0 20px 20px 20px;
}

.btn-confirm-whatsapp {
  width: 100%;
  padding: 14px;
  background: #10b981;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 16px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-confirm-whatsapp:active {
  transform: scale(0.98);
  background: #059669;
}
/* ==========================================
   CÁPSULA DE VOLUMEN ESTILO INSTAGRAM (CSS)
   ========================================== */

/* Contenedor principal en forma de cápsula flotante */
.instagram-volume-pill {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 30;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 4px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); /* Animación elástica de expansión */
}

/* Botón principal del ícono */
.audio-toggle-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animación sutil al hacer clic/tocar el botón */
.audio-toggle-btn:active {
  transform: scale(0.85);
}

/* Estilo del ícono interior */
.audio-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Contenedor colapsado del slider de volumen */
.volume-slider-container {
  width: 0px;
  opacity: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease, margin 0.35s ease;
}

/* Efecto Hover (PC): Se despliega la barra elásticamente */
.instagram-volume-pill:hover .volume-slider-container,
.instagram-volume-pill:focus-within .volume-slider-container,
.instagram-volume-pill.is-active .volume-slider-container {
  width: 75px; /* Ancho de la barra deslizable */
  opacity: 1;
  margin-left: 6px;
  margin-right: 4px;
}

/* Barra deslizante (Range Input) moderna */
.volume-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3.5px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
}

/* Círculo deslizante (Thumb) */
.volume-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.volume-range::-webkit-slider-thumb:hover {
  transform: scale(1.35);
}

.volume-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}
/* Overlay invisible sobre el video para capturar taps */
.video-touch-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  cursor: pointer;
}

/* Indicador central flotante */
.play-state-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 25;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.play-state-indicator .state-icon {
  width: 32px;
  height: 32px;
  stroke-width: 2.2px;
}

/* Animación Pop-up al pausar/reproducir */
.play-state-indicator.animate-pop {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.15);
}
/* ==========================================
   9. ENTORNO COMPUTADORA (ESTILO INSTAGRAM WEB)
   ========================================== */
@media (min-width: 768px) {
  body {
    background-color: #0d0d0e; /* Fondo oscuro fuera del marco */
  }

  .reels-container {
    height: 92vh;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  }

  .reel-card,
  .reel-skeleton {
    height: 92vh;
  }
}