/* ===============================
   VARIABLES CSS
   =============================== */
:root {
    --index-color: #4CAF50;
    --hover-color: #45a049;
    --primary-color: #ffffff;
    --secondary-color: #333;
    --border-radius: 15px;
    --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --transition: 0.3s ease;
}

/* ===============================
   UTILITY CLASSES
   =============================== */
.search-results {
    display: none;
}

/* ===============================
   HEADER & MENU PRINCIPAL
   =============================== */
.menu {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    margin-left:  10%;
    margin-right: 10%
}

.menu-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    height: clamp(60px, 10vw, 80px);
}

/* ===============================
   LOGO
   =============================== */
.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    flex: 0 0 auto;
}

.logo img {
    height: clamp(30px, 5vw, 40px);
}

/* ===============================
   COMPONENTE DE BÚSQUEDA
   =============================== */

.search-container {
    display: flex;
    align-items: center;
    position: relative;
    width: clamp(70%, 60%, 60%);
    max-width: 600px;
    flex-grow: 1;
    justify-content: center;
    margin: 0 auto;
}

.search-container input[type="text"] {
    padding: clamp(8px, 1.5vw, 10px) clamp(35px, 5vw, 40px);
    font-size: clamp(14px, 2vw, 16px);
    border-radius: 25px;
    border: 1px solid #ccc;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
}

.search-container input[type="text"]:focus {
    border-color: var(--index-color);
}

.search-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #000;
    transition: color 0.3s ease;
    position: absolute;
    left: clamp(8px, 1.5vw, 10px);
    top: 50%;
    transform: translateY(-50%);
}

.search-button:hover {
    color: var(--index-color);
}

.search-button i {
    font-size: clamp(16px, 2.5vw, 20px);
}

/* ===============================
   RESULTADOS DE BÚSQUEDA
   =============================== */
#search-results {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.95);
    max-height: 360px;
    overflow-y: auto;
    z-index: 1001;
    border: 1px solid #ccc;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin-top: 10px;
    backdrop-filter: blur(5px);
    contain: layout style;
}

#search-results ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#search-results li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(6px, 1.5vw, 8px) clamp(8px, 2vw, 12px);
    border-bottom: 1px solid #ddd;
    cursor: pointer;
}

#search-results li:hover {
    background-color: #f2f2f2;
}

/* ===============================
   BARRA DE NAVEGACIÓN
   =============================== */
.menu-navbar {
    display: flex;
    align-items: center;
    padding: clamp(2px, 1.5vw, 10px);
    border-top: 1px solid #f0f0f0;
}

.navbar {
    display: flex;
    gap: clamp(4px, 1.5vw, 10px);
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
    width: 100%;
    flex-wrap: wrap;
}

.navbar a {
    color: #333;                 
    text-decoration: none;
    font-weight: 400;             
    font-size: clamp(11px, 2vw, 16px);              
    padding: clamp(4px, 1vw, 8px) clamp(4px, 1.5vw, 12px);
    letter-spacing: 0.3px;     
    font-family: system-ui;
    transition: color var(--transition);
    white-space: nowrap;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.navbar a:hover {
    color: #4CAF50;              
}

.navbar a.active {
    color: #4CAF50;              
    font-weight: 600;             
}

/* ===============================
   MEDIA QUERY ÚNICO < 800px
   =============================== */
@media screen and (max-width: 800px) {    
    
    .search-container {
        width: clamp(85%, 90%, 95%);
    }

    .navbar {
        justify-content: space-around;
        gap: clamp(2px, 1vw, 6px);
    }    
        
    .navbar a {
        font-size: clamp(10px, 2vw, 13px);
        letter-spacing: 0.1px;
        padding: clamp(3px, 1vw, 6px) clamp(3px, 1vw, 6px);
    }

    .menu,
    .footer,
    .contenido {
        margin-left:  5%;
        margin-right: 5%
    }

    .search-button:hover {
        color: var(--index-color);
    }

    .search-button:active {
        transform: translateY(-50%) scale(0.95);
        transition: transform 0.1s ease;
    }

    .consultar-button:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

}