/* =============================================
   GRUPO OMAPRO — Estilos responsivos
   ============================================= */

/* ---- Desktop grande (≤1200px) ---- */
@media (max-width: 1200px) {
  :root {
    --hero-content-max: 560px;
  }

  .hero__overlay {
    background: linear-gradient(
      to right,
      rgba(255, 255, 255, 1)    0%,
      rgba(255, 255, 255, 0.96) 32%,
      rgba(255, 255, 255, 0.72) 48%,
      rgba(255, 255, 255, 0.25) 62%,
      rgba(255, 255, 255, 0)    78%
    );
  }
}

/* ---- Tablet (≤1024px) ---- */
@media (max-width: 1024px) {
  :root {
    --header-height:   80px;
    --hero-content-max: 440px;
  }

  .nav__list {
    gap: var(--spacing-md);
  }

  .btn--header {
    font-size: 0.65rem;
    padding: 0.55rem 1rem;
  }

  .hero__image {
    object-position: 68% center;
  }

  .hero__overlay {
    background: linear-gradient(
      to right,
      rgba(255, 255, 255, 1)    0%,
      rgba(255, 255, 255, 0.97) 30%,
      rgba(255, 255, 255, 0.78) 48%,
      rgba(255, 255, 255, 0.20) 65%,
      rgba(255, 255, 255, 0)    80%
    );
  }

  .feature-item__icon {
    width: 22px;
    height: 22px;
  }

  /* Footer nosotros */
  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
  }

  /* Stats nosotros */
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl) var(--spacing-2xl);
  }

  .mvv__grid {
    gap: var(--spacing-xl) var(--spacing-2xl);
  }
}

/* ---- Tablet pequeña (≤900px) ---- */
@media (max-width: 900px) {
  :root {
    --hero-content-max: 360px;
  }

  .hero__image {
    object-position: 72% center;
  }

  .hero__overlay {
    background: linear-gradient(
      to right,
      rgba(255, 255, 255, 1)    0%,
      rgba(255, 255, 255, 0.97) 35%,
      rgba(255, 255, 255, 0.82) 52%,
      rgba(255, 255, 255, 0.25) 68%,
      rgba(255, 255, 255, 0)    82%
    );
  }
}

/* ---- Móvil (≤768px) ---- */
@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }

  /* ---- Header móvil ---- */
  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background-color: var(--color-white);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    justify-content: flex-start;
    padding: calc(var(--header-height) + var(--spacing-xl)) var(--spacing-xl) 2rem;
    transition: right var(--transition-base);
    z-index: 999;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .nav--open {
    right: 0;
  }

  .nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-lg);
  }

  .nav__link {
    font-size: var(--font-size-sm);
  }

  .btn--header {
    display: none;
  }

  .nav-toggle--active .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle--active .nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle--active .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* ---- Hero móvil ---- */
  /* La imagen es siempre fondo; el texto siempre visible centrado */
  .hero {
    min-height: 88vw;
    align-items: center;
    padding-top: var(--header-height);
    padding-bottom: 0;
  }

  .hero__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .hero__image {
    object-fit: cover;
    object-position: 76% center;
  }

  .hero__overlay {
    background: linear-gradient(
      to right,
      rgba(255, 255, 255, 1)    0%,
      rgba(255, 255, 255, 0.98) 35%,
      rgba(255, 255, 255, 0.88) 55%,
      rgba(255, 255, 255, 0.40) 78%,
      rgba(255, 255, 255, 0.05) 100%
    );
  }

  .hero__inner {
    padding-left: 0;
    align-self: center;
  }

  .hero__content {
    max-width: 62%;
    padding: clamp(1.5rem, 5vw, 2.5rem) 0 clamp(1.5rem, 5vw, 2.5rem) 1.5rem;
  }

  .hero__title {
    font-size: clamp(1.2rem, 4.5vw, 1.75rem);
    margin-bottom: 0.75rem;
  }

  .hero__title br {
    display: none;
  }

  .hero__subtitle {
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    margin-bottom: 1.25rem;
    max-width: 100%;
  }

  .hero__actions {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }

  .hero__actions .btn {
    font-size: 0.75rem;
    padding: 0.65rem 1.25rem;
    width: auto;
  }

  /* ---- Features bar móvil ---- */
  .features-bar {
    padding: var(--spacing-xl) 0;
  }

  .features-bar__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg) var(--spacing-md);
  }

  .feature-item {
    flex: unset;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: var(--spacing-sm);
    text-align: left;
  }

  .feature-item__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }

  .feature-item__text {
    font-size: 0.7rem;
    line-height: 1.3;
  }

  /* ---- Nosotros: página hero ---- */
  .page-hero__overlay {
    background: linear-gradient(
      to right,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(255, 255, 255, 0.92) 45%,
      rgba(255, 255, 255, 0.55) 70%,
      rgba(255, 255, 255, 0.10) 100%
    );
  }

  /* ---- Nosotros: MVV ---- */
  .mvv__grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .mvv__card--centered .mvv__icon-img {
    width: 64px;
    height: 64px;
  }

  .mvv__card--centered .mvv__icon-wrap {
    width: 64px;
    height: 64px;
  }

  .mvv__valores {
    padding-top: var(--spacing-xl);
    max-width: 100%;
  }

  /* ---- Nosotros: stats ---- */
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
  }

  .stat-item__icon-wrap {
    width: 48px;
    height: 48px;
  }

  .stat-item__icon {
    width: 42px;
    height: 42px;
  }

  /* ---- Nosotros: certs ---- */
  /* El marquee maneja su propio responsive */

  /* ---- Footer ---- */
  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
  }

  .footer__col--brand {
    grid-column: 1 / -1;
  }
}

