/* Header fijo con top 0*/
.todo-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: white;
    border-bottom: 1px solid #ddd; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 
    padding: 15px 0; 
    transition: top 0.3s;
    font-family: 'Montserrat';
} 

/* Espaciado para el contenido debajo del header */
body {
    padding-top: 120px;
    font-family: 'Montserrat';
}

/* CONTENEDOR CENTRADO GLOBAL */
.top-inner,
.menu-inner {
    /* max-width: 1200px; */
    margin: 0 auto;
    width: 100%;
}

/* TOP BAR */
.top-bar {
    background: #f1f3f6;
    padding: 8px 0; /* un poco más alto */
    display: flex;
    justify-content: center;
}


.top-inner {
    max-width: 1200px;
    width: 100%;
    display: flex;
    justify-content: center; /* 🔥 todo centrado */
}


.top-left a {
    /* font-size: 14px; */
    text-decoration: none;
    color: #555;
    font-weight: 600;
    animation: pulseText 1.6s ease-in-out infinite;
}


.top-bar a:hover {
    color: #8a8d92;
    text-decoration: none;
}


@keyframes pulseText {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* HEADER */
.header-main {
    background: white;
    border-bottom: 1px solid #eee;
    z-index: 1000; /* Asegura que el header esté encima de otros elementos */
    background-color: var(--wht); /* Fondo blanco */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); 
}

.header-inner {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 20px 20px;
    background: #fff;
    max-width: 1200px; 
    margin: 0 auto; 
    width: 100%;
    white-space: nowrap;  

}

/* LOGO */
.logo {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    text-decoration: none;
}

.logo img{
    height: 65px;
    width: auto;
    display: block;
}

/* LOGIN DESTACADO */
.login-link {
    text-decoration: none;
    font-size: 14px;
    color: #3b82f6;
    font-weight: 500;
    border: 1px solid #dbeafe;
    padding: 6px 12px;
    border-radius: 6px;
    transition: 0.2s;
}

.login-link:hover {
    background: #eff6ff;
}

/* DERECHA */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* badge carrito limpio */
.header-actions .badge {
    position: absolute;
    top: -6px;
    right: -12px;
    background: #ff4d4f;
    color: white;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 50%;
}

/* TEXTO USUARIO */
.welcome {
    font-size: 13px;
    color: #6b7280;
}

/* LINKS LIMPIOS (sin iconos feos) */
.icon-link {
    position: relative;
    text-decoration: none;
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.icon-link:hover {
    color: #000;
}

/* BADGE */
.badge {
    position: absolute;
    top: -6px;
    right: -12px;
    background: #ff4d4f;
    color: white;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 50%;
}

/* CUENTA */
.account-link {
    text-decoration: none;
    font-size: 14px;
    color: #333;
}

/* LOGOUT */
.logout-link {
    text-decoration: none;
    font-size: 14px;
    color: #999;
}

.logout-link:hover {
    color: #d42d2d;
}

/* MENÚ */
.menu-categories {
    background: white;
    /* border-bottom: 1px solid #eee; */
}

.menu-inner {
    display: flex;
    justify-content: center; 
    gap: 30px;
    padding: 12px 0;
}

.menu-categories a {
    text-decoration: none;
    font-size: 17px;
    color: #555;
    position: relative;
    padding: 5px 0;
}

/* HOVER PRO */
.menu-categories a::after {
    content: "";
    position: absolute;
    width: 0%;
    height: 2px;
    bottom: -6px;
    left: 0;
    background: #111;
    transition: 0.3s;
}

.menu-categories a:hover::after {
    width: 100%;
}

.menu-categories a:hover {
    color: #000;
    font-weight: 600;
}

/* ICONOS SVG */
.icon-svg {
    width: 22px;
    height: 22px;
    color: #6b7280; /* gris elegante */
    transition: 0.25s;
}

/* HOVER PRO */
.icon-link:hover .icon-svg {
    color: #111; /* negro suave */
    transform: scale(1.1);
}

/* ACOMODO */

.search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 45px;
    color: #888;
    margin-right: 8px;
    opacity: 0.7;
    transition: 0.2s;
}

.search-icon svg {
    width: 22px;
    height: 22px;
}

.search-box:focus-within .search-icon {
    color: #3483fa;
}

.search-box:hover .search-icon {
    opacity: 1;
}

.search-form {
    display: flex;
    align-items: center; 
    flex-grow: 1;
    justify-content: center;
}


