/* ==========================================================================
   Estilos personalizados - Buen Día Construcciones & Reformas
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --primary-gold: #eab308;
  --primary-gold-dark: #ca8a04;
  --primary-gold-light: #fef08a;
  --dark-slate: #0f172a;
  --dark-surface: #1e293b;
  --text-muted: #94a3b8;
}

html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

h1, h2, h3, .font-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.025em;
}

/* Scrollbar estilizado */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #eab308;
}

/* Glassmorphism */
.glass-header {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.glass-card-light {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

/* Efecto de borde brillante sutil */
.glow-border {
  position: relative;
}
.glow-border::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.4), transparent, rgba(234, 179, 8, 0.1));
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.glow-border:hover::after {
  opacity: 1;
}

/* Hero Background Pattern */
.bg-grid-pattern {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

/* ==========================================================================
   Comparador Interactivo "Antes / Después"
   ========================================================================== */
.ba-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 580px;
  overflow: hidden;
  user-select: none;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.ba-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ba-before-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  z-index: 2;
  will-change: width;
}

.ba-before-wrapper .ba-image {
  width: 100%;
  min-width: 100%;
  object-fit: cover;
}

/* Usamos ancho dinámico fijado por JS */
.ba-before-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  max-width: none;
}

.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: #ffffff;
  z-index: 3;
  transform: translateX(-50%);
  cursor: ew-resize;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}

.ba-handle-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: #eab308;
  border: 3px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  color: #0f172a;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.ba-container:hover .ba-handle-button {
  transform: translate(-50%, -50%) scale(1.1);
  background: #facc15;
}

.ba-badge {
  position: absolute;
  bottom: 1.25rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 4;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.ba-badge-before {
  left: 1.25rem;
  background: rgba(15, 23, 42, 0.75);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.ba-badge-after {
  right: 1.25rem;
  background: rgba(234, 179, 8, 0.9);
  color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Galería e Imagen Hover
   ========================================================================== */
.gallery-card {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}
.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.15);
}
.gallery-card img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-card:hover img {
  transform: scale(1.06);
}

/* Filtros activos */
.filter-btn.active {
  background-color: #eab308;
  color: #0f172a;
  border-color: #eab308;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.35);
}

/* ==========================================================================
   Lightbox Modal
   ========================================================================== */
.lightbox-modal {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}
.lightbox-content {
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox-modal.active .lightbox-content {
  transform: scale(1);
}

/* ==========================================================================
   Calculadora de Presupuesto
   ========================================================================== */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}
input[type=range]:focus {
  outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  cursor: pointer;
  background: #334155;
  border-radius: 9999px;
}
input[type=range]::-webkit-slider-thumb {
  height: 24px;
  width: 24px;
  border-radius: 50%;
  background: #eab308;
  border: 3px solid #ffffff;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -8px;
  box-shadow: 0 2px 10px rgba(234, 179, 8, 0.5);
  transition: transform 0.15s ease;
}
input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* ==========================================================================
   WhatsApp Floating Button
   ========================================================================== */
.whatsapp-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background-color: #25d366;
  color: #fff;
  border-radius: 50px;
  text-align: center;
  font-size: 32px;
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.whatsapp-float:hover {
  transform: scale(1.1) rotate(5deg);
  background-color: #20ba5a;
  box-shadow: 0 14px 28px rgba(37, 211, 102, 0.5);
}

.whatsapp-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  opacity: 0.7;
  animation: pulse-wave 2s infinite;
  z-index: -1;
}

@keyframes pulse-wave {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Animaciones y utilidades */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
