/* ===== IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;600;700&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  /* Colors */
  --color-primary: #ff3c00;
  --color-primary-dark: #d93400;
  --color-primary-light: #ff6b35;
  --color-background: #0a0a0a;
  --color-surface: #1a1a1a;
  --color-text-primary: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.7);
  --color-text-muted: rgba(255, 255, 255, 0.5);
  --color-border: rgba(255, 255, 255, 0.1);
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Playfair Display', serif;
  --font-size-base: 1rem;
  --line-height-base: 1.6;
  --letter-spacing-tight: -0.025em;
  --letter-spacing-wide: 0.025em;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  
  /* Layout */
  --container-max-width: 1200px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-full: 50px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-primary: 0 4px 12px rgba(255, 60, 0, 0.3);
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text-primary);
  background-color: var(--color-background);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== UTILITIES ===== */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding-left: var(--spacing-sm);
  padding-right: var(--spacing-sm);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== HEADER ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.9) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) var(--spacing-lg);
  min-height: 80px;
}

header.scrolled {
  background: rgba(10, 10, 10, 0.95) !important;
  border-bottom-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

/* Asegurar que Bootstrap no interfiera */
header * {
  color: inherit !important;
}

header .navbar-brand {
  color: var(--color-primary) !important;
}

header .nav-link {
  color: var(--color-text-secondary) !important;
}

header .nav-link:hover,
header .nav-link.active {
  color: var(--color-text-primary) !important;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.logo:hover {
  transform: scale(1.05);
}

.logo img {
  height: clamp(32px, 6vw, 48px);
  width: auto;
}

/* ===== NAVIGATION ===== */
nav {
  display: flex;
  flex: 1;
  justify-content: flex-end;
}

nav ul {
  display: flex;
  list-style: none;
  gap: clamp(0.25rem, 1vw, 0.5rem);
  align-items: center;
  margin: 0;
  flex-wrap: wrap;
}

nav a {
  display: inline-flex;
  align-items: center;
  padding: clamp(0.375rem, 1.5vw, 0.5rem) clamp(0.75rem, 3vw, 1.5rem);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  border-radius: var(--border-radius-full);
  letter-spacing: var(--letter-spacing-wide);
  transition: all var(--transition-base);
  position: relative;
  white-space: nowrap;
}

nav a::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: -1;
}

nav a:hover,
nav a.activo {
  color: var(--color-text-primary);
  transform: translateY(-1px);
}

nav a:hover::before,
nav a.activo::before {
  opacity: 0.15;
}

/* ===== HAMBURGER MENU ===== */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: var(--spacing-xs);
  border: none;
  background: transparent;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-base);
}

.hamburger:hover {
  background: rgba(255, 60, 0, 0.1);
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: var(--color-text-primary);
  margin: 3px 0;
  transition: all var(--transition-base);
  border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

.nav-mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, 0.98) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all var(--transition-base);
  z-index: 999;
}

.nav-mobile.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-mobile ul {
  flex-direction: column;
  padding: var(--spacing-md);
  gap: var(--spacing-xs);
  margin: 0 !important;
  list-style: none !important;
}

.nav-mobile li {
  margin: 0;
  padding: 0;
}

.nav-mobile a {
  width: 100%;
  text-align: center;
  padding: var(--spacing-md);
  border-radius: var(--border-radius-md);
  color: var(--color-text-secondary) !important;
  background: transparent !important;
  border: none !important;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: all var(--transition-base);
  display: block;
}

.nav-mobile a:hover,
.nav-mobile a.activo {
  color: var(--color-text-primary) !important;
  background: rgba(255, 60, 0, 0.15) !important;
  transform: translateY(-1px);
}

.nav-mobile a::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius-md);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: -1;
}

.nav-mobile a:hover::before,
.nav-mobile a.activo::before {
  opacity: 0.15;
}

/* ===== HERO CAROUSEL ===== */
.carrusel {
  position: relative;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.carrusel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(10, 10, 10, 0.4) 0%,
    rgba(10, 10, 10, 0.6) 50%,
    rgba(10, 10, 10, 0.8) 100%
  );
  z-index: 2;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  z-index: 3;
}

