/* Reset y variables */
:root {
    --primary-color: #4f71d7;
    --secondary-color: #4f67af;
    --accent-color: #4f67af;
    --offer-color: #ff9800;
    --dark-color: #f8f9fa;
    --light-color: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    overflow-x: hidden;
    padding-top: 70px; /* Reducido */
}

/* Header FIJADO - COMPACTO */
.header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    padding: 8px 0; /* Reducido */
    position: fixed;
    overflow: visible;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1030;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: 70px; /* Reducido */
}

/* Contenedor principal del header - MÁS COMPACTO */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px; /* Reducido */
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    height: 100%;
    gap: 15px; /* Reducido */
}

/* Logo responsivo */
.logo-container {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.logo {
    max-height: 50px; /* Reducido */
    width: auto;
    object-fit: contain;
}

/* ======== BUSCADOR COMPACTO ======== */
.search-container {
    flex: 1;
    min-width: 200px;
    max-width: 600px;
    position: relative;
    margin: 0 10px; /* Reducido */
    transition: all 0.3s ease;
}

.search-group {
    display: flex;
    width: 100%;
    border-radius: 20px; /* Reducido */
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    background: white;
    height: 40px; /* Reducido */
    /* SIN BORDE */
}

.search-input {
    border: none;
    padding: 8px 15px; /* Reducido */
    flex: 1;
    font-size: 14px;
    outline: none;
    background: transparent;
    width: 100%;
    color: #333;
}

.search-input:focus {
    background: #f8f9fa;
}

.search-input::placeholder {
    color: #777;
}

.search-button {
    background: var(--accent-color);
    border: none;
    color: white;
    padding: 0 20px; /* Reducido */
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    min-width: 60px; /* Reducido */
}

.search-button:hover {
    background: var(--secondary-color);
}

/* ======== MENÚ DE USUARIO COMPACTO ======== */
.user-menu-container {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 150px; /* Reducido */
}

.user-menu, .guest-menu {
    display: flex;
    align-items: center;
    gap: 10px; /* Reducido */
    justify-content: flex-end;
    width: 100%;
}

/* Avatar - SIN BORDE */
.user-avatar {
    width: 38px; /* Reducido */
    height: 38px; /* Reducido */
    border-radius: 50%;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px; /* Reducido */
    flex-shrink: 0;
    /* SIN BORDE NI SOMBRA */
}

/* Botón Iniciar Sesión - SIN BORDE */
.btn-login {
    background-color: transparent; /* Más transparente */
    border: none; /* SIN BORDE */
    color: white;
    padding: 8px 18px; /* Reducido */
    border-radius: 5px; /* Menos redondeado */
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
}

.btn-login:hover {
    background-color: rgba(255,255,255,0.3);
    transform: none; /* Sin animación */
}

.btn-login i {
    font-size: 16px;
}

/* Estilos para el carrito */
.cart-container {
    position: relative;
    margin-left: 10px;
}

.cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: none;
    color: white;
    font-size: 22px;
    position: relative;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cart-icon:hover {
    transform: scale(1.1);
    color: #ffc107;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Botón del menú hamburguesa - SIN BORDE */
.dropdown-toggle {
    background-color: transparent; /* Más transparente */
    border: none; /* SIN BORDE */
    color: white;
    padding: 8px 12px; /* Reducido */
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px; /* Reducido */
    height: 38px; /* Reducido */
}

/* Estilo especial para la opción de ofertas */
.dropdown-menu .offer-item {
    background-color: rgba(255, 152, 0, 0.1);
    color: var(--offer-color);
    font-weight: 600;
}

.dropdown-menu .offer-item:hover {
    background-color: rgba(255, 152, 0, 0.2);
    color: var(--offer-color);
}

.dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: none; /* Sin rotación */
}

/* Menú desplegable */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 220px; /* Reducido */
    border-radius: 8px; /* Reducido */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1050;
    display: none;
    border: 1px solid #e0e0e0;
    padding: 8px 0; /* Reducido */
    margin-top: 8px; /* Reducido */
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 10px 16px; /* Reducido */
    display: flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: var(--light-color);
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px; /* Reducido */
    gap: 10px; /* Reducido */
    border-left: 2px solid transparent; /* Borde más fino */
}

.dropdown-item i {
    width: 16px; /* Reducido */
    text-align: center;
    color: #6c757d;
    font-size: 14px; /* Reducido */
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.dropdown-item:hover i {
    color: var(--offer-color);
}

/* Badge de notificaciones */
.notification-badge {
    background-color: #ff4757;
    color: white;
    border-radius: 50%;
    padding: 2px 6px; /* Reducido */
    font-size: 0.65rem; /* Reducido */
    font-weight: bold;
    min-width: 18px; /* Reducido */
    height: 18px; /* Reducido */
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-left: auto;
}

/* Separador */
.dropdown-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 6px 16px; /* Reducido */
    border: none;
}

/* CONTENEDOR DE SUGERENCIAS - MÁS COMPACTO */
.suggestions-grid {
    display: none;
    grid-template-columns: 1fr;
    gap: 6px; /* Reducido */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    z-index: 100;
    padding: 10px; /* Reducido */
    margin-top: 8px; /* Reducido */
    border-radius: 8px; /* Reducido */
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 300px; /* Reducido */
    overflow-y: auto;
}

.suggestion-item {
    background: #f8f9fa;
    border-radius: 6px; /* Reducido */
    padding: 10px; /* Reducido */
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    cursor: pointer;
}

.suggestion-item:hover {
    transform: translateY(-2px); /* Reducido */
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
    background: white;
}

.suggestion-text {
    font-weight: 600;
    color: var(--light-color);
    font-size: 13px; /* Reducido */
    margin-bottom: 3px; /* Reducido */
}

