/* ==========================================================================
   RESPONSIVE.CSS — Breakpoints y Adaptaciones Mobile-First
   Don Andrés Corporativo
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base (Mobile First — < 576px)
   -------------------------------------------------------------------------- */
.main-nav__list {
    display: none;
}

.hamburger {
    display: flex;
}

/* Menú móvil abierto */
.main-nav.is-open .main-nav__list {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background-color: var(--color-white);
    box-shadow: var(--shadow-2xl);
    padding: calc(var(--header-height) + var(--space-lg)) var(--space-lg) var(--space-lg);
    z-index: var(--z-modal);
    overflow-y: auto;
    gap: 0;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.main-nav.is-open .main-nav__link {
    padding: var(--space-md);
    font-size: var(--text-base);
    border-bottom: 1px solid var(--color-gray-100);
    border-radius: 0;
}

.main-nav.is-open .dropdown {
    position: static;
    box-shadow: none;
    border: none;
    background-color: var(--color-gray-50);
    border-radius: var(--radius-md);
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
    padding: 0;
}

.main-nav.is-open .main-nav__item.is-open .dropdown {
    max-height: 500px;
    padding: var(--space-sm);
}

/* Overlay del menú */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-overlay) - 1);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.nav-overlay.is-active {
    display: block;
    opacity: 1;
}

/* Hero móvil */
.hero {
    min-height: 70vh;
}

.hero__title {
    font-size: var(--text-3xl);
}

.hero__description {
    font-size: var(--text-base);
}

/* Hero interactivo en móvil */
.hero-i__selector {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
}

.hero-i__card {
    width: 130px;
    height: 90px;
}

.hero-i__expand--open {
    max-height: none;
}

.hero-i__expand-inner {
    height: calc(100vh - var(--header-height) - 70px);
    min-height: 400px;
}

.hero-i__overlay-content {
    padding: var(--space-lg);
    max-width: 100%;
}

.hero-i__info-title {
    font-size: var(--text-2xl);
}

.hero-i__info-desc {
    font-size: var(--text-sm);
}

/* svc-grid móvil */
.svc-grid {
    grid-template-columns: 1fr;
}

.svc-card__img-wrap {
    height: 200px;
}

.svc-card__body {
    padding: var(--space-lg);
}

/* svc-static móvil */
.svc-static__card {
    flex-direction: column;
}

.svc-static__img-wrap {
    width: 100%;
    min-height: 180px;
    height: 180px;
}

/* Grids en móvil */
.svc-page__split {
    flex-direction: column;
}

.svc-page__portfolio {
    width: 100%;
}

.grid--2,
.grid--3,
.grid--4 {
    grid-template-columns: 1fr;
}

.grid--about {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
}

/* Footer en móvil */
.site-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
}

.site-footer__bottom {
    flex-direction: column;
    text-align: center;
}

.site-footer__legal {
    justify-content: center;
}

/* Galería en móvil */
.gallery {
    grid-template-columns: 1fr;
}

/* Carrusel en móvil */
.carousel__slide-image {
    height: 300px;
}

.carousel__btn {
    width: 36px;
    height: 36px;
}

.carousel__btn-icon {
    width: 16px;
    height: 16px;
}

/* Service detail features en móvil */
.service-detail__features {
    grid-template-columns: 1fr;
}

/* Section en móvil */
.section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
}

.section__title {
    font-size: var(--text-3xl);
}

/* Page hero en móvil */
.page-hero__title {
    font-size: var(--text-3xl);
}

/* CTA banner en móvil */
.cta-banner__title {
    font-size: var(--text-2xl);
}

/* About stats en móvil */
.about__stats {
    grid-template-columns: 1fr 1fr;
}

