/* styles.css - VERSIÓN COMPLETA Y CORREGIDA */

/* ===== RESET Y ESTILOS GENERALES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    background-color: #f9f9f9;
    color: #333;
    padding-top: 0;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== HEADER ===== */
.header {
    display: flex;
    align-items: center;
    background-color: #24597f;
    padding: 10px 40px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    height: 80px;
    position: relative;  /* ← Mantener relative o static */
    z-index: 1000;
}

/* Botón hamburguesa */
.menu-toggle {
    display: none !important;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 20px;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle:hover span {
    background-color: #a4e5bb;
}

/* Mostrar hamburguesa solo cuando usuario logueado */
body.usuario-logueado .menu-toggle {
    display: flex !important;
}

/* ===== LOGO ===== */
.header-img {
    max-height: 60px;
    width: auto;
    object-fit: contain;
    margin-right: auto;
}

/* Cuando hay hamburguesa, ajustar logo */
body.usuario-logueado .header-img {
    margin-right: auto;
}

/* ===== INFO USUARIO ===== */
#userInfo {
    color: white;
    font-size: 14px;
    margin-right: 15px;
    display: flex;
    align-items: center;
}

#userInfo span {
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
}

/* ===== NAVEGACIÓN PÚBLICA ===== */
.nav {
    margin-left: auto;
}

.nav-list {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-list li {
    display: inline-block;
}

.nav-list a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.nav-list a:hover {
    background-color: #a4e5bb;
    color: #24597f;
}

.nav-list .active {
    background-color: #a4e5bb;
    color: #24597f;
}

/* Ocultar nav cuando usuario logueado */
body.usuario-logueado .nav {
    display: none !important;
}

/* ===== CONTENIDO PRINCIPAL ===== */
.welcome {
    text-align: center;
    margin: 40px 0;
    padding: 0 20px;
}

.welcome h2 {
    color: #24597f;
    margin-bottom: 20px;
    font-size: 2rem;
}

.welcome p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 600px;
}

/* Ajustar contenido principal para header */
body.usuario-logueado {
}

/* ===== IMÁGENES RESPONSIVAS ===== */
.image-link {
    display: inline-block;
    max-width: 300px;
    text-align: center;
    margin: 20px 0;
}

.responsive-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.responsive-img:hover {
    transform: scale(1.05);
}

.image-link-nosotros {
    max-width: 300px;
    text-align: center;
    display: block;
    margin: 20px auto;
}

.responsive-img-nosotros {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: block;
}

