/**
 * Comfort Cabo - Menu Styles
 * menu-styles.css
 * Navigation menu styles with golden theme
 */

/* ==================== NAVBAR BASE ==================== */
.navbar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.container-navbar {
    position: relative;
}

/* ==================== MENU TOGGLE (HAMBURGER) ==================== */
.navbar #menu-toggle {
    display: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: #333;
    transition: color 0.3s ease;
    /* 44x44 px es el área mínima de toque que recomiendan Apple y Google.
       El ícono solo mide ~26 px, por eso muchos toques no acertaban. */
    min-width: 44px;
    min-height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    margin: -8px;
    padding: 8px;
    border-radius: 8px;
    -webkit-tap-highlight-color: rgba(23, 162, 184, .18);
    user-select: none;
}

.navbar #menu-toggle:active {
    background: rgba(23, 162, 184, .12);
}

.navbar #menu-toggle:hover {
    color: #17A2B8;
}

.navbar #menu-toggle.active {
    color: #17A2B8;
}

/* ==================== DESKTOP MENU ==================== */
.navbar .menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.navbar .menu li {
    margin: 0;
}

.navbar .menu li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    text-transform: capitalize;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    display: block;
    position: relative;
    border-radius: 5px;
}

/* Hover state - Golden */
.navbar .menu li a:hover {
    color: #17A2B8;
}

/* Active/Selected state - Golden */
.navbar .menu li a.active,
.navbar .menu li a:focus,
.navbar .menu li a.selected {
    color: #17A2B8;
    background-color: rgba(212, 175, 55, 0.1);
}

/* Underline effect on hover */
.navbar .menu li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #17A2B8;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar .menu li a:hover::after,
.navbar .menu li a.active::after {
    width: 80%;
}

/* ==================== MENÚ MÓVIL ====================
   El panel va con position: fixed contra la pantalla, no absolute dentro
   de la barra. Así ningún contenedor con overflow, transform o stacking
   context puede recortarlo — que es lo que lo hacía invisible aunque el
   JavaScript funcionara. Se desliza desde la derecha con un velo detrás.
   ==================================================================== */
@media (max-width: 768px) {
    .navbar #menu-toggle {
        display: flex;
        position: relative;
        z-index: 10002;
    }

    .navbar .menu {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(78vw, 320px);
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        margin: 0;
        padding: 84px 0 24px;
        background: #fff;
        flex-direction: column;
        gap: 0;
        box-shadow: -8px 0 30px rgba(10, 37, 64, .22);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(100%);
        transition: transform .28s cubic-bezier(.4, 0, .2, 1);
        z-index: 10001;
        max-height: none;
        opacity: 1;
        visibility: visible;
    }

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

    /* Velo oscuro detrás del panel; lo inserta menu-script.js */
    .cc-menu-velo {
        position: fixed;
        inset: 0;
        background: rgba(10, 37, 64, .45);
        opacity: 0;
        visibility: hidden;
        transition: opacity .28s ease, visibility 0s linear .28s;
        z-index: 10000;
        border: 0;
        padding: 0;
        cursor: pointer;
    }

    .cc-menu-velo.active {
        opacity: 1;
        visibility: visible;
        transition: opacity .28s ease, visibility 0s;
    }

    /* Mientras el menú está abierto, la página de atrás no se desplaza */
    body.cc-menu-abierto {
        overflow: hidden;
    }

    .navbar .menu li {
        border-bottom: 1px solid #EEF1F4;
        width: 100%;
    }

    .navbar .menu li:last-child {
        border-bottom: none;
    }

    .navbar .menu li a {
        padding: 18px 26px;
        font-size: 1.02rem;
        display: block;
    }

    .navbar .menu li a:hover,
    .navbar .menu li a.active {
        background-color: rgba(23, 162, 184, .08);
        color: #17A2B8;
    }

    .navbar .menu li a::after {
        display: none;
    }

    .navbar .menu .cc-lang-item {
        display: flex;
        justify-content: center;
        padding: 20px 0 8px;
        border-bottom: none;
    }
}

/* ==================== LINK FOCUS STYLES (ACCESSIBILITY) ==================== */
.navbar .menu li a:focus {
    outline: 2px solid #17A2B8;
    outline-offset: 2px;
}

/* Remove default blue highlight on click/tap */
.navbar .menu li a {
    -webkit-tap-highlight-color: rgba(212, 175, 55, 0.3);
}

/* Selection color */
::selection {
    background-color: rgba(212, 175, 55, 0.3);
    color: #0a2540;
}

::-moz-selection {
    background-color: rgba(212, 175, 55, 0.3);
    color: #0a2540;
}