/* ========================================
   NAVBAR COMPLETO ESTILO FRÁVEGA
   ======================================== */

/* Reset y variables */
:root {
    --color-primary: #00B1F0;
    --color-secondary: #186489;
    --color-text: #333;
    --color-text-light: #666;
    --color-border: #e0e0e0;
    --color-bg-light: #f8f8f8;
    --navbar-height-top: 70px;
    --navbar-height-bottom: 50px;
}

/* ========================================
   PARTE SUPERIOR DEL NAVBAR
   ======================================== */

.navbar-fravega {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-top {
    /* height: var(--navbar-height-top); */
    padding: 10px 0px;
    border-bottom: 1px solid var(--color-border);
}

.navbar-top-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 30px;
}

/* Logo */
.navbar-logo {
    flex-shrink: 0;
    width: 180px;
}

.navbar-logo img {
    width: 100%;
    max-height: 55px;
    height: auto;
    object-fit: contain;
    object-position: left;
}

/* Buscador */
.navbar-search {
    flex: 1;
    max-width: 600px;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper input {
    width: 100%;
    height: 40px;
    padding: 0 50px 0 15px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.search-input-wrapper .btn-search {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 45px;
    background: transparent;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    transition: color 0.2s ease;
}

.search-input-wrapper .btn-search:hover {
    color: var(--color-primary);
}

.search-input-wrapper .btn-search i {
    font-size: 1.1rem;
}

/* Acciones de Usuario */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.navbar-action-link {
    display: flex;
    /* flex-direction: column; */
    align-items: center;
    gap: 5px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s ease;
    cursor: pointer;
    padding: 5px 10px;
}

.navbar-action-link:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.navbar-action-link i, .navbar-action-link svg {
    font-size: 1.5rem;
}

.navbar-action-link span {
    /* font-size: 1rem; */
    white-space: nowrap;
}

/* Cart Icon */
.cart-icon-wrapper {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

/* User Menu Dropdown */
.navbar-user-menu {
    position: relative;
}

.navbar-user-menu .dropdown-menu {
    min-width: 220px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--color-border);
    padding: 10px 0;
    margin-top: 10px;
}

.navbar-user-menu .dropdown-item {
    padding: 10px 20px;
    font-size: 0.9rem;
    color: var(--color-text);
    transition: background-color 0.2s ease;
}

.navbar-user-menu .dropdown-item:hover {
    background-color: var(--color-bg-light);
    color: var(--color-primary);
}

.navbar-user-menu .dropdown-item i {
    width: 20px;
    margin-right: 10px;
    font-size: 0.9rem;
}

.navbar-user-menu .dropdown-divider {
    margin: 8px 0;
}

/* ========================================
   PARTE INFERIOR DEL NAVBAR - MENÚ
   ======================================== */

.navbar-bottom {
    height: var(--navbar-height-bottom);
    background: white;
    border-bottom: 1px solid var(--color-border);
}

.navbar-bottom .container-fluid {
    height: 100%;
    display: flex;
    align-items: center;
}

/* ========================================
   MOBILE
   ======================================== */

.navbar-mobile-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 999;
    transition: transform 0.2s ease;
}

.navbar-mobile-toggle:hover {
    transform: scale(1.1);
}

.navbar-mobile-toggle i {
    font-size: 1.3rem;
}

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

@media (max-width: 992px) {
    .navbar-top-content {
        gap: 15px;
    }

    .navbar-logo {
        width: 120px;
    }

    .navbar-search {
        max-width: 400px;
    }

    .navbar-actions {
        gap: 10px;
    }

    /* .navbar-action-link span {
        display: none;
    } */

    .navbar-action-link {
        padding: 5px;
    }
}

@media (max-width: 768px) {
    .navbar-top {
        height: 60px;
    }

    .navbar-logo {
        width: 100px;
    }

    .navbar-search {
        max-width: none;
    }

    .search-input-wrapper input {
        height: 35px;
        font-size: 0.85rem;
    }

    .navbar-action-link i {
        font-size: 1.3rem;
    }

    .navbar-bottom {
        display: none;
    }

    .toast{
        top: 50px;
        right: 15px;
    }
}

@media (max-width: 576px) {
    .navbar-top-content {
        gap: 10px;
    }

    .navbar-logo {
        width: 35px;
    }
    .navbar-logo img {
        max-height: 35px;
    }

    .search-input-wrapper input {
        padding-right: 40px;
        padding-left: 10px;
    }

    .search-input-wrapper .btn-search {
        width: 35px;
    }

    .navbar-actions {
        gap: 8px;
    }
}

/* ========================================
   UTILIDADES
   ======================================== */

.badge-cart:empty {
    display: none;
}

/* Animación suave al abrir el menú */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu.show {
    animation: fadeInDown 0.2s ease;
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Espaciado para el sticky navbar */
body {
    padding-top: 0;
}

.navbar-fravega ~ main {
    margin-top: 0;
}
