/* Simple WooCommerce Search Styles */

/* Contenedor principal */
.simple-woo-search-container {
    font-family: "Montserrat", sans-serif;
    position: relative;
    margin: 0 auto 0px !important;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* Formulario de búsqueda */
.simple-woo-search-form {
    width: 100%;
}

/* Contenedor de input */
.simple-woo-search-input-container {
    display: flex;
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: 48px;
    overflow: hidden;
}

/* Input de búsqueda */
.simple-woo-search-input {
    flex: 1;
    height: 48px;
    padding: 0 15px;
    border: 1px solid #eaeaea;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 14px;
    font-weight: 400;
    font-family: "Montserrat", sans-serif;
    width: calc(100% - 36px);
    box-sizing: border-box;
    outline: none;
}

.simple-woo-search-input::placeholder {
    color: #999;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

/* Botón de búsqueda */
.simple-woo-search-button {
    width: 36px;
    height: 48px;
    background-color: white;
    color: #999;
    border: 1px solid #eaeaea;
    border-left: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.simple-woo-search-button:hover {
    color: #666;
}

/* Resultados de búsqueda - CONTENEDOR AJUSTADO */
.simple-woo-search-results {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
    display: none;
}

/* Mensaje de carga con spinner */
.simple-woo-search-loading {
    padding: 20px 15px;
    text-align: center;
    font-size: 13px;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Spinner mejorado - versión celeste circular */
.simple-woo-search-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    margin-bottom: 10px;
    border: 3px solid rgba(50, 170, 246, 0.2);
    border-radius: 50%;
    border-top-color: #32aaf6;
    animation: simple-woo-search-spin 0.8s linear infinite;
}

@keyframes simple-woo-search-spin {
    to { transform: rotate(360deg); }
}

/* Cuadrícula de productos - FORMATO LISTA COMPACTO */
.simple-woo-search-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

/* Producto individual - VERSIÓN LISTA COMPACTA */
.simple-woo-search-product {
    overflow: hidden;
    background-color: white;
    position: relative;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.simple-woo-search-product:last-child {
    border-bottom: none;
}

.simple-woo-search-product:hover {
    background-color: #f9f9f9;
}

/* Enlace del producto - FORMATO LISTA COMPACTO */
.simple-woo-search-product-link {
    display: flex;
    text-decoration: none;
    color: inherit;
    align-items: center;
    padding: 10px 12px;
}

/* Imagen del producto - CUADRADA 1:1 */
.simple-woo-search-product-image {
    width: 60px;
    height: 60px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f7f7f7;
    flex-shrink: 0;
    margin: 0 10px 0 0;
}

/* Mejorar la carga de imágenes */
.simple-woo-search-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Información del producto - FORMATO LISTA COMPACTO */
.simple-woo-search-product-info {
    padding: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* Para que el texto pueda truncarse correctamente */
}

/* Título del producto - MÁS PEQUEÑO */
.simple-woo-search-product-title {
    font-size: 13px;
    font-weight: 500;
    margin: 0 0 4px;
    color: #333;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding-right: 45px; /* Espacio para la etiqueta de oferta */
}

/* SKU del producto - MÁS COMPACTO */
.simple-woo-search-product-sku {
    display: block;
    font-size: 10px;
    color: #999;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Precio del producto - AJUSTADO */
.simple-woo-search-product-price {
    font-weight: 600;
    color: #32aaf6;
    font-size: 14px;
}

.simple-woo-search-product-price del {
    font-weight: normal;
    color: #999;
    font-size: 12px;
    margin-right: 5px;
}

.simple-woo-search-product-price ins {
    text-decoration: none;
}

/* Etiqueta de oferta - REPOSICIONADA PARA NO TAPAR TÍTULO */
.simple-woo-search-sale-badge {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background-color: #32aaf6;
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    z-index: 2;
    display: none;
}

/* Ver todos los resultados - ESTILO ACTUALIZADO */
.simple-woo-search-view-all {
    display: block;
    text-align: center;
    padding: 12px;
    background-color: #f5f5f5;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    border-top: 1px solid #eee;
    font-size: 12px;
    transition: all 0.2s;
}

.simple-woo-search-view-all:hover {
    background-color: #efefef;
    color: #333;
}

/* Responsividad */
@media (max-width: 767px) {
    .simple-woo-search-product-title {
        font-size: 12px;
    }
}

@media (max-width: 479px) {
    .simple-woo-search-product-image {
        width: 50px;
        height: 50px;
    }
}