:root {
    --cabecera-borde: #e5eaf0;
    --cabecera-sombra: 0 14px 34px rgba(15, 23, 42, .10);
}

.cabecera-sitio {
    z-index: 1200;
    width: 100%;
    color: var(--cabecera-texto);
    background: color-mix(in srgb, var(--cabecera-fondo) 96%, transparent);
    border-bottom: 1px solid var(--cabecera-borde);
    backdrop-filter: blur(14px);
}

.cabecera-sitio.cabecera-fija {
    position: sticky;
    top: 0;
}


/* =========================================================
   CONTENEDOR
========================================================= */

.cabecera-contenedor {
    width: min(1360px, calc(100% - 32px));
    min-height: var(--cabecera-altura);
    margin: 0 auto;

    display: grid;
    grid-template-columns:
        minmax(150px, var(--cabecera-logo-ancho))
        minmax(0, 1fr)
        auto;

    align-items: center;
    gap: 18px;
}

.cabecera-logo-zona,
.cabecera-menu-zona,
.cabecera-cuenta-zona {
    min-width: 0;
}


/* =========================================================
   LOGO
========================================================= */

.cabecera-logo-enlace {
    width: min(100%, var(--cabecera-logo-ancho));
    min-height: var(--cabecera-logo-alto);

    display: inline-flex;
    align-items: center;

    text-decoration: none;
}

.cabecera-logo {
    display: block;

    width: auto;
    max-width: var(--cabecera-logo-ancho);
    height: var(--cabecera-logo-alto);

    object-fit: contain;
    object-position: left center;
}

.cabecera-logo-texto {
    color: var(--cabecera-texto);

    font-size: clamp(19px, 2vw, 25px);
    font-weight: 900;
    letter-spacing: -.045em;

    white-space: nowrap;
}


/* =========================================================
   BOTÓN MÓVIL
========================================================= */

.cabecera-boton-movil {
    display: none;

    width: 42px;
    height: 42px;

    padding: 9px;

    border: 1px solid #dbe5e1;
    border-radius: 10px;

    background: #ffffff;

    cursor: pointer;

    transition:
        background .18s ease,
        border-color .18s ease,
        transform .18s ease;
}

.cabecera-boton-movil:hover {
    background: #f5f8f7;
    border-color: #cbd8d3;
}

.cabecera-boton-movil span {
    display: block;

    width: 21px;
    height: 2px;

    margin: 4px auto;

    border-radius: 99px;

    background: var(--cabecera-texto);

    transform-origin: center;

    transition:
        transform .2s ease,
        opacity .2s ease,
        background .2s ease;
}


/* =========================================================
   MI CUENTA
========================================================= */

.cabecera-cuenta-zona {
    position: relative;

    padding-left: 16px;

    border-left: 1px solid var(--cabecera-borde);
}

.boton-mi-cuenta {
    min-height: 42px;

    padding: 9px 16px;

    border: 0;
    border-radius: 10px;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: var(--cuenta-texto);
    background: var(--cuenta-fondo);

    box-shadow:
        0 9px 22px
        color-mix(in srgb, var(--cuenta-fondo) 24%, transparent);

    font-size: 14px;
    font-weight: 850;

    white-space: nowrap;

    cursor: pointer;

    transition:
        transform .18s ease,
        background .18s ease,
        box-shadow .18s ease;
}

.boton-mi-cuenta:hover,
.cabecera-cuenta-zona.abierto .boton-mi-cuenta {
    background: var(--cuenta-hover);
    transform: translateY(-1px);
}

.cuenta-boton-icono,
.cuenta-boton-logo {
    width: 20px;
    height: 20px;

    flex: 0 0 20px;

    object-fit: contain;
}

.cuenta-flecha {
    width: 15px;
    height: 15px;

    transition: transform .18s ease;
}

.cabecera-cuenta-zona.abierto .cuenta-flecha {
    transform: rotate(180deg);
}


/* =========================================================
   PANEL MI CUENTA
========================================================= */

.cuenta-panel {
    position: absolute;

    top: calc(100% + 12px);
    right: 0;

    z-index: 1500;

    width: 270px;

    padding: 10px;

    border: 1px solid var(--cabecera-borde);
    border-radius: 14px;

    background: #ffffff;

    box-shadow: var(--cabecera-sombra);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transform: translateY(8px);

    transition:
        opacity .18s ease,
        visibility .18s ease,
        transform .18s ease;
}

.cabecera-cuenta-zona.abierto .cuenta-panel {
    opacity: 1;
    visibility: visible;

    pointer-events: auto;

    transform: translateY(0);
}

.cuenta-panel > a,
.cuenta-cerrar {
    width: 100%;
    min-height: 44px;

    padding: 10px 12px;

    border: 0;
    border-radius: 9px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    color: #172033;
    background: transparent;

    font-size: 13px;
    font-weight: 750;

    text-decoration: none;

    cursor: pointer;
}

