:root {
    --brand-red: #eb0029;
    --brand-red-dark: #c80023;
    --text-white: #ffffff;
    --text-white-hover: #e5e7eb;
    --bg-gray: #f3f4f6;
    --footer-bg: #5f6a72;
    /* Color gris-azulado del footer según imagen */
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-gray);
    /* Prevenir scroll cuando el menú está abierto */
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

* {
    box-sizing: border-box;
}

/* =========================================
           CONTENEDOR PRINCIPAL
           ========================================= */
.header-container {
    width: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 50;
}

.header {
    background-color: var(--brand-red);
    color: var(--text-white);
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* =========================================
           LOGO
           ========================================= */
.header__logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header__logo a {
    display: block;
    text-decoration: none;
}

.header__logo img {
    height: 32px;
    object-fit: contain;
}

/* =========================================
           MENÚ UNIFICADO (ESCRITORIO)
           ========================================= */
.header__nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 15px;
}

.header__mobile-header {
    display: none;
    /* Oculto en escritorio */
}

.header__link {
    color: var(--text-white) !important;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.header__link:hover {
    color: var(--text-white-hover) !important;
}

.header__divider {
    width: 1px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.4);
}

.header__points {
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
}

.header__btn-wrapper {
    margin: 0;
    padding: 0;
    border: none;
}

.header__btn {
    display: inline-block;
    background-color: var(--text-white) !important;
    color: var(--brand-red) !important;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.header__btn:hover {
    background-color: var(--text-white-hover);
}

.header__icon {
    width: 24px;
    height: 24px;
}

.header__icon-large {
    width: 28px;
    height: 28px;
}

.header__logout-link {
    margin-left: 0.5rem;
}

.header__mobile-text {
    display: none;
    /* Oculto en escritorio, solo se ve el icono */
}

/* =========================================
           MENÚ MÓVIL Y SLIDER
           ========================================= */
.header__mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-white);
    cursor: pointer;
    padding: 0;
}

/* Fondo oscuro (Overlay) */
.header__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.header__overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* =========================================
           MEDIA QUERIES (RESPONSIVE)
           ========================================= */
@media (max-width: 1024px) {
    .header {
        padding: 1rem;
    }

    .header__logo img {
        height: 24px;
    }

    .header__mobile-toggle {
        display: block;
    }

    /* Transformar el menú unificado en Slider Lateral */
    .header__nav {
        position: fixed;
        top: 0;
        right: 0;
        transform: translateX(100%);
        width: 300px;
        max-width: 85%;
        height: 100%;
        background-color: var(--brand-red);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        z-index: 999;
        transition: transform 0.3s ease-in-out;
        box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
        overflow-y: auto;
    }

    .header__nav.is-open {
        transform: translateX(0);
    }

    .header__mobile-header {
        display: flex;
        width: 100%;
        justify-content: flex-end;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--brand-red-dark);
    }

    .header__mobile-close {
        background: none;
        border: none;
        color: var(--text-white);
        cursor: pointer;
        padding: 0.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header__link {
        width: 100%;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--brand-red-dark);
    }

    .header__link:hover {
        background-color: var(--brand-red-dark);
        color: var(--text-white);
        /* Evitar color gris hover en móvil */
    }

    .header__divider {
        display: none;
        /* No se necesita en móvil */
    }

    .header__points {
        width: 100%;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--brand-red-dark);
    }

    .header__btn-wrapper {
        width: 100%;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--brand-red-dark);
    }

    .header__btn {
        display: block;
        width: 100%;
        padding: 0.75rem 1.5rem;
    }

    .header__logout-link {
        margin-left: 0;
        /* Reiniciar margen lateral en móvil */
    }

    .header__mobile-text {
        display: inline;
        /* Mostrar el texto "Salir" en móvil */
    }
}