/* ---- Móvil pequeño (≤600px) ---- */
@media (max-width: 600px) {
  .hero {
    min-height: 100vw;
  }

  .hero__content {
    max-width: 70%;
    padding-left: 1.5rem;
  }

  /* Stats nosotros */
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md) var(--spacing-lg);
  }

  .stat-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
  }

  .stat-item__icon-wrap {
    width: 44px;
    height: 44px;
  }

  .stat-item__icon {
    width: 38px;
    height: 38px;
  }

  .stat-item__label {
    font-size: 0.58rem;
  }

  /* Footer */
  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
  }

  .footer__col--brand {
    grid-column: 1 / -1;
  }

  /* Certs nosotros — marquee maneja su propio responsive */
}

/* ---- Móvil (≤480px) ---- */
@media (max-width: 480px) {
  .logo__name {
    font-size: var(--font-size-xl);
  }

  .hero {
    min-height: 115vw;
  }

  .hero__image {
    object-position: 80% center;
  }

  .hero__content {
    max-width: 76%;
    padding: var(--spacing-xl) 0 var(--spacing-xl) 1.5rem;
  }

  .hero__title {
    font-size: clamp(1.05rem, 5vw, 1.4rem);
  }

  /* Features bar: 1 columna */
  .features-bar__inner {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .feature-item {
    justify-content: flex-start;
  }

  /* Page hero nosotros */
  .page-hero__overlay {
    background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.97) 0%,
      rgba(255, 255, 255, 0.88) 60%,
      rgba(255, 255, 255, 0.50) 85%,
      rgba(255, 255, 255, 0)    100%
    );
  }

  /* Stats nosotros */
  .stat-item__number {
    font-size: 1.4rem;
  }

  /* Footer */
  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .footer__col--brand {
    grid-column: 1;
  }

  /* Certs — marquee maneja su propio responsive */
}

/* ---- Móvil muy pequeño (≤360px) ---- */
@media (max-width: 360px) {
  .hero__content {
    max-width: 84%;
    padding-left: 1.25rem;
  }

  .hero__title {
    font-size: 1rem;
  }

  /* Stats nosotros */
  .stats {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .stat-item {
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
  }

  .mvv__card {
    gap: var(--spacing-sm);
  }

  .certs__grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* =============================================
   DROPDOWN — Responsive móvil (≤768px)
   ============================================= */
@media (max-width: 768px) {

  /* Resetear TODAS las propiedades de desktop que interfieren */
  .nav__dropdown {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    min-width: unset !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border-top: none !important;
    border-left: 3px solid var(--color-gold) !important;
    border-right: none !important;
    border-bottom: none !important;
    /* Anular opacity/visibility de desktop — usar solo display */
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: none !important;
    /* Estado por defecto: oculto con display */
    display: none !important;
    /* Espaciado */
    padding: 0.25rem 0 !important;
    margin: 0.5rem 0 0.75rem 0 !important;
    width: 100% !important;
    background-color: rgba(0, 33, 71, 0.04) !important;
    box-sizing: border-box !important;
  }

  /* Cuando está abierto, mostrar con display block */
  .nav__item--open .nav__dropdown {
    display: block !important;
  }

  .nav__dropdown::before,
  .nav__dropdown::after {
    display: none !important;
  }

  /* El li padre ocupa todo el ancho */
  .nav__item {
    width: 100%;
  }

  /* El link con flecha ocupa todo el ancho */
  .nav__link--dropdown {
    cursor: pointer;
    justify-content: space-between;
    width: 100%;
    display: flex;
  }

  /* Ítems del acordeón */
  .nav__dropdown-item {
    width: 100%;
    box-sizing: border-box;
  }

  .nav__dropdown-item a {
    font-size: 0.85rem !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    padding: 0.65rem 1rem 0.65rem 1.25rem !important;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: break-word;
    color: var(--color-navy) !important;
    display: block;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.45;
  }

  .nav__dropdown-item a:hover {
    padding-left: 1.5rem !important;
    color: var(--color-gold) !important;
    background-color: rgba(0, 33, 71, 0.06);
  }

  /* La flecha no encoge el texto del enlace */
  .nav__link--dropdown .nav__arrow {
    flex-shrink: 0;
    margin-left: 0.5rem;
  }
}
