/* =========================================================
   HEADER PÚBLICO (auth-header)
   ========================================================= */
.auth-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background: #ffffff;
    padding: 3px 18px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 320px;
}

.auth-header .nav {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.auth-header .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.auth-header .logo img {
    height: 55px;
    width: auto;
    display: block;
    max-width: 100%;
}

.auth-header .logo a {
    text-decoration: none;
    color: #0f9d58;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-header .logo a span {
    color: #0f9d58;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 16px;
    white-space: nowrap;
}

/* Botón hamburguesa para móvil */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: relative;
    z-index: 1002;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.menu-toggle .menu-icon,
.menu-toggle .close-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    stroke: #333;
    stroke-width: 2;
    transition: opacity 0.2s ease;
}

.menu-toggle .close-icon {
    opacity: 0;
}

.menu-toggle.active .menu-icon {
    opacity: 0;
}

.menu-toggle.active .close-icon {
    opacity: 1;
}

.auth-header .menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 24px;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.auth-header .menu li a {
    text-decoration: none;
    color: #333;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 16px;
    display: block;
    white-space: nowrap;
}

.auth-header .menu-icons {
    display: flex;
    gap: 12px;
    align-items: center;
    white-space: nowrap;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 10px;
    flex-shrink: 0;
}

.auth-header .menu-icons a {
    text-decoration: none;
    color: #333;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.auth-header .menu-icons a i,
.auth-header .menu-icons a img {
    width: 18px;
    height: 18px;
    stroke-width: 1px;
}

.auth-header .menu-icons .header-btn-account {
    padding: 8px 16px;
    border-radius: 8px;
    background: transparent;
    color: #333;
    transition: all 0.2s ease;
    border: none;
    box-sizing: border-box;
    white-space: nowrap;
}

.auth-header .menu-icons .header-btn-account:hover {
    background: #25794F;
    color: #ffffff;
}

.auth-header .menu-icons a.header-btn.header-btn-account.logged-in,
.auth-header .menu-icons .header-btn-account.logged-in {
    background: #25794F !important;
    background-color: #25794F !important;
    color: #ffffff !important;
    border: none !important;
    border-width: 0 !important;
    box-shadow: none !important;
}

.auth-header .menu-icons .header-btn-account.logged-in:hover {
    background: #1f6a3f !important;
}

.auth-header .menu-icons .header-btn-language {
    padding: 4px !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: #333 !important;
    transition: all 0.2s ease !important;
    border: none !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
}

.auth-header .menu-icons .header-btn-language:hover {
    background: #f5f5f5 !important;
}

.auth-header .menu-icons .header-btn-language svg {
    width: 32px !important;
    height: 32px !important;
    display: block !important;
}

/* Language dropdown styles */
.language-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.language-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 80px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
    margin-top: 4px;
}

.language-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 14px;
    text-align: center;
    transition: background-color 0.2s ease;
}

.language-option:hover {
    background-color: #f5f5f5;
}

.language-option:first-child {
    border-radius: 8px 8px 0 0;
}

.language-option:last-child {
    border-radius: 0 0 8px 8px;
}

.language-option:only-child {
    border-radius: 8px;
}

/* Ajuste del contenido principal para compensar el header fijo */
main {
    flex: 1;
    margin-top: 0;
    padding-top: 61px;
    display: flex;
    flex-direction: column;
}

/* =========================================================
   RESPONSIVE HEADER
   ========================================================= */

/* Tablet y móvil grande (hasta 1024px) */
@media (max-width: 1024px) {
    .auth-header {
        padding: 3px 12px;
    }

    .auth-header .menu {
        gap: 16px;
    }

    .auth-header .menu li a {
        font-size: 14px;
    }

    .auth-header .menu-icons {
        gap: 8px;
    }

    .auth-header .menu-icons .header-btn-account {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* Móvil (hasta 768px) */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        order: 1; /* Menú hamburguesa a la izquierda */
    }

    .auth-header .logo {
        order: 2; /* Logo en el centro */
        flex: 1;
        justify-content: center;
        display: flex;
    }

    .auth-header .menu-icons {
        order: 3; /* Iconos a la derecha */
    }

    .auth-header .menu {
        position: fixed;
        top: 61px;
        left: 0;
        right: 0;
        background: #ffffff;
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        gap: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        max-height: calc(100vh - 61px);
        overflow-y: auto;
    }

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

    .auth-header .menu li {
        border-bottom: 1px solid #e0e0e0;
    }

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

    .auth-header .menu li a {
        padding: 16px 0;
        font-size: 16px;
        display: block;
        width: 100%;
    }

    .auth-header .menu-icons {
        gap: 8px;
    }

    .auth-header .menu-icons .header-btn-account {
        padding: 6px 10px;
        font-size: 12px;
    }

    .auth-header .logo img {
        height: 45px;
    }

    main {
        padding-top: 61px;
    }
}

/* Móvil pequeño (hasta 480px) */
@media (max-width: 480px) {
    .auth-header {
        padding: 3px 10px;
    }

    .auth-header .logo img {
        height: 40px;
    }

    .auth-header .menu-icons {
        gap: 6px;
    }

    .auth-header .menu-icons .header-btn-account {
        padding: 6px 8px;
        font-size: 11px;
    }

    .auth-header .menu-icons a i,
    .auth-header .menu-icons a img {
        width: 16px;
        height: 16px;
    }

    .menu-toggle {
        padding: 6px;
        width: 36px;
        height: 36px;
    }

    .menu-toggle .menu-icon,
    .menu-toggle .close-icon {
        width: 20px;
        height: 20px;
    }
}

/* Móvil muy pequeño (hasta 320px) */
@media (max-width: 320px) {
    .auth-header {
        padding: 3px 8px;
    }

    .auth-header .logo img {
        height: 35px;
    }

    .auth-header .menu-icons .header-btn-account {
        padding: 5px 6px;
        font-size: 10px;
    }

    .auth-header .menu {
        padding: 15px;
    }

    .auth-header .menu li a {
        padding: 12px 0;
        font-size: 14px;
    }
}