/* Contenedor global del buscador */
.search-global {
    position: absolute;
    top: 30px; /* Ajustamos la distancia desde el top */
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    display: flex;
    justify-content: center;
    z-index: 1000;
}

/* Caja de búsqueda */
.search-box {
    /* margin-top: 20px; */
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 400px;  /* Reducción de la anchura para hacerlo más delgado */
    margin-left: auto;
    margin-right: auto;
    background: white;
    border-radius: 12px;
    overflow: visible !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    /* padding: 5px; */
}

/* Estilo del campo de texto */
.search-box input {
    flex: 1;
    border: none;
    padding: 12px 5px;
    outline: none;
    font-size: 14px;  
}

/* Estilo del botón */
.search-box button {
    border: none;
    background: #eee;
    color: #3483fa;
    padding: 0 15px;
    cursor: pointer;
    font-size: 14px;
   
     
}

/* Hover sobre el botón */
.search-box button:hover {
    background-color: #2979d9;
    color: white;
}

/* TARJETA */
.search-card {
    min-width: 140px;
    background: white;
    border-radius: 12px;
    padding: 8px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: 0.2s;
}

.search-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.12);
}

/* IMAGEN */
.search-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    background: #f5f5f5;
}

/* INFO */
.search-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
    
}

/* TITULO */
.search-title {
    font-size: 13px;
    color: #333;
    line-height: 1.2;
    font-weight: 600;
    margin-top: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;    
}

/* PRECIO */
.search-price {
    font-size: 14px;
    font-weight: bold;
    color: #2ecc71;
}

/* BOTONES CARRUSEL */
.carousel-btn {
    position: absolute;
    top: 35%;
    /* transform: translateY(-50%); */
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 10;
}

.carousel-btn.left { left: 5px; }
.carousel-btn.right { 
    
    right: 5px; 

}

/* HIGHLIGHT */
mark {
    background: #ffeaa7;
    padding: 0 2px;
    border-radius: 3px;
}

.suggestion-item img {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

.suggestion-item {
    display: flex;
    gap: 12px;
    padding: 12px 15px;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background: #f8f9fb;
    transform: translateX(3px);
}

.suggestion-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suggestion-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.suggestion-price {
    font-size: 13px;
    color: #2ecc71;
    font-weight: bold;
}

.suggestionsBox {
    display: none;
    position: absolute;
    top: 110%;
    left: 0;
    width: 130%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    z-index: 9999;
    padding: 10px 0;
    transition: all 0.15s ease;
}

.price-old {
    text-decoration: line-through;
    color: #999;
    font-size: 12px;
}

.price-new {
    color: #e74c3c;
    font-weight: bold;
    font-size: 14px;
}

.suggestionsBox {
    animation: fadeIn 0.2s ease;
}

/* CONTENEDOR GENERAL */
.suggestions-wrapper {
    padding: 10px;
}

.suggestions-header {
    font-size: 14px;
    font-weight: 600;
    padding: 5px 10px;
    color: #333;
}

/* CARRUSEL */
.products-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px;
    scroll-behavior: smooth;
}

.products-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-container {
    position: relative;
}

/* Estilo específico para el botón de añadir al carrito */
.search-box .add-btn {
    height: 30px;
    margin-top: 10px;
    background: #eee; 
    border: none;
    color: #555;
    font-weight: 500;
    width: 100%;  
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-top: 4px;
    /* border: 1px solid #999; */
    transition: background-color 0.3s ease;
}

.search-box .add-btn:hover {
    background: #77b88d;  
    color: white;
}

.search-box .add-btn span {
    font-size: 20px;  
    font-weight: bold;
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividad: Aseguramos que en pantallas pequeñas también esté bien */
@media (max-width: 768px) {
    .search-box {
        max-width: 350px; /* Hacer la caja de búsqueda aún más estrecha en pantallas pequeñas */
    }

    .search-box input {
        font-size: 13px;  /* Ajustar el tamaño del texto en dispositivos más pequeños */
    }

    .search-box button {
        font-size: 14px;
        padding: 0 12px;
    }
}


/* Estilos para pantallas de escritorio */
@media (min-width: 1024px) {
    .container {
        width: 80%;
        margin: 0 auto;
    }
}

/* Estilos para pantallas de tabletas */
@media (max-width: 768px) {
    .container {
        width: 90%;
    }

    .navbar {
        display: flex;
        flex-direction: column;
    }
}

/* Estilos para pantallas de móvil */
@media (max-width: 480px) {
    .container {
        width: 100%;
    }

    .navbar {
        display: block;
    }
}
