/* frontend/componentes/barra_navegacion/estilos_barra.css */
/* VERSIÓN: CORRECCIÓN LUPA ANCLADA - SISTEMA DE FUELLE CENTRAL */

/* ===============================
   GLOBAL / NAVBAR
=================================*/
body {
    padding-top: 0; 
}

.main-navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 999;
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    /* Logo pegado a la izquierda (2px), Login con espacio para el dedo (12px) */
    padding: 10px 12px 10px 2px; 
    background-color: transparent;
    transition: background-color .3s ease, box-shadow .3s ease, padding .3s ease;
}

/* --- TRANSPARENCIA EN SCROLL --- */
.main-navbar.navbar-scroll { 
    background-color: color-mix(in srgb, var(--color-primary) 30%, transparent) !important;
    backdrop-filter: blur(12px) saturate(100%);
    -webkit-backdrop-filter: blur(12px) saturate(100%);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1); 
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* ===============================
   AJUSTES MÓVIL (SISTEMA DE FUELLE)
=================================*/
@media (max-width: 575.98px) {
    .main-navbar {
        padding: 5px 12px 5px 2px !important; 
        gap: 10px !important; 
    }

    /* 1. LOGO: Anclaje izquierdo total */
    .navbar-logo { 
        flex: 0 0 auto !important;
        max-width: 130px !important; 
    }
    .navbar-logo img { 
        height: auto; max-height: 38px; 
        object-fit: contain; object-position: left center; 
    }

    /* 2. BOTÓN CATEGORÍAS: Rígido */
    .btn-categoria-container, .menuButton {
        flex: 0 0 auto !important;
        width: 38px !important;
        height: 38px !important;
    }

    /* 3. BARRA DE BÚSQUEDA: EL FUELLE (CORREGIDO) */
    .input-container-movil {
        display: block !important;
        position: relative; /* Clave para anclar la lupa */
        flex: 1 1 auto !important; 
        min-width: 60px !important; 
        max-width: 180px !important; 
        margin: 0 !important;
    }
    .input-movil {
        width: 100%; height: 34px; 
        /* Espacio a la derecha para que el texto no tape la lupa */
        padding: 5px 28px 5px 8px; 
        font-size: 11px; border-radius: 8px;
        background-color: rgba(255,255,255,.6);
        border: 1.5px solid rgba(0,0,0,.8);
        box-sizing: border-box;
    }

    /* LUPA MÓVIL: Anclaje absoluto para que NO se salga */
    .icon-button-movil {
        all: unset;
        position: absolute;
        right: 8px; /* Siempre a 8px del borde derecho interno */
        top: 50%;
        transform: translateY(-50%);
        font-size: 13px;
        color: #000;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 2;
    }

    /* 4. LOGIN: Margen para el pulgar */
    .btn-login {
        flex: 0 0 auto !important;
        margin-right: 8px !important; 
    }
    .btn-login i.bi-person { font-size: 1.8rem !important; }
}

/* ===============================
   BUSCADOR DESKTOP
=================================*/
.input-container { width: 240px; position: relative; }
.input {
  width: 100%; height: 40px; padding: 10px;
  border: 2.5px solid rgba(0,0,0,.9); 
  font-size: 14px; border-radius: 10px;
  box-sizing: border-box; color: #333; 
  transition: .2s linear;
  background-color: rgba(255,255,255,.55);
}
.input:focus { outline: none; border: .5px solid #000; box-shadow: 5px 5px 0 #888; }
.icon-button { all: unset; cursor: pointer; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
@media (max-width: 575.98px) { .input-container { display: none !important; } }

/* ===============================
   PANEL LATERAL Y RESTO
=================================*/
#menuLateralAuth { position: fixed; inset: 0 0 0 auto; width: 360px; max-width: 92vw; transform: translateX(100%); transition: transform .3s ease; z-index: 1100; background: transparent; }
#menuLateralAuth.activo { transform: translateX(0); }
#overlayAuth { position: fixed; inset: 0; background: rgba(0,0,0,.35); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 1095; }
#overlayAuth.activo { opacity: 1; pointer-events: auto; }
#menuLateralAuth .menu-lateral-contenido {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,255,255,.85) 40%, color-mix(in srgb, var(--color-primary), transparent 60%));
  backdrop-filter: blur(8px);
  border-top-left-radius: 14px; border-bottom-left-radius: 14px;
  box-shadow: -24px 0 64px rgba(0,0,0,.20); 
  display: flex; flex-direction: column;
}

@media (min-width: 576px) and (max-width: 890px) {
    .input-container { width: 28vw !important; min-width: 120px; max-width: 220px; }
}