/* ============================================
   HAPPY SEARCH - Estilos completos
   Barra de búsqueda responsiva estilo Amazon
   ============================================ */

/* --- Contenedor principal --- */
.amazon-search-container {
    width: 100%;
    max-width: none;
    margin: 0;
    height: clamp(42px, 5vw, 50px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* --- Grupo de inputs --- */
.search-input-group {
    display: flex;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 2px solid #ff9900;
    position: relative;
    background: #ffffff;
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    border-color: #ff9900;
    box-shadow: 0 2px 8px rgba(255, 153, 0, 0.3);
}

/* --- Dropdown de categorías --- */
.search-dropdown {
    position: relative;
    background: #f0f2f2;
    border-radius: 8px 0 0 8px;
    flex-shrink: 0;
    min-width: 70px;
    width: auto;
    max-width: 35%;
    display: flex;
    align-items: center;
}

.search-dropdown select.hs-category {
    width: 100%;
    min-width: 70px;
    max-width: 100%;
    padding: 0 clamp(8px, 2vw, 12px);
    padding-right: clamp(20px, 3vw, 15px);
    height: 100%;
    background: transparent;
    border: none;
    appearance: none;
    cursor: pointer;
    font-size: clamp(11px, 1.8vw, 14px);
    color: #333;
    outline: none;
    border-radius: 0;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
    text-align: left;
    flex: 1;
}

/* Flecha del dropdown */
.search-dropdown::after {
    content: "";
    position: absolute;
    right: clamp(6px, 1vw, 10px);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: clamp(8px, 1.2vw, 10px);
    height: clamp(8px, 1.2vw, 10px);
    mask: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 320 512%22%3E%3Cpath fill=%22%23666%22 d=%22M31.3 192h257.3c28.4 0 42.8 34.5 22.6 54.6L182.6 375.4c-12.5 12.5-32.8 12.5-45.3 0L8.7 246.6C-11.6 226.5 2.9 192 31.3 192z%22/%3E%3C/svg%3E') center/contain no-repeat;
    background: #666;
}

/* Opciones del select (cuando está abierto) */
.search-dropdown select.hs-category option {
    font-size: 14px;
    padding: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Input de búsqueda --- */
.search-input.hs-input {
    flex-grow: 1;
    padding: 0 clamp(12px, 2.5vw, 20px);
    border: none;
    font-size: clamp(13px, 2vw, 16px);
    outline: none;
    height: 100%;
    color: #333;
    background: transparent;
    min-width: 0;
}

.search-input.hs-input::placeholder {
    color: #999;
    font-weight: 400;
    font-size: clamp(12px, 1.8vw, 15px);
}

/* --- Botón de búsqueda --- */
.search-button.hs-submit {
    background: #febd69 !important;
    border: none !important;
    padding: 0 clamp(12px, 2vw, 18px);
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 0 8px 8px 0 !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333 !important;
    font-size: clamp(16px, 2.2vw, 20px);
    min-width: clamp(45px, 6vw, 55px);
}

.search-button.hs-submit:hover { 
    background: #f3a847 !important;
}

/* ============================================
   FIX DE PRIORIDAD - PARA GARANTIZAR FUNCIONAMIENTO
   ============================================ */

.hs-live-results {
    display: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: 70vh !important;
}

.hs-live-results:not(:empty) {
    display: block !important;
}

.hs-results {
    display: block !important;
    overflow: visible !important;
    padding: 8px !important;
}

.hs-result {
    display: block !important;
}

.hs-result-link {
    display: grid !important;
    grid-template-columns: 80px 1fr !important;
}

/* ============================================
   RESULTADOS EN VIVO - MEJORADOS
   ============================================ */

/* Overlay de fondo */
.hs-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.hs-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Contenedor principal cuando está activo */
.amazon-search-container.hs-active {
    position: relative;
    z-index: 10000;
}

/* Resultados en vivo - Corregido */
.hs-live-results {
    height: auto !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    overflow-x: visible !important;
    min-height: 500px !important;
    padding: 0 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    border: 1px solid #e1e5e9 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
    z-index: 10001 !important;
    margin-top: 8px !important;
}

/* Mostrar el contenedor únicamente cuando tenga contenido */
.hs-live-results:not(:empty) {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

/* Cabecera de resultados */
.hs-results-header {
    padding: 16px 20px 12px 20px;
    border-bottom: 1px solid #f1f3f4;
    background: #fafbfc;
    border-radius: 16px 16px 0 0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.hs-results-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hs-results-count {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Lista de resultados */
.hs-results { 
    list-style: none; 
    margin: 0; 
    padding: 8px !important;
    overflow: visible;
}

/* Elementos de resultado individual */
.hs-result a { 
    display: grid; 
    grid-template-columns: 50px 1fr; 
    gap: 15px; 
    align-items: center; 
    padding: 12px 20px; 
    text-decoration: none; 
    color: #212529;
    transition: all 0.2s ease;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin: 8px 8px;
}

.hs-result a:hover { 
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hs-thumb { 
    width: 50px; 
    height: 50px; 
    object-fit: cover; 
    border-radius: 8px;
    border: 1px solid #e1e5e9;
    transition: transform 0.2s ease;
}

.hs-result a:hover .hs-thumb {
    transform: scale(1.05);
}

.hs-title { 
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: #212529;
}

.hs-title mark { 
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* ============================================
   TARJETAS DE RESULTADOS - MEJORADAS
   ============================================ */

/* Enlace de resultado mejorado */
.hs-result-link {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 15px;
    align-items: start;
    padding: 16px 20px;
    text-decoration: none;
    color: #212529;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 8px;
    border: 1px solid transparent;
    background: transparent;
}

.hs-result-link:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #ff9900;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.15);
}

/* Contenedor de miniatura */
.hs-result-thumb {
    position: relative;
    width: 80px;
}

.hs-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.hs-type-icon {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff9900;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Contenido de resultado */
.hs-result-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.hs-result-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: #212529;
    margin: 0;
    word-wrap: break-word;
}

.hs-result-title mark {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 700;
}

.hs-result-excerpt {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hs-result-excerpt mark {
    background: #e7f1ff;
    color: #004085;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 500;
}

/* Meta información */
.hs-result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    flex-wrap: wrap;
    gap: 8px;
}

.hs-result-type {
    font-size: 11px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    white-space: nowrap;
}

.hs-result-price {
    font-size: 14px;
    font-weight: 700;
    color: #28a745;
    white-space: nowrap;
}

.hs-price {
    background: #d4edda;
    padding: 3px 8px;
    border-radius: 6px;
    color: #155724;
}

/* Estilos para precios gratuitos o consultar */
.hs-price-free {
    background: #e2e3e5;
    padding: 3px 8px;
    border-radius: 6px;
    color: #383d41;
    font-size: 12px;
    font-weight: 600;
}

.hs-page-info {
    background: #d1ecf1;
    padding: 3px 8px;
    border-radius: 6px;
    color: #0c5460;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Sin resultados --- */
.hs-no-results { 
    padding: 20px;
    color: #6c757d;
    text-align: center;
    font-style: italic;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin: 8px;
    border-radius: 8px;
}

.hs-no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.hs-no-results p {
    margin: 8px 0;
    font-size: 15px;
}

.hs-no-results small {
    font-size: 13px;
    opacity: 0.7;
}

/* --- Estado de carga --- */
.hs-loading {
    position: relative;
}

/* ============================================
   LOADER MEJORADO
   ============================================ */

/* 1. ELIMINAR COMPLETAMENTE EL LOADER ANTIGUO */
.hs-loading .search-input-group::after,
.hs-loading::after {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    content: none !important;
}

/* 2. ELIMINAR CUALQUIER ESTILO DE LOADER EN EL BOTÓN */
.hs-loading .search-button::before,
.hs-loading .search-button::after,
.hs-loading .hs-submit::before,
.hs-loading .hs-submit::after {
    display: none !important;
    content: none !important;
}

/* 3. MANTENER SOLO NUESTRO LOADER NUEVO CENTRADO */
.amazon-search-container.hs-loading .search-input-group::before {
    content: "" !important;
    position: absolute;
    top: calc(50% - 8px) !important;
    right: 58px !important;
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #ff9900 !important;
    border-top: 2px solid #2271b1 !important;
    border-radius: 50% !important;
    animation: spin 0.8s linear infinite !important;
    z-index: 1000 !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 4. ANIMACIÓN PARA EL LOADER NUEVO */
@keyframes spin {
    0% { transform: rotate(0deg) !important; }
    100% { transform: rotate(360deg) !important; }
}

/* 5. ESPACIO PARA EL LOADER EN EL INPUT */
.amazon-search-container.hs-loading .hs-input {
    padding-right: 50px !important;
}

/* ============================================
   MANEJO DE ERRORES
   ============================================ */
.hs-error-message {
    padding: 30px 20px;
    text-align: center;
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    margin: 10px;
}

.hs-error-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.hs-error-message p {
    margin: 5px 0;
}

/* ============================================
   ESTILOS PARA PÁGINA DE RESULTADOS DE BÚSQUEDA
   ============================================ */

.container {
    max-width: 1400px !important;
    margin: auto !important;
    border-radius: none !important;
    box-shadow: none !important;
    padding: 20px 10px 20px 10px !important;
    margin-bottom: 0 !important;
    border: none !important;
    background-color: var(--theme-palette-color-7) !important;
}

.search-results-title {
    font-size: 28px;
    margin-bottom: 40px;
    color: #333;
    border-bottom: 3px solid #ff9900;
    padding-bottom: 15px;
    font-weight: 700;
}

.results-count {
    font-size: 18px;
    color: #666;
    font-weight: normal;
    background: linear-gradient(135deg, #f0f2f2 0%, #e1e5e9 100%);
    padding: 8px 16px;
    border-radius: 25px;
    margin-left: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hs-search-results {
    max-width: 100%;
    margin: 0 auto;
}

/* Contenedor de resultados con mejor espaciado */
.hs-search-results .hs-results {
    list-style: none;
    margin: 0;
    padding: 8px !important;
    display: grid;
    gap: 25px; /* Más espacio entre resultados */
}

.hs-search-results .hs-result {
    background: #ffffff;
    border: 2px solid #f8f9fa;
    border-radius: 16px;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 15px !important;
}

.hs-search-results .hs-result:hover {
    border-color: #ff9900;
    box-shadow: 0 8px 25px rgba(255, 153, 0, 0.2);
    transform: translateY(-4px);
}

.hs-search-results .hs-result-link {
    display: grid;
    grid-template-columns: 140px 1fr; /* Imagen más grande */
    gap: 25px; /* Más espacio entre imagen y contenido */
    padding: 25px; /* Más padding interno */
    text-decoration: none;
    color: inherit;
    align-items: start;
    box-shadow: none !important;
    border: none !important;
}

.hs-search-results .hs-result-link:hover {
    background: transparent !important;
}

.hs-search-results .hs-result-thumb {
    position: relative;
    width: 100px !important;
    height: auto !important;
}

.hs-search-results .hs-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e1e5e9;
    transition: transform 0.3s ease;
}

.hs-search-results .hs-result:hover .hs-thumb {
    transform: scale(1.05);
}

.hs-search-results .hs-type-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #ff9900 0%, #ff7700 100%);
    color: white;
    border-radius: 50%;
    width: 36px !important;
    height: 36px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px !important;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 2;
}

.hs-search-results .hs-result-content {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Más espacio entre elementos del contenido */
    min-width: 0;
    padding: 5px 0;
    overflow: hidden !important;
}

.hs-search-results .hs-result-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    color: #212529;
    margin: 0;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hs-search-results .hs-result-title mark {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    padding: 3px 6px;
    border-radius: 6px;
    font-weight: 800;
}

.hs-search-results .hs-result-excerpt {
    font-size: 15px;
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Mostrar más líneas */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/*
.hs-result-content > p:not(.hs-result-excerpt),
.hs-result-content > ul,
.hs-result-content > li,
.hs-result-content > div {
    font-size: 14px !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 4.5em;
}

#hs-products-content > ul:nth-child(1) > li:nth-child(2) > a:nth-child(1) > div:nth-child(2) > ul:nth-child(4) > li:nth-child(1){
    font-size: 14px !important;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.5em;
}

#hs-products-content > ul:nth-child(1) > li:nth-child(2) > a:nth-child(1) > div:nth-child(2) > ul:nth-child(4) > li:nth-child(2){
    font-size: 14px !important;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 1.5em;
}*/

.hs-search-results .hs-result-excerpt mark {
    background: linear-gradient(135deg, #e7f1ff 0%, #d4e6ff 100%);
    color: #004085;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 600;
}

.hs-search-results .hs-result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px; /* Más espacio arriba */
    flex-wrap: wrap;
    gap: 15px; /* Más espacio entre elementos */
    padding-top: 12px;
    border-top: 1px solid #f1f3f4;
}

.hs-search-results .hs-result-type {
    font-size: 13px;
    color: #495057;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 6px 14px;
    border-radius: 15px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid #dee2e6;
}

.hs-search-results .hs-result-price {
    font-size: 18px;
    font-weight: 800;
    color: #28a745;
    white-space: nowrap;
}

.hs-search-results .hs-price {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    padding: 6px 14px;
    border-radius: 8px;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.hs-search-results .hs-price-free {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
    padding: 6px 14px;
    border-radius: 8px;
    color: #383d41;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid #d6d8db;
}

.hs-search-results .hs-page-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    padding: 6px 14px;
    border-radius: 8px;
    color: #0c5460;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: 1px solid #bee5eb;
}

/* Estados de hover mejorados */
.hs-search-results .hs-result-link:hover .hs-result-title {
    color: #ff9900;
}

.hs-search-results .hs-result-link:hover .hs-result-type {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

/* Sin resultados */
.hs-search-results .hs-no-results {
    padding: 80px 40px;
    text-align: center;
    color: #6c757d;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    margin: 40px 0;
    border: 2px dashed #dee2e6;
}

.hs-search-results .hs-no-results-icon {
    font-size: 80px;
    margin-bottom: 25px;
    opacity: 0.6;
}

.hs-search-results .hs-no-results p {
    margin: 15px 0;
    font-size: 18px;
    font-weight: 500;
}

.hs-search-results .hs-no-results small {
    font-size: 15px;
    opacity: 0.8;
}

/* Efectos de separación entre grupos (opcional) */
.hs-search-results .hs-result:nth-child(even) {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
}

.hs-search-results .hs-result:nth-child(odd) {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* PARA BÚSQUEDA POR BOTÓN - más específico */
.hs-search-results .hs-result .hs-result-link {
    grid-template-columns: 140px 1fr !important;
    gap: 25px !important;
    padding: 15px !important;
}

.hs-search-results .hs-result .hs-result-thumb {
    width: 140px !important;
    height: auto !important;
}

/* Asegurar que el contenido use el espacio disponible */
.hs-search-results .hs-result .hs-result-content {
    min-width: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
}

/* ============================================
   MEDIA QUERIES - RESPONSIVE DESIGN
   ============================================ */

/* --- Tablets y dispositivos medianos (768px) --- */
@media (max-width: 768px) { 

    .container{
        padding: 20px 8px 15px 8px !important;
    }

    .amazon-search-container { 
        height: 45px; 
    }
    
    .search-dropdown {
        max-width: 30%;
    }
    
    
    .search-input.hs-input {
        font-size: 14px;
        padding: 0 12px;
    }
    
    .search-input.hs-input::placeholder {
        font-size: 14px;
    }
    
    .search-button.hs-submit {
        padding: 0 12px;
        min-width: 45px;
        font-size: 16px;
    }
    
    .hs-result a {
        grid-template-columns: 40px 1fr;
        gap: 12px;
        padding: 10px 15px;
    }
    
    .hs-thumb {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
    }
    
    .hs-title {
        font-size: 14px;
    }
    
    /* Resultados en vivo en móviles */
    .hs-live-results {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 70vh !important;
        margin-top: 8px !important;
        border-radius: 12px !important;
        z-index: 10001 !important;
        display:
         none !important;
    }
    
    .hs-search-results .hs-page-info{
        font-size: 12px !important;
        padding: 4px 10px;
    }

    .hs-search-results .hs-price-free {
        font-size: 12px !important;
        padding: 4px 10px;
    }

    .hs-result-link {
        grid-template-columns: 60px 1fr;
        gap: 12px;
        padding: 12px 15px;
        align-items: start !important;
    }
    
    .hs-result-thumb {
        width: 60px;
        height: auto;
        flex-shrink: 0;
    }
    
    .hs-type-icon {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .hs-result-title {
        font-size: 15px;
    }
    
    .hs-result-excerpt {
        font-size: 13px !important;
        line-height: 1.4 !important;
        margin: 0 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        flex-shrink: 0;
    }
    
    .hs-result-meta {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-top: 4px !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        flex-shrink: 0;
    }
    
    .hs-close-results {
        display: block;
        position: absolute;
        top: 10px;
        right: 15px;
        background: none;
        border: none;
        font-size: 20px;
        color: #666;
        cursor: pointer;
        z-index: 10002;
    }
    
    /* Página de resultados de búsqueda */
    .hs-search-results .hs-results {
        gap: 20px;
    }
    
    .hs-search-results .hs-result .hs-result-link {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;
        padding: 10px !important;
        align-items: flex-start !important;
    }
    
    .hs-search-results .hs-result .hs-result-thumb {
        width: 70px !important;
        height: 70px !important;
        flex-shrink: 0 !important;
    }
    
    .hs-search-results .hs-type-icon {
        width: 28px;
        height: 28px;
        font-size: 13px;
        top: -8px;
        right: -8px;
    }
    
    .hs-search-results .hs-result-title {
         font-size: 17px !important;
        line-height: 1.3 !important;
        margin: 0 !important;
    }
    
    .hs-search-results .hs-result .hs-result-content {
        flex: 1 !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        height: auto !important;
        gap: 4px !important;
    }

    .hs-search-results .hs-result-excerpt {
        font-size: 14px !important;
        line-height: 1.4 !important;
        margin: 0 !important;
        -webkit-line-clamp: 2 !important;
    }

    .hs-search-results .hs-result .hs-result-meta {
        margin-top: auto !important;
        padding-top: 4px !important;
    }

    .hs-search-results .hs-type-icon {
        width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
    }
    
    .search-results-title {
        font-size: 15px !important;
        line-height: 1.3 !important;
        margin-bottom: 20px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    .results-count {
        font-size: 14px;
        padding: 6px 12px;
    }

    .hs-search-results .hs-result-type {
        font-size: 11px !important;
        padding: 3px 8px !important;
    }

    .hs-search-results .hs-price {
        font-size: 12px !important;
        padding: 4px 10px;
    }

    .hs-type-icon {
        width: 20px !important;
        height: 20px !important;
        font-size: 10px !important;
        top: -5px !important;
        right: -5px !important;
    }
}

/* --- Móviles (480px) --- */
@media (max-width: 480px) {

    .container{
        padding: 20px 5px 10px 5px !important;
    }

    .amazon-search-container { 
        height: 42px; 
    }

    .hs-search-results .hs-result-type {
        font-size: 10px !important;
        padding: 3px 8px !important;
    }    

    .hs-search-results .hs-price {
        font-size: 10px !important;
        padding: 2px 6px !important;
    }

    .hs-search-results .hs-page-info{
        font-size: 10px !important;
        padding: 2px 6px !important;
    }

    .hs-search-results .hs-price-free {
        font-size: 10px !important;
        padding: 2px 6px;
    }
    
    .search-input-group {
        border-radius: 10px;
    }
    
    .search-dropdown {
        border-radius: 10px 0 0 10px;
        max-width: 28%;
    }
    
    .search-input.hs-input {
        padding: 0 14px;
    }
    
    .search-button.hs-submit {
        border-radius: 0 10px 10px 0 !important;
        padding: 0 10px;
        min-width: 42px;
    }
    
    .search-dropdown::after {
        right: 6px;
        width: 8px;
        height: 8px;
    }
    
    .hs-result-link {
        grid-template-columns: 50px 1fr !important;
        gap: 10px;
        padding: 10px 12px;
    }
    
    .hs-result-thumb {
        width: 50px !important;
        height: auto !important;
    }

    .results-count {
        font-size: 12px;
        padding: 6px 12px;
        margin-left: 10px;
    }
    
    .hs-result-title {
        font-size: 14px !important;
    }
    
    .hs-result-excerpt {
        font-size: 12px !important;
        -webkit-line-clamp: 2 !important;
    }
    
    /* Página de resultados de búsqueda */
    .hs-search-results .hs-results {
        gap: 15px;
    }

    .hs-search-results .hs-result .hs-result-content {
        gap: 5px !important;
    }
    
    .hs-search-results .hs-result .hs-result-link {
        gap: 8px !important;
        padding: 8px !important;
    }
    
    .hs-search-results .hs-result .hs-result-thumb {
        width: 60px !important;
        height: 60px !important;
    }
    
    .hs-search-results .hs-result-title {
        font-size: 16px !important;
    }
    
    .hs-search-results .hs-result-excerpt {
        font-size: 13px !important;
        -webkit-line-clamp: 2;
    }

    .hs-result-content {
        gap: 4px !important;
    }
}

/* --- Móviles pequeños (360px) --- */
@media (max-width: 360px) {
    .amazon-search-container { 
        height: 40px; 
    }
    
    .search-dropdown {
        max-width: 25%;
    }
    
    
    .search-input.hs-input {
        font-size: 14px;
        padding: 0 8px;
    }
    
    .search-input.hs-input::placeholder {
        font-size: 14px;
    }

    .search-results-title {
        font-size: 13px !important;
    }
    
    .search-button.hs-submit {
        padding: 0 8px;
        min-width: 38px;
        font-size: 14px;
    }

    .results-count {
        font-size: 10px;
        padding: 4px 8px;
        margin-left: 5px;
    }

    .hs-result-link {
        grid-template-columns: 45px 1fr !important;
        gap: 8px;
        padding: 8px 10px;
    }
    
    .hs-result-thumb {
        width: 45px !important;
        height: auto !important;
    }
    
    .hs-result-title {
        font-size: 13px !important;
    }
    
    .hs-result-excerpt {
        font-size: 11px !important;
        -webkit-line-clamp: 2 !important;
    }
}

@media (max-width: 330px) {

    .search-results-title {
        font-size: 12px !important;
    }
    .results-count {
        font-size: 10px;
        padding: 4px 8px;
        margin-left: 5px;
    }

    .hs-search-results .hs-result-type {
        font-size: 8px !important;
        padding: 3px 8px !important;
    }    

    .hs-search-results .hs-price {
        font-size: 8px !important;
        padding: 2px 6px !important;
    }

    .hs-search-results .hs-page-info{
        font-size: 8px !important;
        padding: 2px 6px !important;
    }

    .hs-search-results .hs-price-free {
        font-size: 8px !important;
        padding: 2px 6px;
    }
}

/* ============================================
   MEJORAS DE ACCESIBILIDAD Y UX
   ============================================ */

/* Efecto hover para dispositivos con mouse */
@media (hover: hover) and (pointer: fine) {
    .search-dropdown select.hs-category:hover {
        background: #e8eaeb;
    }
    
    .hs-result-link:hover .hs-result-title {
        color: #ff9900;
    }
}

/* Mejoras de enfoque para accesibilidad */
.search-dropdown select.hs-category:focus {
    background: #e8eaeb;
    outline: none;
}

.search-input.hs-input:focus {
    background: #fafafa;
}

/* Animación para mostrar/ocultar resultados */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados de carga mejorados */
.amazon-search-container.hs-loading .search-input-group {
    border-color: #2271b1;
}

.amazon-search-container.hs-loading .search-button.hs-submit {
    background: #c4c4c4 !important;
    cursor: not-allowed;
}

/* ============================================
   ESTILOS ESPECÍFICOS PARA DIFERENTES TIPOS DE CONTENIDO
   ============================================ */

/* Iconos para diferentes tipos de contenido */
.hs-type-post { background: #007cba !important; }
.hs-type-page { background: #00a32a !important; }
.hs-type-product { background: #ff9900 !important; }
.hs-type-download { background: #9463c4 !important; }
.hs-type-course { background: #d63638 !important; }
.hs-type-video { background: #2271b1 !important; }

/* Colores de tipo para la página de resultados */
.hs-search-results .hs-type-post { background: linear-gradient(135deg, #007cba 0%, #006ba1 100%) !important; }
.hs-search-results .hs-type-page { background: linear-gradient(135deg, #00a32a 0%, #008a20 100%) !important; }
.hs-search-results .hs-type-product { background: linear-gradient(135deg, #ff9900 0%, #ff7700 100%) !important; }
.hs-search-results .hs-type-download { background: linear-gradient(135deg, #9463c4 0%, #7c4bc4 100%) !important; }
.hs-search-results .hs-type-course { background: linear-gradient(135deg, #d63638 0%, #c21c1c 100%) !important; }
.hs-search-results .hs-type-video { background: linear-gradient(135deg, #2271b1 0%, #135e96 100%) !important; }


/* ============================================
   ESTILOS PARA BÚSQUEDA EN VIVO (MÁS ESPECÍFICOS)
   ============================================ */

/* Asegurar que los estilos de búsqueda en vivo tengan prioridad */
.hs-live-results:not(:empty) {
    display: block !important;
    animation: fadeInUp 0.3s ease-out !important;
}

.hs-result-link {
    display: grid !important;
    grid-template-columns: 80px 1fr !important;
    gap: 15px !important;
    align-items: start !important;
    padding: 16px 20px !important;
}

/* ============================================
   GARANTIZAR PRIORIDAD DE ESTILOS FIX
   ============================================ */

/* Estilos que garantizan que las correcciones tengan prioridad */
.amazon-search-container.hs-active {
    z-index: 10000 !important;
}

.hs-live-results:not(:empty) {
    display: block !important;
}

.hs-result-link {
    display: grid !important;
    grid-template-columns: 80px 1fr !important;
}

/* Eliminar cualquier loader antiguo que pueda interferir */
.search-input-group::after,
.hs-loading::after {
    display: none !important;
}

/* Loader nuevo con máxima prioridad */
.amazon-search-container.hs-loading .search-input-group::before {
    content: "" !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ============================================
   ESTILOS PARA SECCIONES ACORDEÓN - CORREGIDO
   ============================================ */

.hs-search-sections {
    max-width: 100%;
    margin: 0 auto;
}

.hs-section {
    background: #ffffff;
    border: 2px solid #f8f9fa;
    border-radius: 16px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.hs-section:hover {
    border-color: #ff9900;
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.15);
}

.hs-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.hs-section-header:hover {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

.hs-section-header.active {
    background: linear-gradient(135deg, #ff9900 0%, #ff7700 100%);
    border-bottom-color: #e1e5e9;
}

.hs-section-header.active .hs-section-title {
    color: white;
}

.hs-section-header.active .hs-section-count {
    background: rgba(255, 255, 255, 0.9);
    color: #ff9900;
}

.hs-section-header.active .hs-section-toggle {
    transform: rotate(180deg);
    color: white;
}

.hs-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: #212529;
    margin: 0;
    transition: color 0.3s ease;
}

.hs-section-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hs-section-count {
    font-size: 14px;
    font-weight: 600;
    background: #ff9900;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    margin-left: 10px;
}

.hs-section-toggle {
    font-size: 16px;
    font-weight: bold;
    color: #6c757d;
    transition: all 0.3s ease;
    transform: rotate(0deg);
}

/* CONTENIDO - INICIALMENTE OCULTO */
.hs-section-content {
    display: none;
    padding: 0;
    background: white;
}

.hs-section-content.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

.hs-section-content .hs-results {
    list-style: none;
    margin: 0;
    padding: 8px !important;
    display: grid;
    gap: 15px;
    padding: 20px;
}

.hs-section-content .hs-result {
    background: #ffffff;
    border: 1px solid #f1f3f4;
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.hs-section-content .hs-result:hover {
    border-color: #ff9900;
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.15);
    transform: translateY(-2px);
}

.hs-section-content .hs-result-link {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 20px;
    padding: 18px;
    text-decoration: none;
    color: inherit;
    align-items: start;
}

/* Animación para el acordeón */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos específicos para cada sección */
.hs-products-section .hs-section-header {
    border-left: 4px solid #28a745;
}

.hs-services-section .hs-section-header {
    border-left: 4px solid #007bff;
}

.hs-pages-section .hs-section-header {
    border-left: 4px solid #6f42c1;
}

/* Responsive */
@media (max-width: 768px) {
    .hs-section-header {
        padding: 15px 20px;
    }
    
    .hs-section-title {
        font-size: 18px;
    }
    
    .hs-section-icon {
        font-size: 20px;
        width: 35px;
        height: 35px;
    }
    
    .hs-section-content .hs-result-link {
        grid-template-columns: 80px 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .hs-section-content .hs-results {
        padding: 8px !important;
        gap: 12px !important;
    }
}

@media (max-width: 480px) {
    .hs-section-header {
        padding: 12px 15px;
    }

    .hs-section-content .hs-results {
        padding: 5px !important;
        gap: 8px !important;
    }
    
    .hs-section-title {
        font-size: 16px;
        gap: 8px;
    }
    
    .hs-section-icon {
        font-size: 18px;
        width: 30px;
        height: 30px;
    }
    
    .hs-section-count {
        font-size: 12px;
        padding: 3px 8px;
    }
}

/* ============================================
   INDICADOR DE BÚSQUEDA EN MÓVILES
   ============================================ */

@media (max-width: 768px) {
    .amazon-search-container .hs-input::placeholder {
        color: #999;
    }
    
    /* Opcional: Mostrar un mensaje tooltip en móviles */
    .amazon-search-container.mobile-search .search-input-group::after {
        content: "Presiona Enter para buscar";
        position: absolute;
        bottom: -25px;
        left: 0;
        font-size: 11px;
        color: #666;
        background: #f8f9fa;
        padding: 2px 6px;
        border-radius: 4px;
        white-space: nowrap;
    }
}

/* FIX DEFINITIVO - ELIMINAR REDIMENSIÓN */
.search-dropdown {
    width: 70px !important; /* Ancho fijo inicial */
    min-width: 70px !important;
    max-width: 200px !important;
    flex: 0 0 auto !important;
    transition: none !important;
}

.search-dropdown select.hs-category {
    width: 100% !important;
    text-overflow: ellipsis;
    overflow: hidden;
    font-size: 14px !important;
}

/* Eliminar cualquier animación problemática */
.search-dropdown * {
    transition: none !important;
}

/* ============================================
   BADGES DE LOCALIZACIÓN CON ICONOS SVG - CORREGIDO
   ============================================ */

/* Badge de localización CON SVG - POSICIÓN CORREGIDA */
.hs-location-badge {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    padding: 6px 10px 6px 30px !important; /* Más padding izquierdo para el icono */
    border-radius: 12px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    z-index: 1000 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
    border: 2px solid white !important;
    
    /* Texto completo */
    white-space: nowrap !important;
    max-width: none !important;
    width: auto !important;
    min-width: auto !important;
    overflow: visible !important;
    text-overflow: unset !important;
    
    /* CORRECCIÓN: ELIMINAR position: relative */
    /* position: relative !important; ← ESTA LÍNEA DEBE ELIMINARSE */
}

/* Icono SVG dentro del badge - POSICIÓN CORREGIDA */
.hs-location-badge::before {
    content: '' !important;
    position: absolute !important;
    left: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 14px !important;
    height: 14px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* Badge disponible - CON ICONO CHECK VERDE */
.hs-location-available {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white !important;
}

.hs-location-available::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E") !important;
}

/* Badge no disponible - CON ICONO CRUZ ROJA */
.hs-location-restricted {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
}

.hs-location-restricted::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E") !important;
}

/* Para búsqueda en vivo */
.hs-live-results .hs-location-badge {
    top: 10px !important;
    right: 10px !important;
    padding: 5px 8px 5px 26px !important; /* Ajustar padding para icono */
    font-size: 9px !important;
}

.hs-live-results .hs-location-badge::before {
    width: 12px !important;
    height: 12px !important;
    left: 6px !important;
}

/* Para página de resultados de búsqueda */
.hs-search-results .hs-location-badge {
    top: 12px !important;
    right: 12px !important;
    padding: 8px 12px 8px 34px !important; /* Más padding para icono más grande */
    font-size: 11px !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2) !important;
}

.hs-search-results .hs-location-badge::before {
    width: 16px !important;
    height: 16px !important;
    left: 10px !important;
}

/* Asegurar que el contenedor tenga posición relativa */
.hs-result {
    position: relative !important;
}

/* Responsive */
@media (max-width: 768px) {
    .hs-location-badge {
        top: 6px !important;
        right: 6px !important;
        padding: 4px 8px 4px 24px !important;
        font-size: 9px !important;
    }
    
    .hs-location-badge::before {
        width: 12px !important;
        height: 12px !important;
        left: 6px !important;
    }
    
    .hs-search-results .hs-location-badge {
        top: 8px !important;
        right: 8px !important;
        padding: 6px 10px 6px 28px !important;
        font-size: 10px !important;
    }
    
    .hs-search-results .hs-location-badge::before {
        width: 14px !important;
        height: 14px !important;
        left: 8px !important;
    }
}

@media (max-width: 480px) {
    .hs-location-badge {
        top: 4px !important;
        right: 4px !important;
        padding: 3px 6px 3px 20px !important;
        font-size: 8px !important;
    }
    
    .hs-location-badge::before {
        width: 10px !important;
        height: 10px !important;
        left: 5px !important;
    }
}