/* ==========================================================================
   RGW PERÚ - STYLESHEET PRINCIPAL
   Estilos corporativos, figuras geométricas, animaciones e interactividad
   ========================================================================== */

:root {
  --rgw-navy-900: #0E1B2C;
  --rgw-navy-800: #12233C;
  --rgw-navy-700: #182E4E;
  --rgw-navy-600: #1B2A4A;
  --rgw-yellow: #F5B31B;
  --rgw-yellow-hover: #E09F10;
  --rgw-yellow-light: #FEF3C7;
  --rgw-slate-700: #334155;
  --rgw-slate-600: #475569;
  --rgw-slate-500: #64748B;
  --rgw-slate-100: #F1F5F9;
  --rgw-slate-50: #F8FAFC;
  --rgw-whatsapp: #25D366;
}

/* Tipografía base y scroll suave */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--rgw-slate-700);
}

body {
  background-color: #FFFFFF;
  overflow-x: hidden;
}

/* Barra de desplazamiento elegante */
::-webkit-scrollbar {
  width: 9px;
}
::-webkit-scrollbar-track {
  background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--rgw-yellow);
}

/* ==========================================================================
   GEOMETRÍA Y COMPOSICIÓN DEL HERO
   ========================================================================== */
.hero-composition {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin-left: auto;
}

/* Contenedor principal de la imagen con corte poligonal sutil */
.hero-image-wrapper {
  position: relative;
  z-index: 10;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 20px 45px -15px rgba(18, 35, 60, 0.22);
  background-color: #FFFFFF;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-image-wrapper:hover {
  transform: translateY(-3px);
  box-shadow: 0 25px 50px -12px rgba(18, 35, 60, 0.3);
}

/* Polígonos de acento geométrico (Estilo RGW Perú del diseño) */
.hero-polygon-navy-top {
  position: absolute;
  top: -16px;
  left: 35px;
  width: 64px;
  height: 140px;
  background-color: var(--rgw-navy-800);
  clip-path: polygon(45% 0%, 100% 0%, 55% 100%, 0% 100%);
  z-index: 20;
  pointer-events: none;
  box-shadow: -4px 6px 16px rgba(0, 0, 0, 0.15);
}

.hero-polygon-yellow {
  position: absolute;
  bottom: 25px;
  left: -20px;
  width: 58px;
  height: 125px;
  background-color: var(--rgw-yellow);
  clip-path: polygon(45% 0%, 100% 0%, 55% 100%, 0% 100%);
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(245, 179, 27, 0.35);
}

.hero-polygon-navy-bottom {
  position: absolute;
  bottom: -15px;
  right: -10px;
  width: 90px;
  height: 120px;
  background-color: var(--rgw-navy-900);
  clip-path: polygon(30% 0%, 100% 0%, 100% 100%, 0% 100%);
  z-index: 12;
  pointer-events: none;
}

/* Efecto de máscara poligonal en el lado izquierdo de la imagen */
.hero-photo-clipped {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Decoración de fondo de degradado sutil */
.hero-bg-glow {
  position: absolute;
  top: 15%;
  right: -5%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(245, 179, 27, 0.08) 0%, rgba(18, 35, 60, 0.04) 50%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* ==========================================================================
   SERVICIOS RÁPIDOS (TARJETAS)
   ========================================================================== */
.service-quick-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 8px;
  padding: 1.25rem 1rem;
}

.service-quick-card:hover {
  transform: translateY(-4px);
  background-color: #FFFFFF;
  box-shadow: 0 12px 24px -8px rgba(18, 35, 60, 0.12);
}

.service-quick-card:hover .service-icon {
  transform: scale(1.08);
}

.service-icon {
  transition: transform 0.3s ease;
}

/* ==========================================================================
   DROPDOWN MENÚ DE SERVICIOS
   ========================================================================== */
.dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.dropdown-container:hover .dropdown-menu,
.dropdown-container:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ==========================================================================
   WIDGET FLOTANTE DE WHATSAPP
   ========================================================================== */
.whatsapp-floating {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background-color: var(--rgw-whatsapp);
  color: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
}

.whatsapp-floating:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.6);
}

.whatsapp-floating::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid var(--rgw-whatsapp);
  opacity: 0.75;
  animation: wa-pulse 2s infinite cubic-bezier(0.24, 0, 0.38, 1);
  pointer-events: none;
}

@keyframes wa-pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.25);
    opacity: 0;
  }
  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}

/* Tooltip de WhatsApp */
.whatsapp-tooltip {
  position: absolute;
  right: 72px;
  background-color: var(--rgw-navy-900);
  color: #FFFFFF;
  font-size: 0.775rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateX(10px);
  transition: all 0.3s ease;
}

.whatsapp-floating:hover .whatsapp-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* ==========================================================================
   FORMULARIO DE CONTACTO Y VALIDACIONES
   ========================================================================== */
.form-input {
  width: 100%;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  background-color: #FFFFFF;
  color: var(--rgw-slate-700);
  transition: all 0.2s ease-in-out;
}

.form-input:focus {
  outline: none;
  border-color: var(--rgw-yellow);
  box-shadow: 0 0 0 3px rgba(245, 179, 27, 0.2);
}

.form-input.is-invalid {
  border-color: #EF4444;
  background-color: #FEF2F2;
}

.form-input.is-valid {
  border-color: #10B981;
}

.field-error-message {
  font-size: 0.78rem;
  color: #DC2626;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Animación de alerta */
@keyframes slideDownAlert {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-alert {
  animation: slideDownAlert 0.35s ease-out forwards;
}

/* Spinner de carga para botón */
.spinner {
  display: inline-block;
  width: 1.15rem;
  height: 1.15rem;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #FFFFFF;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   MODAL DE BÚSQUEDA
   ========================================================================== */
.search-modal-backdrop {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.search-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.search-modal-content {
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.search-modal-backdrop.active .search-modal-content {
  transform: scale(1);
}

/* ==========================================================================
   RESPONSIVE DESIGN Y AJUSTES MÓVILES
   ========================================================================== */
@media (max-width: 1023px) {
  .hero-polygon-navy-top {
    left: 20px;
    width: 45px;
    height: 100px;
  }
  .hero-polygon-yellow {
    left: -10px;
    width: 42px;
    height: 90px;
  }
  .hero-composition {
    margin-top: 2rem;
  }
}

@media (max-width: 640px) {
  .whatsapp-floating {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 52px;
    height: 52px;
  }
}