/* ===== FOOTER ===== */
.footer {
    background-color: #24597f;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

.footer a {
    color: #a4e5bb;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ===== BANNER VETERINARIO (centralizado) ===== */
.veterinario-banner {
    display: flex; /* Se controla visibilidad desde JS usando la clase .hidden */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #24597f 0%, #1a4563 100%);
    color: white;
    padding: 10px 20px;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    align-items: center;
    justify-content: center;
}

.veterinario-banner.hidden {
    transform: translateY(110%);
    transition: transform 0.3s ease;
    visibility: hidden;
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
    max-width: 1200px;
}

.btn-login-banner {
    background: #4CAF50;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
}

.close-banner {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Botón flotante para reabrir el banner */
.show-banner-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 9998;
    font-size: 20px;
}

.show-banner-btn.hidden {
    display: none !important;
}

/* ===== FORMULARIOS ===== */
form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

form label {
    font-weight: bold;
    color: #24597f;
}

form input,
form textarea,
form button {
    font-size: 1rem;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Roboto', sans-serif;
}

form input:focus,
form textarea:focus {
    outline: none;
    border-color: #24597f;
    box-shadow: 0 0 5px rgba(36, 89, 127, 0.3);
}

form button {
    background-color: #24597f;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

form button:hover {
    background-color: #a4e5bb;
    color: #24597f;
}

/* ===== VIDEOS ===== */
.video-section {
    margin-top: 40px;
    text-align: center;
    padding: 0 20px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.video-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 700px;
    width: 100%;
    margin: 0 auto 20px;
}

iframe {
    aspect-ratio: 16 / 9;
    width: 100%;
    max-width: 700px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto;
}

iframe:hover {
    transform: scale(1.02);
}

.video-title {
    margin-top: 10px;
    font-size: 1rem;
    color: #24597f;
    text-align: center;
    font-weight: 600;
}

/* ===== LISTAS DE DIETAS ===== */
.diet-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.diet-list li {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.diet-img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ===== POPUPS ===== */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.popup.hidden {
    display: none;
}

.popup-content {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.popup-content button {
    background: #24597f;
    color: white;
    border: none;
    padding: 10px 20px;
    margin-top: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.popup-content button:hover {
    background: #a4e5bb;
    color: #24597f;
}

/* ===== HERO SECTION ===== */
.hero {
    background: url('header.png') no-repeat center center/cover;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.2rem;
}

/* ===== HEADER CUANDO USUARIO ESTÁ LOGUEADO ===== */
body.usuario-logueado .header {
    justify-content: space-between;
    padding: 10px 40px;
}

/* Asegurar que el logo mantenga su posición */
body.usuario-logueado .header-img {
    margin-right: auto;
}

/* Posicionar info usuario y hamburguesa a la derecha */
body.usuario-logueado #userInfo {
    margin-left: auto;
    margin-right: 15px;
}

body.usuario-logueado .menu-toggle {
    margin-left: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header {
        padding: 10px 20px;
        height: 70px;
    }

    .header-img {
        max-height: 50px;
    }

    .nav-list {
        gap: 10px;
    }

    .nav-list a {
        padding: 8px 12px;
        font-size: 14px;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .banner-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    /* Ajustes para header en móviles cuando usuario logueado */
    body.usuario-logueado .header {
        padding: 10px 20px;
    }

    body.usuario-logueado #userInfo span {
        font-size: 11px;
        padding: 4px 8px;
    }

    .menu-toggle {
        width: 25px;
        height: 20px;
        margin-left: 10px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 10px 15px;
    }

    .welcome h2 {
        font-size: 1.5rem;
    }

    .welcome p {
        font-size: 1rem;
    }

    .video-frame {
        max-width: 100%;
    }

    /* Ajustes adicionales para móviles pequeños */
    body.usuario-logueado #userInfo {
        margin-right: 10px;
    }

    body.usuario-logueado #userInfo span {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* ===== SIDEBAR PRINCIPAL ===== */
.sidebar-overlay-principal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay-principal.active {
    display: block;
    opacity: 1;
}

.sidebar-principal {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: linear-gradient(180deg, #24597f 0%, #1a4563 100%);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1002;
    padding-top: 70px;
    overflow-y: auto;
    box-shadow: -5px 0 25px rgba(0,0,0,0.3);
}

.sidebar-principal.active {
    right: 0;
}

.sidebar-header-principal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-title-principal {
    color: white;
    font-size: 1.2em;
    font-weight: 600;
}

.close-sidebar-principal {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-sidebar-principal:hover {
    background: rgba(255,255,255,0.1);
    transform: rotate(90deg);
}

.sidebar-nav-principal {
    padding: 0;
}

.sidebar-nav-principal ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-principal li {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-nav-principal a {
    display: flex;
    align-items: center;
    color: white;
    padding: 16px 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sidebar-nav-principal a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #4CAF50;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar-nav-principal a:hover::before {
    transform: scaleY(1);
}

.sidebar-nav-principal a:hover {
    background: rgba(255,255,255,0.1);
    padding-left: 24px;
}

.sidebar-nav-principal a i {
    margin-right: 12px;
    font-size: 1.2em;
    width: 20px;
    text-align: center;
}

.sidebar-logout-principal {
    margin-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 10px 0;
}

.sidebar-logout-principal a {
    color: #ff6b6b !important;
}

.sidebar-logout-principal a:hover {
    background: rgba(255,107,107,0.1) !important;
}

/* ===== HEADER RESPONSIVO UNIFICADO ===== */

/* Botón hamburguesa base */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    margin-left: 15px;
}

.menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Overlay para menú móvil normal - DEBAJO del sidebar */
.overlay-normal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998; /* Por debajo del sidebar */
}

.overlay-normal.active {
    display: block;
}

/* Overlay del sidebar - ENCIMA del menú normal */
.sidebar-overlay-principal {
    z-index: 1001; /* Por encima del menú normal */
}

/* Estados para usuarios logueados */
body.usuario-logueado .nav {
    display: none !important;
}

/* ===== RESPONSIVE HEADER ===== */
@media (max-width: 768px) {
    /* Header ajustado para móviles */
    .header {
        padding: 10px 15px;
        height: 70px;
    }

    .header-img {
        max-height: 50px;
    }

    /* Menú hamburguesa siempre visible en móviles */
    .menu-toggle {
        display: block !important;
        margin-left: 10px;
    }

    /* Navegación móvil - SOLO para usuarios NO logueados */
    .nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: #2c3e50;
        transition: left 0.3s ease;
        z-index: 999; /* Por encima del overlay normal */
        overflow-y: auto;
        margin-left: 0;
    }

    /* Cuando usuario NO está logueado, mostrar navegación normal */
    body:not(.usuario-logueado) .nav.active {
        left: 0;
    }

    /* Cuando usuario SÍ está logueado, ocultar completamente */
    body.usuario-logueado .nav {
        display: none !important;
    }

    .nav-list {
        flex-direction: column;
        padding: 80px 20px 20px;
        gap: 0;
    }

    .nav-list li {
        width: 100%;
    }

    .nav-list a {
        display: block;
        padding: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
    }

    .nav-list a:hover,
    .nav-list a.active {
        background: rgba(255, 255, 255, 0.1);
    }

    /* Info usuario en móviles */
    #userInfo {
        font-size: 12px;
        margin-right: 10px;
    }

    #userInfo span {
        padding: 4px 8px;
        font-size: 11px;
    }
}