.slide.activo {
  opacity: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.4) contrast(1.1) saturate(1.2);
}

.texto {
  position: absolute;
  left: clamp(1rem, 4vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
  max-width: clamp(300px, 60vw, 600px);
  z-index: 10;
  padding-right: var(--spacing-sm);
}

.texto h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: clamp(1rem, 3vw, 1.5rem);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text-primary);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.texto p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--color-text-secondary);
  margin-bottom: clamp(2rem, 5vw, 3rem);
  max-width: 500px;
  line-height: 1.7;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

/* ===== BUTTONS ===== */
.boton {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: clamp(0.75rem, 2.5vw, 1.5rem) clamp(1.5rem, 4vw, 3rem);
  font-size: clamp(0.9rem, 2vw, 1rem);
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--border-radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-text-primary);
  box-shadow: var(--shadow-primary);
  min-width: fit-content;
}

.boton:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 60, 0, 0.4);
}

.boton::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-primary-dark), #b82e00);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.boton:hover::before {
  opacity: 1;
}

.boton span {
  position: relative;
  z-index: 1;
}

/* ===== FOOTER ===== */
.footer {
  background: linear-gradient(135deg, var(--color-surface), #0d0d0d);
  padding: var(--spacing-2xl) 0 var(--spacing-lg);
  margin-top: var(--spacing-2xl);
  border-top: 1px solid var(--color-border);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-primary) 50%,
    transparent 100%
  );
}

.footer-contenido {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

.footer-logo h2,
.footer-ubicacion h3,
.footer-contacto h3 {
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  color: var(--color-text-primary);
  position: relative;
  padding-bottom: var(--spacing-xs);
}

.footer-logo h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--spacing-sm);
}

.footer-ubicacion h3::after,
.footer-contacto h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
}

.footer-logo p,
.footer-ubicacion p,
.footer-contacto p {
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xs);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  transition: color var(--transition-fast);
  line-height: 1.6;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.footer-ubicacion p:hover,
.footer-contacto p:hover {
  color: var(--color-primary);
}

.footer-logo p {
  font-style: italic;
  font-weight: 300;
}

.footer-abajo {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
  text-align: center;
  color: var(--color-text-muted);
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-sm);
  padding-right: var(--spacing-sm);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
  :root {
    --container-max-width: 1400px;
    --spacing-2xl: 5rem;
  }
  
  .texto {
    max-width: 700px;
  }
}