.cuenta-panel > a:hover,
.cuenta-cerrar:hover {
    background: #f1f5f9;
}

.cuenta-recuperar {
    color: #64748b !important;
    font-size: 12px !important;
}

.cuenta-usuario,
.cuenta-panel-introduccion {
    margin-bottom: 7px;

    padding: 11px 10px 14px;

    border-bottom: 1px solid #e9eef4;

    display: flex;
    align-items: center;
    gap: 10px;
}

.cuenta-panel-introduccion {
    align-items: flex-start;
    flex-direction: column;

    gap: 3px;
}

.cuenta-avatar {
    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    border-radius: 50%;

    display: grid;
    place-items: center;

    color: #166534;
    background: #dcfce7;

    font-weight: 900;
}

.cuenta-usuario strong,
.cuenta-panel-introduccion strong {
    display: block;

    color: #0f172a;

    font-size: 13px;
}

.cuenta-usuario small,
.cuenta-panel-introduccion small {
    display: block;

    color: #64748b;

    font-size: 11px;
}

.cuenta-cerrar-formulario {
    margin: 0;
}

.cuenta-cerrar {
    color: #b91c1c;
}


/* =========================================================
   TABLET / MÓVIL
========================================================= */

@media (max-width: 980px) {

    .cabecera-sitio {
        background: #ffffff;
        backdrop-filter: none;
    }

    .cabecera-contenedor {
        position: relative;

        width: 100%;
        min-height: var(--cabecera-altura);

        padding: 0 14px;

        grid-template-columns:
            minmax(0, 1fr)
            auto
            auto;

        gap: 8px;
    }


    /* LOGO */

    .cabecera-logo-zona {
        grid-column: 1;
        grid-row: 1;

        min-width: 0;
    }

    .cabecera-logo-enlace {
        max-width: 165px;
    }

    .cabecera-logo {
        max-width: 165px;
        height: min(var(--cabecera-logo-alto), 38px);
    }


    /* MI CUENTA */

    .cabecera-cuenta-zona {
        grid-column: 2;
        grid-row: 1;

        padding-left: 0;

        border-left: 0;
    }

    .boton-mi-cuenta {
        width: 42px;
        height: 42px;
        min-height: 42px;

        padding: 0;

        justify-content: center;

        border-radius: 10px;
    }

    .boton-mi-cuenta .cuenta-texto,
    .boton-mi-cuenta .cuenta-flecha {
        display: none;
    }

    .cuenta-boton-icono,
    .cuenta-boton-logo {
        width: 19px;
        height: 19px;

        flex-basis: 19px;
    }

    .cuenta-panel {
        position: fixed;

        top: calc(var(--cabecera-altura) + 8px);
        right: 12px;

        width: min(300px, calc(100vw - 24px));

        max-height: calc(100dvh - var(--cabecera-altura) - 20px);

        overflow-y: auto;
    }


    /* HAMBURGUESA */

    .cabecera-menu-zona {
        grid-column: 3;
        grid-row: 1;

        position: static;

        width: auto;

        display: flex;
        align-items: center;
        justify-content: flex-end;

        overflow: visible;
    }

    .cabecera-boton-movil {
        display: flex;

        flex-direction: column;
        align-items: center;
        justify-content: center;

        flex: 0 0 42px;
    }


    /* HAMBURGUESA -> X */

    .cabecera-sitio.menu-movil-abierto
    .cabecera-boton-movil span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .cabecera-sitio.menu-movil-abierto
    .cabecera-boton-movil span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .cabecera-sitio.menu-movil-abierto
    .cabecera-boton-movil span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .cabecera-sitio.menu-movil-abierto
    .cabecera-boton-movil {
        background: #f5f8f7;
        border-color: #bccdc6;
    }
}


/* =========================================================
   TELÉFONOS
========================================================= */

@media (max-width: 560px) {

    .cabecera-contenedor {
        padding-right: 10px;
        padding-left: 10px;

        gap: 7px;
    }

    .cabecera-logo-enlace,
    .cabecera-logo {
        max-width: 145px;
    }

    .cabecera-logo {
        height: min(var(--cabecera-logo-alto), 34px);
    }

    .boton-mi-cuenta,
    .cabecera-boton-movil {
        width: 40px;
        height: 40px;
        min-height: 40px;

        flex-basis: 40px;
    }

    .cuenta-panel {
        right: 8px;

        width: calc(100vw - 16px);
    }
}


/* =========================================================
   TELÉFONOS MUY PEQUEÑOS
========================================================= */

@media (max-width: 360px) {

    .cabecera-contenedor {
        padding-right: 7px;
        padding-left: 7px;

        gap: 5px;
    }

    .cabecera-logo-enlace,
    .cabecera-logo {
        max-width: 125px;
    }

    .boton-mi-cuenta,
    .cabecera-boton-movil {
        width: 38px;
        height: 38px;
        min-height: 38px;

        flex-basis: 38px;
    }
}