/* ==================================================
   header.css
   Función: controlar el header público y el menú móvil.
   Toca este archivo cuando cambie navegación, CTA o header responsive.
   ================================================== */

.main-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-shell {
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
}

.logo {
    position: relative;
    z-index: calc(var(--z-menu) + 2);
    flex-shrink: 0;
}

.logo img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid transparent;
    background-image: var(--gradient-brand);
    background-origin: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(211, 84, 0, 0.5), 0 0 20px rgba(0, 137, 167, 0.45);
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    flex: 1;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(16px, 2vw, 28px);
    padding: 0;
    margin: 0;
    flex: 1;
}

.nav-menu a {
    text-decoration: none;
    color: var(--color-text-soft);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.92rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: color 0.25s ease, opacity 0.25s ease;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
    color: var(--color-primary);
}

.nav-highlight {
    color: var(--color-accent) !important;
    font-weight: 700 !important;
}

.header-cta {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    flex-shrink: 0;
}

.btn-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text);
    background: var(--gradient-brand);
    box-shadow: 0 8px 20px rgba(211, 84, 0, 0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.btn-contact:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 12px 24px rgba(0, 137, 167, 0.28);
}

.cart-icon,
.user-icon {
    position: relative;
    font-size: 1.2rem;
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.25s ease, transform 0.25s ease;
}

.cart-icon:hover,
.user-icon:hover {
    color: var(--color-accent);
    transform: translateY(-1px);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    padding-inline: 4px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e74c3c;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
}

.menu-toggle,
.menu-overlay {
    display: none;
}

.menu-toggle {
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: calc(var(--z-menu) + 2);
}

.menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 999px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.desktop-only {
    display: initial !important;
}

.mobile-only {
    display: none !important;
}

body.menu-open {
    overflow: hidden;
}

@media (max-width: 992px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only,
    .menu-toggle,
    .menu-overlay {
        display: flex !important;
    }

    .menu-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        z-index: var(--z-overlay);
        border: 0;
    }

    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .nav-menu {
        position: fixed;
        inset: 0 0 0 auto;
        width: min(86vw, 320px);
        height: 100dvh;
        background: rgba(0, 0, 0, 0.97);
        border-left: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.45);
        padding: calc(var(--header-height) + 24px) 24px 28px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 28px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: var(--z-menu);
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-menu ul {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
    }

    .nav-menu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .nav-menu li a {
        display: block;
        padding: 14px 0;
    }

    .header-cta {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-top: auto;
    }

    .btn-contact {
        width: 100%;
    }

    .cart-icon,
    .user-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-pill);
        padding: 10px 16px;
    }
}

@media (max-width: 576px) {
    .header-shell {
        gap: 12px;
    }

    .logo img {
        width: 58px;
        height: 58px;
    }
}