/* Servicios Showcase en móvil */
.ss__layout {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.ss__nav {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: var(--space-xs);
    gap: var(--space-xs);
}

.ss__nav::-webkit-scrollbar {
    display: none;
}

.ss__nav-item {
    flex-shrink: 0;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
}

.ss__nav-indicator {
    display: none;
}

.ss__nav-item--active {
    border-bottom: 3px solid var(--color-primary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.ss__panel {
    min-height: auto;
}

.ss__panel-image-wrap {
    height: 200px;
}

.ss__panel-body {
    padding: var(--space-lg);
}

.ss__sub-list {
    grid-template-columns: 1fr;
}

/* --------------------------------------------------------------------------
   Small Tablets — >= 576px
   -------------------------------------------------------------------------- */
@media (min-width: 576px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid--2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero__title {
        font-size: var(--text-4xl);
    }

    .carousel__slide-image {
        height: 380px;
    }

    .hero-i__card {
        width: 160px;
        height: 100px;
    }

    .hero-i__overlay-content {
        padding: var(--space-xl);
        max-width: 500px;
    }

    .hero-i__info-title {
        font-size: var(--text-3xl);
    }
}

/* --------------------------------------------------------------------------
   Tablets — >= 768px
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
    .grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid--about {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3xl);
    }

    .site-footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero {
        min-height: 80vh;
    }

    .hero__title {
        font-size: var(--text-5xl);
    }

    .hero__description {
        font-size: var(--text-lg);
    }

    .section__title {
        font-size: var(--text-4xl);
    }

    .page-hero__title {
        font-size: var(--text-4xl);
    }

    .cta-banner__title {
        font-size: var(--text-3xl);
    }

    .carousel__slide-image {
        height: 450px;
    }

    .service-detail__features {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Hero interactivo tablet */
    .hero-i__card {
        width: 200px;
        height: 120px;
    }

    .hero-i__overlay-content {
        padding: var(--space-3xl);
        max-width: 600px;
    }

    .hero-i__info-title {
        font-size: var(--text-5xl);
    }

    /* svc-grid tablet */
    .svc-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .svc-card__img-wrap {
        height: 260px;
    }

    /* svc-static tablet — horizontal */
    .svc-static__card {
        flex-direction: row;
    }

    .svc-static__img-wrap {
        width: 280px;
        min-height: 220px;
        height: auto;
    }
}

/* --------------------------------------------------------------------------
   Desktop — >= 992px
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {

    /* Mostrar navegación desktop, ocultar hamburguesa */
    .main-nav__list {
        display: flex;
    }

    .hamburger {
        display: none;
    }

    .nav-overlay {
        display: none !important;
    }

    .grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid--4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .site-footer__grid {
        grid-template-columns: 1.5fr 1fr 1fr 1fr;
    }

    .site-footer__bottom {
        flex-direction: row;
        text-align: left;
    }

    .hero {
        min-height: 85vh;
    }

    .hero__title {
        font-size: var(--text-6xl);
    }

    .hero__description {
        font-size: var(--text-xl);
    }

    .section {
        padding-top: var(--space-4xl);
        padding-bottom: var(--space-4xl);
    }

    .page-hero__title {
        font-size: var(--text-5xl);
    }

    .cta-banner__title {
        font-size: var(--text-4xl);
    }

    .carousel__slide-image {
        height: 500px;
    }

    /* Dropdown hover en desktop */
    .main-nav__item:hover .dropdown,
    .main-nav__item:focus-within .dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Servicios Showcase: activar grid de dos columnas */
    .ss__layout {
        grid-template-columns: 320px 1fr;
    }

    .ss__nav {
        flex-direction: column;
        overflow-x: visible;
        padding: var(--space-sm);
    }

    .ss__nav-item {
        font-size: var(--text-base);
        padding: var(--space-md) var(--space-lg);
    }

    .ss__nav-indicator {
        display: block;
    }

    .ss__nav-item--active {
        border-bottom: none;
        border-radius: var(--radius-md);
    }

    .ss__panel-image-wrap {
        height: 280px;
    }

    .ss__sub-list {
        grid-template-columns: 1fr 1fr;
    }
}

/* --------------------------------------------------------------------------
   Large Desktop — >= 1200px
   -------------------------------------------------------------------------- */
@media (min-width: 1200px) {
    .container {
        padding-left: var(--space-xl);
        padding-right: var(--space-xl);
    }
}

/* --------------------------------------------------------------------------
   Reducción de movimiento
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}