.suggestion-hint {
    font-size: 0.75rem; /* Reducido */
    color: #6c757d;
}

/* ======== MEDIA QUERIES - MÁS COMPACTAS ======== */

/* Tablets grandes (1200px - 1400px) */
@media (max-width: 1400px) {
    .header-container {
        padding: 0 12px;
        gap: 12px;
    }
    
    .logo {
        max-height: 45px;
    }
    
    .search-container {
        max-width: 500px;
        margin: 0 8px;
    }
    
    .search-group {
        height: 38px;
    }
}

/* Tablets (992px - 1200px) */
@media (max-width: 1200px) {
    .header {
        height: 65px; /* Reducido */
        padding: 6px 0; /* Reducido */
    }
    
    body {
        padding-top: 65px; /* Reducido */
    }
    
    .header-container {
        padding: 0 10px;
        gap: 10px;
    }
    
    .logo {
        max-height: 42px; /* Reducido */
    }
    
    .search-container {
        max-width: 450px;
    }
    
    .search-group {
        height: 36px; /* Reducido */
        border-radius: 18px;
    }
    
    .search-input {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .search-button {
        padding: 0 16px;
        font-size: 13px;
        min-width: 55px;
    }
    
    .btn-login {
        padding: 7px 15px;
        font-size: 13px;
    }
    
    .user-avatar, .dropdown-toggle {
        width: 36px;
        height: 36px;
    }
}

/* Tablets pequeñas (768px - 992px) */
@media (max-width: 992px) {
    .header {
        height: 60px; /* Reducido */
        padding: 5px 0; /* Reducido */
    }
    
    body {
        padding-top: 60px; /* Reducido */
    }
    
    .header-container {
        gap: 8px;
    }
    
    .logo {
        max-height: 40px; /* Reducido */
    }
    
    .search-container {
        min-width: 150px;
    }
    
    .search-group {
        height: 34px; /* Reducido */
    }
    
    .search-input {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .search-button {
        padding: 0 14px;
        font-size: 12px;
        min-width: 50px;
    }
    
    .btn-login span {
        display: none;
    }
    
    .btn-login {
        padding: 6px 10px;
    }
    
    .btn-login i {
        font-size: 14px;
        margin: 0;
    }
    
    .user-menu, .guest-menu {
        gap: 8px;
    }
}

/* ========== BUSCADOR SE MUEVE A POSICIÓN FIJA DEBAJO DEL HEADER ========== */
/* Móviles grandes (576px - 768px) */
@media (max-width: 768px) {
    .header {
        height: 55px;
        padding: 4px 0;
    }
    
    body {
        padding-top: 105px; /* Aumentado para header + buscador fijo */
    }
    
    .header-container {
        padding: 0 8px;
        gap: 6px;
        height: 55px;
    }
    
    .logo {
        max-height: 35px;
    }
    
    .logo-container {
        min-width: 50px;
    }
    
    /* BUSCADOR FIJO DEBAJO DEL HEADER */
    .search-container {
        position: fixed;
        top: 55px; /* Justo debajo del header */
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
        z-index: 1025;
        padding: 8px 15px;
        background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .search-group {
        height: 40px;
        border-radius: 20px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.15);
        margin: 0 auto;
        max-width: 95%;
    }
    
    .search-input {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .search-input::placeholder {
        font-size: 14px;
    }
    
    .search-button {
        padding: 0 20px;
        font-size: 14px;
        min-width: 60px;
    }
    
    .user-menu-container {
        min-width: 100px;
    }
    
    .user-avatar, .dropdown-toggle {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .btn-login {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .dropdown-menu {
        min-width: 180px;
        top: 100%;
        margin-top: 5px;
    }
}

/* Móviles (480px - 576px) */
@media (max-width: 576px) {
    .header {
        height: 50px;
        padding: 3px 0;
    }
    
    body {
        padding-top: 100px; /* Ajustado para header más buscador */
    }
    
    .header-container {
        height: 50px;
    }
    
    .logo {
        max-height: 30px;
    }
    
    /* Buscador fijo ajustado */
    .search-container {
        top: 50px;
        padding: 6px 10px;
    }
    
    .search-group {
        height: 38px;
        border-radius: 19px;
        max-width: 96%;
    }
    
    .search-input {
        padding: 7px 12px;
        font-size: 13px;
    }
    
    .search-button {
        padding: 0 18px;
        font-size: 13px;
        min-width: 55px;
    }
    
    .user-avatar, .dropdown-toggle {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .btn-login {
        padding: 4px 6px;
        font-size: 10px;
    }
    
    .dropdown-menu {
        min-width: 160px;
    }
}

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
    .header-container {
        padding: 0 4px;
        gap: 4px;
        height: 50px;
    }
    
    .logo {
        max-height: 28px;
    }
    
    /* Buscador ajustado para pantallas muy pequeñas */
    .search-container {
        padding: 5px 8px;
    }
    
    .search-group {
        height: 36px;
        border-radius: 18px;
        max-width: 97%;
    }
    
    .search-input {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .search-input::placeholder {
        font-size: 12px;
    }
    
    .search-button {
        padding: 0 15px;
        font-size: 12px;
        min-width: 50px;
    }
    
    .user-menu-container {
        min-width: 80px;
    }
    
    .user-menu, .guest-menu {
        gap: 4px;
    }
    
    .dropdown-menu {
        min-width: 150px;
    }
    
/* Responsive */
@media (max-width: 768px) {
    .cart-icon {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .cart-badge {
        font-size: 10px;
        min-width: 16px;
        height: 16px;
    }
}

@media (max-width: 576px) {
    .cart-icon {
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
}
}