/* ============================================
   ESTILOS PARA BUSCADOR ELEGANTE
   Agregar al final de assets/css/style.css
   ============================================ */

/* Contenedor de resultados de búsqueda */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e7e7e7;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 500px;
    overflow-y: auto;
    z-index: 9999;
    margin-top: -1px;
    animation: slideDown 0.3s ease-out;
}

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

/* Lista de resultados */
.search-results-list {
    padding: 0;
    margin: 0;
}

/* Item individual de resultado */
.search-result-item {
    border-bottom: 1px solid #f4f4f4;
    transition: background-color 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
    background-color: #f8f8f8;
}

.search-result-item.selected {
    background-color: #fff5e6;
    border-left: 3px solid #c96;
}

.search-result-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.search-result-link:hover {
    text-decoration: none;
}

/* Imagen del resultado */
.search-result-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    margin-right: 15px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e7e7e7;
    background-color: #f8f8f8;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.search-result-item:hover .search-result-image img {
    transform: scale(1.05);
}

/* Detalles del resultado */
.search-result-details {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0 0 5px 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.2s ease;
}

.search-result-item:hover .search-result-title {
    color: #c96;
}

/* Precios en resultados */
.search-result-price {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-top: 5px;
}

.search-result-price .new-price {
    color: #c96;
    margin-right: 8px;
}

.search-result-price .old-price {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
}

.search-result-price .price {
    color: #333;
}

/* Categoría del producto */
.search-result-category {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
}

/* Sin resultados */
.search-no-results {
    padding: 30px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.search-no-results::before {
    content: "\f002";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    display: block;
    font-size: 36px;
    color: #e7e7e7;
    margin-bottom: 10px;
}

/* Footer de resultados */
.search-results-footer {
    padding: 12px 15px;
    background-color: #f8f8f8;
    border-top: 1px solid #e7e7e7;
    text-align: center;
}

.search-results-footer .btn {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Scrollbar personalizada para resultados */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.search-results::-webkit-scrollbar-thumb {
    background: #c96;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #b85;
}

/* Loading state */
.search-results.loading {
    padding: 40px 20px;
    text-align: center;
}

.search-results.loading::before {
    content: "";
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #c96;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Highlight de búsqueda */
.search-highlight {
    background-color: #fff3cd;
    color: #856404;
    padding: 0 2px;
    border-radius: 2px;
}

/* Responsive */
@media (max-width: 991px) {
    .search-results {
        max-height: 400px;
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    }
    
    .search-result-image {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }
    
    .search-result-title {
        font-size: 13px;
    }
    
    .search-result-price {
        font-size: 14px;
    }
}

@media (max-width: 575px) {
    .search-results {
        max-height: 350px;
    }
    
    .search-result-link {
        padding: 10px 12px;
    }
    
    .search-result-image {
        width: 45px;
        height: 45px;
        margin-right: 10px;
    }
    
    .search-result-title {
        font-size: 12px;
        -webkit-line-clamp: 1;
    }
    
    .search-result-price {
        font-size: 13px;
    }
    
    .search-result-price .old-price {
        font-size: 11px;
    }
}

/* Estado focus del input de búsqueda */
.header-search-wrapper input:focus {
    border-color: #c96;
    box-shadow: 0 0 0 0.2rem rgba(204, 153, 102, 0.15);
}

/* Animación del botón de búsqueda */
.header-search-wrapper .btn-primary:hover {
    background-color: #b85;
    border-color: #b85;
    transform: scale(1.05);
}

.header-search-wrapper .btn-primary {
    transition: all 0.2s ease;
}

/* Badge de cantidad de resultados */
.search-results-count {
    display: inline-block;
    padding: 4px 10px;
    background-color: #c96;
    color: #fff;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* Etiquetas en resultados */
.search-result-badges {
    margin-top: 5px;
}

.search-result-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 2px;
    margin-right: 5px;
}

.search-result-badge.badge-new {
    background-color: #00b894;
    color: #fff;
}

.search-result-badge.badge-sale {
    background-color: #e17055;
    color: #fff;
}

.search-result-badge.badge-exclusive {
    background-color: #6c5ce7;
    color: #fff;
}

/* Sugerencias de búsqueda */
.search-suggestions {
    padding: 10px 15px;
    background-color: #fff;
    border-bottom: 1px solid #f4f4f4;
}

.search-suggestions-title {
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.search-suggestion-item {
    display: inline-block;
    padding: 4px 12px;
    margin: 3px 5px 3px 0;
    background-color: #f8f8f8;
    border: 1px solid #e7e7e7;
    border-radius: 15px;
    font-size: 12px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s ease;
}

.search-suggestion-item:hover {
    background-color: #c96;
    color: #fff;
    border-color: #c96;
    text-decoration: none;
}

/* Overlay para cerrar resultados al hacer clic fuera */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 9998;
    display: none;
}

.search-overlay.active {
    display: block;
}

/* Notificaciones del carrito */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    display: flex;
    align-items: center;
    min-width: 300px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.cart-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.cart-notification.success {
    border-left: 4px solid #00b894;
}

.cart-notification.error {
    border-left: 4px solid #e17055;
}

.cart-notification.success::before {
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #00b894;
    margin-right: 12px;
    font-size: 18px;
}

.cart-notification.error::before {
    content: "\f00d";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #e17055;
    margin-right: 12px;
    font-size: 18px;
}

@media (max-width: 575px) {
    .cart-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* ============================================
   ESTILOS ADICIONALES PARA CARRITO DROPDOWN
   ============================================ */

/* Variantes de producto en el carrito */
.cart-product-variant {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

/* Carrito vacío */
.dropdown-cart-empty {
    padding: 40px 20px;
    text-align: center;
}

.dropdown-cart-empty p {
    color: #999;
    margin-bottom: 15px;
    font-size: 14px;
}

.dropdown-cart-empty::before {
    content: "\f07a";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    display: block;
    font-size: 48px;
    color: #e7e7e7;
    margin-bottom: 15px;
}

/* Animación para eliminar items del carrito */
.product.removing {
    opacity: 0.5;
    pointer-events: none;
}

/* Mejorar el botón de eliminar */
.btn-remove {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: transparent;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background-color: #e17055;
    color: #fff;
    transform: rotate(90deg);
}

/* Loading spinner para búsqueda */
@keyframes searchPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.search-results.loading::after {
    content: "Buscando...";
    display: block;
    margin-top: 10px;
    color: #999;
    font-size: 13px;
    animation: searchPulse 1.5s ease-in-out infinite;
}

/* Estilos para el input cuando está activo */
.header-search-wrapper.active input {
    border-color: #c96;
    box-shadow: 0 0 0 3px rgba(204, 153, 102, 0.1);
}

/* Badge de descuento en resultados */
.search-result-discount-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #e17055;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 2px;
    line-height: 1;
}

.search-result-image {
    position: relative;
}