* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
}

/* =================================== */
/* ==== ESTILOS ORIGINALES (BASE) ==== */
/* =================================== */

/* Barra de navegación */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #141A45;
    padding: 10px 40px;
    color: #fff;
    position: sticky; 
    top: 0;
    z-index: 1000; 
}

/* Sección izquierda: logo + búsqueda */
.navbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-left img {
    height: 80px;
    width: 140px;
}

.search-bar {
    display: flex;
    align-items: center;
    margin-left: 90px;
}

.search-bar form {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
}

.search-bar input {
    border: none;
    outline: none;
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
    transition: width 0.3s ease;
    width: 280px; 
}

.search-bar button {
    background: #615EFC;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: #8F9BFF;
}
.search-bar input:focus {
    width: 480px; /* se amplía cuando el usuario escribe */
}

/* Sección derecha: enlaces */
.navbar-right {
    background: #222;
    padding: 10px 20px;
    display: flex;
    justify-content: flex-end;
}

.navbar-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.navbar-links a {
    color: white;
    text-decoration: none;
    transition: 0.3s;
    padding-right: 60px;
    padding-left: 60px;
    text-align: center;
}

.navbar-links a:hover {
    background: #ffffff;
    border-radius: 5px;
    color: #141A45;
}

/* Dropdown base */
.dropdown {
    position: relative;
    text-align: center;
    display: inline-block;
}

.dropdown-user{
    text-align: center;
}

.dropbtn {
    cursor: pointer;
    color: white;
    text-decoration: none;
    padding: 10px;
    transition: 0.3s;
    text-align: center;
}

.dropbtn:hover {
    background: #fffefe;
    border-radius: 5px;
}

/* Contenido del dropdown */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 80px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.3);
    border-radius: 6px;
    z-index: 1950;
    margin-right: 50px;
    margin-top: 10px;
    margin-left: 20px;
}

.dropdown-content a {
    color: #000000;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background: #141A45;
    color: #ffffff;
}

/* Mostrar cuando está activo */
.dropdown:hover .dropdown-content {
    display: block;
}

/* FOOTER */
.footer {
    background-color: #141A45;
    color: #fff;
    padding: 30px 20px;
    text-align: center;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
    color: white;
}

.footer a{
    text-decoration: none;
    color: white;
}

.social-icons {
    display: flex;
    gap: 20px;
}

.social-icons a ion-icon {
    width: 40px;
    color: #fff;
    height: 40px;
    transition: filter 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}


/* ============================================ */
/* ==== 📱 MEDIA QUERIES RESPONSIVAS 📱 ==== */
/* ============================================ */

/* --- Para Tablets (hasta 1024px) --- */
@media (max-width: 1024px) {
    .navbar {
        padding: 10px 20px;
        flex-wrap: wrap; 
    }

    .search-bar {
        margin-left: 20px;
    }

    .search-bar input {
        width: 200px;
    }
    
    .search-bar input:focus {
        width: 250px; /* Expansión más moderada */
    }
    
    .navbar-links a {
        padding: 10px 20px; /* Menos padding en los enlaces */
    }
}


/* --- Para Celulares (hasta 768px) --- */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column; 
        align-items: flex-start; 
        gap: 15px;
        padding: 15px;
    }

    .navbar-left {
        width: 100%;
        justify-content: space-between;
    }
    
    .navbar-left img {
        height: 60px; /* Logo más pequeño */
        width: auto;
    }

    .search-bar {
        margin-left: 0;
        flex-grow: 1; /* Permite que la barra de búsqueda crezca */
    }

    .search-bar form {
        width: 100%;
    }

    .search-bar input {
        width: 100%; /* El input ocupa todo el espacio disponible */
    }

    .search-bar input:focus {
        width: 100%; /* Deshabilita la expansión en móvil */
    }

    .navbar-links {
        flex-direction: column;
        width: 100%; /* Ocupa todo el ancho */
        gap: 10px;
        align-items: center; /* Centra los enlaces */
    }

    .navbar-links a {
        padding: 10px;
        width: 100%;
        text-align: center;
    }
    
    /* Ajustes del menú desplegable en móvil */
    .dropdown {
        width: 100%;
    }

    .dropdown-content {
        position: static; /* Se muestra dentro del flujo normal */
        box-shadow: none;
        margin: 0;
        border-radius: 0;
        background-color: #ffffff; /* Color de fondo para diferenciarlo */
        width: 100%;
    }
    
    .dropbtn {
        width: 100%;
        display: block;
        background-color: #615EFC;
        border-radius: 5px;
    }

    /* Footer en móvil */
    .social-icons a ion-icon {
        width: 35px;
        height: 35px;
    }
}