@import url('./variables.css');

/* ============================================
   Font Face con Métricas Optimizadas
   ============================================ */

@font-face {
  font-family: 'Montserrat-fallback';
  size-adjust: 100%;
  ascent-override: 95%;
  descent-override: 25%;
  line-gap-override: 0%;
  src: local('Arial'), local('Helvetica'), local('system-ui'), local('-apple-system'), local('BlinkMacSystemFont'), local('Segoe UI'), local('Roboto'), local('sans-serif');
}

/* ============================================
   Reset y Base (Crítico)
   ============================================ */

* {
  font-family: var(--font-family-primary), 'Montserrat-fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-optical-sizing: auto;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  font-family: var(--font-family-primary), 'Montserrat-fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-optical-sizing: auto;
  background-image: url('/assets/img/background.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-blend-mode: overlay;
  background-color: var(--color-bg-overlay);
}

*:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

/* ============================================
   Navegación (Crítico - Above the fold)
   ============================================ */

.nav-link-hover {
  position: relative;
  transition: all var(--transition-normal);
  padding: var(--spacing-sm) var(--spacing-md) !important;
  border-radius: var(--border-radius-xl);
}

.nav-link-hover:hover {
  background-color: var(--color-bg-light);
  color: var(--color-primary) !important;
  transform: translateY(-2px);
}

.nav-link-hover.active {
  background-color: var(--color-primary);
  color: var(--color-text-white) !important;
  font-weight: 600;
}

.nav-link-hover.active:hover {
  background-color: var(--color-primary-dark);
  color: var(--color-text-white) !important;
  transform: translateY(-2px);
}

.nav-link-hover.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 767.98px) {
  .navbar {
    position: relative;
  }

  .navbar .container-fluid {
    padding-left: 16px !important;
    padding-right: 16px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    position: relative;
  }

  .navbar-brand {
    order: 1;
    margin-right: auto;
    flex-shrink: 0;
  }

  .navbar-toggler {
    order: 2;
    margin-left: auto;
    margin-right: 0;
    flex-shrink: 0;
  }

  .navbar-collapse {
    background-color: #fff;
    border-radius: 0 0 16px 16px;
    margin-top: 0;
    padding: 16px 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(125, 138, 71, 0.1);
    border-top: none;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
  }

  .navbar-nav {
    padding: 0 16px;
    margin: 0;
    width: 100%;
  }

  .nav-item {
    margin-bottom: 6px;
    width: 100%;
  }

  .nav-link-hover {
    padding: 14px 20px !important;
    border-radius: 10px;
    margin: 2px 0;
    display: block;
    text-align: left;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
    width: 100%;
  }

  .nav-link-hover.active {
    background-color: var(--color-primary);
    color: var(--color-text-white) !important;
    font-weight: 600;
    padding: 14px 20px !important;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .navbar .container-fluid {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  .navbar-nav {
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
  }

  .nav-link-hover {
    padding: 8px 10px !important;
    font-size: 0.875rem;
    white-space: nowrap;
    line-height: 1.2;
  }
}

/* ============================================
   Hero Section (Crítico - Above the fold)
   ============================================ */

.hero-section {
  position: relative;
  margin-top: 0;
  padding-top: 0;
  overflow: hidden;
}

.hero-image {
  position: relative;
  width: 100%;
  height: 600px;
  object-fit: cover;
  filter: brightness(0.5);
}

.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  z-index: 2;
  width: 90%;
  max-width: 900px;
}

.hero-title {
  font-size: clamp(2.2rem, 4.5vw, 3rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.3rem);
  font-weight: 400;
  margin-bottom: 2rem;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

.hero-btn {
  padding: 16px 40px;
  font-size: 1.125rem;
  font-weight: 600;
  border-radius: 50px;
  background: var(--primary);
  border: none;
  color: #fff;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.hero-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(125, 138, 71, 0.4);
  color: #fff;
}

@media (max-width: 768px) {
  .hero-image {
    height: 450px;
  }

  .hero-content {
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 0 20px;
    width: 95%;
  }

  .hero-title {
    font-size: clamp(1.4rem, 4.5vw, 1.8rem);
    line-height: 1.25;
    margin-bottom: 0.75rem;
    word-wrap: break-word;
    hyphens: auto;
    padding: 0 5px;
  }

  .hero-subtitle {
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    line-height: 1.35;
    margin-bottom: 1.25rem;
    padding: 0 5px;
  }

  .hero-btn {
    padding: 12px 28px;
    font-size: 0.95rem;
  }
}

@media (max-width: 576px) {
  .hero-image {
    height: 400px;
  }

  .hero-content {
    padding: 0 16px;
    width: 95%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .hero-title {
    font-size: clamp(1.2rem, 5vw, 1.5rem);
    line-height: 1.2;
    margin-bottom: 0.5rem;
    padding: 0;
  }

  .hero-subtitle {
    font-size: clamp(0.75rem, 3vw, 0.9rem);
    line-height: 1.3;
    margin-bottom: 1rem;
    padding: 0;
  }

  .hero-btn {
    padding: 10px 24px;
    font-size: 0.875rem;
  }
}

/* ============================================
   Section Header (Crítico - Above the fold)
   ============================================ */

.section-header {
  text-align: center;
  max-width: 1000px;
  margin: 0 auto 80px;
}

.section-badge {
  display: inline-block;
  padding: 8px 20px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 50px;
  margin-bottom: 24px;
}

.section-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 24px;
  line-height: 1.2;
  white-space: normal;
  text-align: center;
  width: 100%;
}

.section-description {
  font-size: clamp(0.95rem, 1.1vw, 1.1rem);
  color: var(--text-dark);
  line-height: 1.7;
  font-weight: 400;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .section-description {
    text-align: justify;
    text-align-last: left;
    text-justify: inter-word;
    hyphens: auto;
    word-spacing: normal;
  }
}

/* ============================================
   Main Section (Crítico - Above the fold)
   ============================================ */

.main-section {
  padding: 50px 0;
  position: relative;
}

@media (max-width: 768px) {
  .main-section {
    padding: 40px 0;
  }
}

/* ============================================
   Service Card (Crítico - Above the fold)
   ============================================ */

.service-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.service-card {
  padding: 20px;
  transition: all 0.3s ease;
  border-radius: 16px;
  cursor: pointer;
  position: relative;
}

.service-card:hover {
  transform: translateY(-8px);
}

.service-title {
  color: var(--color-text);
  font-weight: 600;
  margin-top: 15px;
  transition: color 0.3s ease;
  text-align: center;
  width: 100%;
}

.service-card:hover .service-title {
  color: var(--color-primary);
}

.service-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: 8px;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.3s ease;
  text-align: center;
  font-weight: 500;
}

.service-card:hover .service-hint {
  opacity: 1;
  transform: translateY(0);
  color: var(--color-primary);
}

.img-fluid-performance {
  width: 180px;
  height: 180px;
  object-fit: cover;
}

