/*
========================================
  RESPONSIVE MEDIA QUERIES
========================================
*/

/* ==================== */
/* DESKTOP DEFAULT      */
/* ==================== */
/* Ocultar información móvil en desktop por defecto */
.nav__mobile-info {
    display: none !important;
}

.mobile-info__item,
.mobile-info__content,
.mobile-info__label,
.mobile-info__value,
.mobile-info__whatsapp {
    display: none !important;
}

/* ==================== */
/* LARGE SCREENS        */
/* ==================== */
@media (max-width: 960px) {

    .team,
    .contact,
    .testimonials {
        grid-template-columns: 1fr;
    }

    .cards {
        grid-template-columns: 1fr 1fr;
    }

    .member {
        grid-template-columns: 1fr;
    }

    .footer__grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ==================== */
/* TABLET BREAKPOINT    */
/* ==================== */
@media (max-width: 768px) {

    /* Header adjustments */
    .header__topbar {
        max-height: 40px;
        /* Fixed height for mobile */
        opacity: 1;
        transition: all 0.3s ease;
    }

    /* Hide topbar when scrolling down on mobile */
    .site-header.topbar-hidden .header__topbar {
        max-height: 0;
        opacity: 0;
        transform: translateY(-100%);
    }

    .topbar__description {
        display: none;
    }

    .topbar__contact {
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .contact-item {
        font-size: 11px;
        padding: 6px 12px;
    }

    .contact-item span {
        display: none;
    }

    /* Solo mostrar iconos en móvil */
    .contact-item svg {
        margin: 0;
    }

    .header__content {
        padding: 12px 0;
        gap: 16px;
    }

    .header__logo {
        max-width: calc(100% - 60px);
    }

    .logo__image {
        height: 52px;
        width: auto;
        max-width: 100%;
        object-fit: contain;
        transition: height 0.3s ease;
    }

    /* Hamburguesa - Diseño minimalista con animación a X */
    .header__toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        position: relative;
        z-index: 1002;
        background: transparent;
        border: none;
        padding: 10px;
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        transition: opacity 0.3s ease;
    }

    .header__toggle:hover {
        opacity: 0.7;
    }

    .header__toggle:active {
        opacity: 0.5;
    }

    .toggle__bar {
        width: 24px;
        height: 2px;
        background: #374151;
        border-radius: 2px;
        transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        position: absolute;
        left: 10px;
    }

    .toggle__bar:nth-child(1) {
        top: 14px;
    }

    .toggle__bar:nth-child(2) {
        top: 21px;
    }

    .toggle__bar:nth-child(3) {
        top: 28px;
    }

    /* Animación a X cuando está activo */
    .header__toggle.is-active .toggle__bar:nth-child(1) {
        top: 21px;
        transform: rotate(45deg);
        background: #6b7280;
    }

    .header__toggle.is-active .toggle__bar:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .header__toggle.is-active .toggle__bar:nth-child(3) {
        top: 21px;
        transform: rotate(-45deg);
        background: #6b7280;
    }

    /* Menú móvil - Animación desde la derecha */
    .header__nav {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: min(320px, 85vw) !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        background: #ffffff;
        border-left: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0);
        transform: translateX(100%) !important;
        opacity: 0;
        visibility: hidden;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.4s ease,
            visibility 0s linear 0.4s,
            box-shadow 0.4s ease;
        z-index: 1001;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        display: block !important;
        padding: 60px 0 20px !important;
    }

    .header__nav.is-open {
        transform: translateX(0) !important;
        opacity: 1;
        visibility: visible;
        box-shadow: -6px 0 32px rgba(0, 0, 0, 0.12);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.4s ease,
            visibility 0s linear 0s,
            box-shadow 0.4s ease;
    }

    /* Animación de entrada desde la derecha */
    @keyframes menuSlideIn {
        0% {
            transform: translateX(100%);
            opacity: 0;
        }

        100% {
            transform: translateX(0);
            opacity: 1;
        }
    }

    /* Header del menú móvil - Fijo en la parte superior */
    .header__nav::before {
        content: '';
        position: fixed;
        top: 0;
        right: 0;
        width: min(320px, 85vw);
        height: 60px;
        background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        z-index: 10;
        opacity: 0;
        transform: translateX(100%);
        transition: opacity 0.4s ease 0.15s, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .header__nav.is-open::before {
        opacity: 1;
        transform: translateX(0);
    }

    /* Lista de navegación */
    .nav__list {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        padding: 0 20px 20px !important;
        margin: 0 !important;
        list-style: none !important;
    }

    /* Items del menú con animación desde la derecha */
    .nav__item {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        background: transparent;
        overflow: hidden;
        transition: background 0.25s ease;
        opacity: 0;
        transform: translateX(20px);
    }

    .nav__item:hover {
        background: rgba(0, 0, 0, 0.02);
    }

    .nav__item:last-child {
        border-bottom: none;
    }

    /* Animación escalonada desde la derecha */
    .header__nav.is-open .nav__item {
        animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    .header__nav.is-open .nav__item:nth-child(1) {
        animation-delay: 0.20s;
    }

    .header__nav.is-open .nav__item:nth-child(2) {
        animation-delay: 0.25s;
    }

    .header__nav.is-open .nav__item:nth-child(3) {
        animation-delay: 0.30s;
    }

    .header__nav.is-open .nav__item:nth-child(4) {
        animation-delay: 0.35s;
    }

    .header__nav.is-open .nav__item:nth-child(5) {
        animation-delay: 0.40s;
    }

    .header__nav.is-open .nav__item:nth-child(6) {
        animation-delay: 0.45s;
    }

    .header__nav.is-open .nav__item:nth-child(7) {
        animation-delay: 0.50s;
    }

    @keyframes slideInFromRight {
        0% {
            opacity: 0;
            transform: translateX(20px);
        }

        100% {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* Enlaces del menú - Estilo minimalista */
    .nav__link {
        display: flex !important;
        padding: 16px 20px !important;
        font-size: 15px !important;
        font-weight: 400 !important;
        justify-content: space-between;
        width: 100%;
        color: #374151;
        transition: all 0.25s ease;
        letter-spacing: 0.01em;
    }

    .nav__link:hover {
        color: #1f2937;
        padding-left: 24px !important;
    }

    .nav__link::before {
        display: none !important;
    }

    .nav__link::after {
        content: '→';
        font-size: 16px;
        font-weight: 300;
        color: #9ca3af;
        opacity: 0;
        transform: translateX(-5px);
        transition: all 0.25s ease;
    }

    .nav__link:hover::after,
    .nav__link.active::after {
        opacity: 1;
        transform: translateX(0);
        color: #374151;
    }

    .nav__link.active {
        color: #1f2937;
        font-weight: 500 !important;
        background: rgba(0, 0, 0, 0.03);
        border-left: 2px solid #374151;
    }

    /* CTA Button - Diseño minimalista */
    .nav__item--cta {
        margin-left: 0 !important;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        border-bottom: none !important;
        background: transparent;
        box-shadow: none;
    }

    .nav__item--cta:hover {
        background: transparent;
    }

    .nav__cta {
        width: 100% !important;
        justify-content: center !important;
        padding: 13px 24px !important;
        font-size: 15px !important;
        font-weight: 500 !important;
        background: #1f2937;
        color: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
        border-radius: 6px;
        transition: all 0.25s ease;
    }

    .nav__cta:hover {
        background: #111827;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.16);
    }

    .nav__cta::after {
        display: none !important;
    }

    /* Scrollbar personalizado */
    .header__nav {
        -webkit-overflow-scrolling: touch;
    }

    .header__nav::-webkit-scrollbar {
        width: 4px;
    }

    .header__nav::-webkit-scrollbar-track {
        background: transparent;
    }

    .header__nav::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }

    /* Información adicional del menú móvil */
    .nav__mobile-info {
        display: block !important;
        padding: 20px;
        margin-top: 20px;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        opacity: 0;
        transform: translateX(20px);
        transition: opacity 0.4s ease 0.55s, transform 0.4s ease 0.55s;
    }

    .header__nav.is-open .nav__mobile-info {
        opacity: 1;
        transform: translateX(0);
    }

    .mobile-info__item {
        display: flex !important;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 0;
        margin-bottom: 8px;
        background: transparent;
        border-radius: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        transition: all 0.25s ease;
    }

    .mobile-info__item:hover {
        padding-left: 4px;
    }

    .mobile-info__item:last-of-type {
        border-bottom: none;
    }

    .mobile-info__item svg {
        color: #6b7280;
        flex-shrink: 0;
        margin-top: 2px;
        width: 18px;
        height: 18px;
    }

    .mobile-info__content {
        display: flex !important;
        flex-direction: column;
        gap: 3px;
    }

    .mobile-info__label {
        display: block !important;
        font-size: 11px;
        font-weight: 500;
        color: #9ca3af;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .mobile-info__value {
        display: block !important;
        font-size: 14px;
        font-weight: 400;
        color: #374151;
        text-decoration: none;
        transition: color 0.25s ease;
    }

    .mobile-info__value:hover {
        color: #1f2937;
    }

    .mobile-info__whatsapp {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 20px;
        background: #25D366;
        color: white;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        border-radius: 6px;
        margin-top: 12px;
        box-shadow: 0 1px 3px rgba(37, 211, 102, 0.3);
        transition: all 0.25s ease;
    }

    .mobile-info__whatsapp:hover {
        background: #128C7E;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
    }

    .mobile-info__whatsapp:active {
        transform: translateY(0);
    }

    .mobile-info__whatsapp svg {
        width: 18px;
        height: 18px;
    }
}

/* Ajustes para pantallas móviles con poca altura */
@media (max-width: 768px) and (max-height: 600px) {
    .header__nav {
        padding: 50px 0 16px !important;
    }

    .header__nav::before {
        height: 50px;
    }

    .nav__list {
        padding: 0 16px 16px !important;
    }

    .nav__link {
        padding: 12px 14px !important;
        font-size: 14px !important;
        min-height: 44px;
    }

    .nav__item--cta {
        margin-top: 12px !important;
        padding-top: 12px !important;
    }

    .nav__cta {
        padding: 10px 20px !important;
        font-size: 14px !important;
    }

    .nav__mobile-info {
        padding: 12px 16px 20px !important;
        margin-top: 10px !important;
    }

    .mobile-info__item {
        padding: 8px 0 !important;
        margin-bottom: 4px !important;
    }

    .mobile-info__whatsapp {
        padding: 9px 16px !important;
        font-size: 13px !important;
        margin-top: 8px !important;
    }
}

/* ==================== */
/* SMALL MOBILE         */
/* ==================== */
@media (max-width: 680px) {

    .cards,
    .gallery,
    .form__row,
    .footer__grid {
        grid-template-columns: 1fr;
    }

    /* Topbar visible on small mobile too */
    .header__topbar {
        max-height: 40px;
    }

    /* Mobile breathing room and elegant spacing */
    .container {
        width: min(92%, 620px);
    }

    .section {
        padding: clamp(64px, 14vw, 96px) 0;
    }

    .section__title {
        font-size: clamp(26px, 6vw, 34px);
        margin-bottom: 14px;
    }

    .muted {
        line-height: 1.7;
    }

    .grid {
        gap: 22px;
    }

    .card {
        padding: 18px;
    }

    .testimonials {
        gap: 16px;
    }

    .member {
        padding: 14px;
        gap: 14px;
    }

    .form {
        padding: 16px;
    }

    .form__row {
        gap: 12px;
    }

    /* Header mobile adjustments - Menú más ancho en pantallas pequeñas */
    .header__nav {
        width: min(340px, 90vw) !important;
    }

    .header__nav::before {
        width: min(340px, 90vw);
    }

    .nav__list {
        padding: 0 16px 20px !important;
    }

    .nav__item {
        margin-bottom: 6px;
    }

    .nav__link {
        padding: 16px 14px !important;
        font-size: 15px !important;
    }

    .logo__image {
        height: 46px;
    }

    .header__content {
        padding: 10px 0;
    }

    .header__toggle {
        padding: 10px;
    }

    .toggle__bar {
        width: 24px;
        height: 2.5px;
    }

    /* Compare and other mobile styles */
    .compare {
        gap: 16px;
    }

    .compare__text {
        padding: 0 2px;
    }

    .compare__text .muted {
        margin-bottom: 14px;
    }

    .ba {
        margin-top: 8px;
        border-radius: 14px;
    }

    /* New ribbon section responsive styles */
    .ribbon-container {
        min-height: 90px;
        max-height: 110px;
    }

    .ribbon-phrase {
        font-size: clamp(1.35rem, 4.5vw, 2rem);
        padding: 0 1.25rem;
    }

    .ribbon-track__content {
        gap: 2.5rem;
    }

    .ribbon-phrase::after {
        right: -1.25rem;
    }
}

/* ==================== */
/* TABLET LANDSCAPE     */
/* ==================== */
@media (max-width: 1024px) and (min-width: 769px) {

    /* Topbar ajustes */
    .topbar__description {
        font-size: 13px;
    }

    .topbar__description svg {
        width: 18px;
        height: 18px;
    }

    .topbar__contact {
        gap: 16px;
    }

    .contact-item {
        font-size: 12px;
        padding: 5px 10px;
    }

    /* Header principal */
    .logo__image {
        height: 54px;
    }

    .nav__link {
        font-size: 14px;
        padding: 10px 14px;
    }

    .nav__cta {
        font-size: 14px;
        padding: 9px 18px;
    }
}

/* ==================== */
/* LARGE DESKTOP        */
/* ==================== */
@media (min-width: 1441px) {

    .header__topbar .container,
    .header__main .container {
        max-width: 1400px;
    }

    .topbar__description {
        font-size: 14px;
    }

    .nav__link {
        font-size: 16px;
        padding: 12px 20px;
    }

    .nav__cta {
        font-size: 16px;
        padding: 11px 24px;
    }

    .logo__image {
        height: 62px;
    }
}