/* Desktop (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
  header {
    padding: var(--spacing-sm) var(--spacing-md);
  }
  
  .texto {
    left: var(--spacing-md);
  }
}

/* Tablet Landscape (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  header {
    padding: var(--spacing-sm) var(--spacing-md);
    flex-wrap: nowrap;
    min-height: 70px;
  }
  
  .hamburger {
    display: flex;
    order: 2;
  }
  
  nav {
    display: none;
  }
  
  .nav-mobile {
    display: block;
  }
  
  .logo {
    order: 1;
  }
  
  .texto {
    left: var(--spacing-md);
    max-width: 500px;
  }
  
  .footer-contenido {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
  }
  
  .footer-logo {
    grid-column: 1 / -1;
    text-align: center;
  }
}

/* Mobile Landscape (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  header {
    flex-direction: row;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    position: relative;
    background: rgba(10, 10, 10, 0.95);
    min-height: auto;
  }
  
  .hamburger {
    display: flex;
  }
  
  nav {
    display: none;
  }
  
  .nav-mobile {
    display: block;
  }
  
  .carrusel {
    margin-top: 0;
    height: 70vh;
  }
  
  .texto {
    left: var(--spacing-sm);
    right: var(--spacing-sm);
    max-width: none;
  }
  
  .footer-contenido {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--spacing-lg);
  }
  
  .footer-ubicacion h3::after,
  .footer-contacto h3::after {
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Mobile Portrait (320px - 575px) */
@media (max-width: 575px) {
  :root {
    --spacing-xs: 0.375rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.25rem;
    --spacing-xl: 1.75rem;
    --spacing-2xl: 2.5rem;
  }
  
  header {
    flex-direction: row;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    position: relative;
    background: rgba(10, 10, 10, 0.95);
    min-height: auto;
  }
  
  .hamburger {
    display: flex;
  }
  
  nav {
    display: none;
  }
  
  .nav-mobile {
    display: block;
  }
  
  .carrusel {
    margin-top: 0;
    height: 60vh;
    min-height: 400px;
  }
  
  .texto {
    left: var(--spacing-sm);
    right: var(--spacing-sm);
    max-width: none;
    padding-right: var(--spacing-sm);
  }
  
  .boton {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.85rem;
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
  
  .footer {
    padding: var(--spacing-xl) 0 var(--spacing-lg);
  }
  
  .footer-contenido {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--spacing-lg);
  }
  
  .footer-ubicacion h3::after,
  .footer-contacto h3::after {
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Extra Small Mobile (320px and below) */
@media (max-width: 320px) {
  .logo img {
    height: 28px;
  }
  
  .texto h1 {
    font-size: 1.75rem;
  }
  
  .texto p {
    font-size: 0.95rem;
  }
  
  .boton {
    padding: 0.625rem 1rem;
    font-size: 0.8rem;
  }
  
  nav a {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .carrusel {
    height: 100vh;
  }
  
  .texto {
    top: 50%;
    transform: translateY(-50%);
  }
  
  .texto h1 {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    margin-bottom: 0.75rem;
  }
  
  .texto p {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    margin-bottom: 1.5rem;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== FOCUS STYLES ===== */
*:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.boton:focus,
nav a:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

/* ===== ANIMATIONS ===== */
@keyframes slideShow {
  0%, 20% { opacity: 1; }
  33.33%, 100% { opacity: 0; }
}

@keyframes slideInContent {
  from {
    opacity: 0;
    transform: translate(-30px, -50%);
  }
  to {
    opacity: 1;
    transform: translate(0, -50%);
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  header,
  .video-background,
  .boton {
    display: none !important;
  }
  
  body {
    color: black !important;
    background: white !important;
  }
  
  .footer {
    page-break-inside: avoid;
  }
}

/* ===== MEJORAS ADICIONALES ===== */
/* Efecto de parallax suave en el hero */
.carrusel {
  transform: translateZ(0);
  will-change: transform;
}

/* Mejora de rendimiento para animaciones */
.slide,
.hamburger span,
.nav-mobile,
.boton::before,
nav a::before {
  will-change: transform, opacity;
}

/* Efecto de hover más suave en el logo */
.logo {
  filter: drop-shadow(0 0 0 transparent);
  transition: all var(--transition-base);
}

.logo:hover {
  filter: drop-shadow(0 4px 8px rgba(255, 60, 0, 0.3));
}

/* Separadores visuales mejorados */
.footer-ubicacion h3::after,
.footer-contacto h3::after {
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
}

/* Efecto de carga suave para imágenes */
.slide img {
  transition: filter 0.3s ease;
}

.slide img:hover {
  filter: brightness(0.5) contrast(1.2) saturate(1.3);
}

/* Mejor contraste para accesibilidad */
@media (prefers-contrast: high) {
  :root {
    --color-text-secondary: rgba(255, 255, 255, 0.9);
    --color-text-muted: rgba(255, 255, 255, 0.7);
    --color-border: rgba(255, 255, 255, 0.3);
  }
}

/* Mejoras para modo oscuro del sistema */
@media (prefers-color-scheme: dark) {
  html {
    color-scheme: dark;
  }
}

/* Indicador de carga para el carrusel */
.carrusel::after {
  content: '';
  position: absolute;
  bottom: var(--spacing-lg);
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  z-index: 10;
}

/* Animación suave para el scroll */
html {
  scroll-padding-top: 80px;
}

/* Mejor espaciado para texto en móviles */
@media (max-width: 575px) {
  .texto {
    padding: var(--spacing-sm);
  }
  
  .texto h1 {
    text-align: left;
  }
  
  .texto p {
    text-align: left;
  }
}

/* Efecto de entrada para elementos del footer */
.footer-contenido > div {
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: calc(var(--delay, 0) * 0.1s);
}

.footer-logo { --delay: 1; }
.footer-ubicacion { --delay: 2; }
.footer-contacto { --delay: 3; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}