/**
 * Buscador AJAX Pantalla Completa - La Casa de los Sabores (Estilo Primor & Guthaus)
 */

:root {
    --lcdls-primary: #3F6B59;      /* Primary Verde */
    --lcdls-primary-dark: #206b47; /* Verde II */
    --lcdls-accent: #CACF8A;       /* Verde claro */
    --lcdls-gray: #54595F;         /* Gris */
    --lcdls-gray-light: #f7f9f8;
    --lcdls-border: #e2e8e5;
    --lcdls-text-dark: #1f2937;
    --lcdls-font-title: 'Josefin Sans', sans-serif;
    --lcdls-font-body: 'Lato', sans-serif;
    --lcdls-font-btn: 'Josefin Sans', sans-serif;
}

/* ===================================================
   RESET TOTAL PARA EVITAR CONFLICTOS CON ELEMENTOR
   =================================================== */
#lcdls-search-modal button,
.lcdls-header-search-wrap button {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
}

#lcdls-search-modal input,
.lcdls-header-search-wrap input {
    box-sizing: border-box;
}

/* ===================================================
   BARRA DE BÚSQUEDA EN LA CABECERA (HOME) - ESTÉTICA LIMPIA
   =================================================== */
.lcdls-header-search-wrap {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0;
}

.lcdls-header-search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #d4ded8;
    border-radius: 24px;
    padding: 7px 18px;
    height: 42px;
    width: 100% !important;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.lcdls-header-search-box:hover {
    border-color: var(--lcdls-primary);
    box-shadow: 0 2px 8px rgba(63, 107, 89, 0.1);
}

.lcdls-header-search-icon {
    color: var(--lcdls-primary);
    margin-right: 10px;
    flex-shrink: 0;
}

.lcdls-header-search-text {
    font-family: var(--lcdls-font-body);
    font-size: 0.88rem;
    color: #8c9b94;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===================================================
   OVERLAY DE PANTALLA COMPLETA (ESTILO PRIMOR)
   =================================================== */
.lcdls-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    z-index: 99999999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    font-family: var(--lcdls-font-body);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.lcdls-search-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ===================================================
   CABECERA SUPERIOR FIJA
   =================================================== */
.lcdls-top-bar {
    position: sticky;
    top: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--lcdls-border);
    z-index: 100;
    padding: 16px 24px 12px;
}

.lcdls-top-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    gap: 20px;
}

/* Contenedor del Input Central */
.lcdls-search-input-container {
    flex: 1;
    max-width: 960px;
    margin: 0 auto;
    position: relative;
}

.lcdls-search-input-pill {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid var(--lcdls-primary);
    border-radius: 30px;
    padding: 6px 18px;
    height: 46px;
    box-sizing: border-box;
}

.lcdls-main-input {
    width: 100% !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-family: var(--lcdls-font-body) !important;
    font-size: 1.05rem !important;
    color: var(--lcdls-text-dark) !important;
    padding: 0 !important;
}

.lcdls-main-input::placeholder {
    color: #9ca3af;
}

/* Botón "Borrar" estilo Primor */
.lcdls-btn-borrar {
    font-family: var(--lcdls-font-body);
    font-size: 0.85rem;
    color: var(--lcdls-gray);
    padding: 4px 10px;
    margin-right: 6px;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.lcdls-btn-borrar:hover {
    color: var(--lcdls-text-dark);
}

.lcdls-btn-search-icon {
    color: var(--lcdls-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Aspa Única de Cierre (Limpia, sin botón tocho) */
.lcdls-close-cross {
    color: var(--lcdls-gray);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.15s ease, background-color 0.15s ease;
    flex-shrink: 0;
}

.lcdls-close-cross:hover {
    color: #111827;
    background-color: var(--lcdls-gray-light);
}

/* Desplegable de Sugerencias Flotantes */
.lcdls-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--lcdls-border);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    z-index: 105;
}

.lcdls-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--lcdls-text-dark);
    transition: background 0.15s ease;
}

.lcdls-suggestion-item:hover {
    background: var(--lcdls-gray-light);
    color: var(--lcdls-primary-dark);
}

.lcdls-suggestion-icon {
    color: var(--lcdls-gray);
    font-size: 0.85rem;
}

/* Banner "¿Quisiste decir...?" */
.lcdls-did-you-mean-bar {
    max-width: 680px;
    margin: 10px auto 0;
    padding: 8px 14px;
    background: #f7f9f2;
    border: 1px solid var(--lcdls-accent);
    border-radius: 6px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lcdls-did-you-mean-label {
    color: var(--lcdls-primary-dark);
    font-weight: 500;
}

.lcdls-did-you-mean-btn {
    color: var(--lcdls-primary-dark);
    font-weight: 700;
    text-decoration: underline;
}

/* Barra de Pestañas (Pills Finas) */
.lcdls-tabs-bar {
    max-width: 960px;
    margin: 14px auto 0;
}

.lcdls-tabs-inner {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.lcdls-tabs-inner::-webkit-scrollbar {
    display: none;
}

.lcdls-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--lcdls-gray-light);
    border: 1px solid var(--lcdls-border);
    border-radius: 20px;
    font-family: var(--lcdls-font-btn) !important;
    text-transform: uppercase !important;
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.6px !important;
    color: var(--lcdls-gray);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.lcdls-filter-pill:hover {
    background: #e9eee9;
    color: var(--lcdls-primary-dark);
}

.lcdls-filter-pill.active {
    background: var(--lcdls-primary) !important;
    color: #ffffff !important;
    border-color: var(--lcdls-primary-dark) !important;
}

.lcdls-pill-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-family: var(--lcdls-font-body);
}

.lcdls-filter-pill.active .lcdls-pill-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* ===================================================
   CUERPO PRINCIPAL (SCROLL NATURAL DE PÁGINA)
   =================================================== */
.lcdls-page-content {
    flex: 1;
    background: #ffffff;
    padding-bottom: 60px;
}

.lcdls-main-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* Populares / Estado Inicial */
.lcdls-popular-block {
    padding: 20px 0;
}

.lcdls-popular-header h4 {
    margin: 0 0 14px;
    font-family: var(--lcdls-font-title);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--lcdls-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lcdls-popular-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.lcdls-tag-btn {
    background: #ffffff;
    border: 1px solid #d4ded8;
    border-radius: 6px;
    padding: 8px 14px;
    font-family: var(--lcdls-font-body);
    font-size: 0.88rem;
    color: var(--lcdls-text-dark);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.lcdls-tag-btn:hover {
    border-color: var(--lcdls-primary);
    color: var(--lcdls-primary-dark);
    background: #f7f9f8;
}

.lcdls-arrow-icon {
    color: var(--lcdls-gray);
    font-size: 0.8rem;
}

/* Sección Best Sellers en Estado Inicial */
.lcdls-bestsellers-section {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--lcdls-border);
}

/* Secciones de Resultados */
.lcdls-group {
    margin-bottom: 36px;
}

.lcdls-group-heading {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf1ee;
}

.lcdls-group-heading h3 {
    margin: 0;
    font-family: var(--lcdls-font-title) !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: var(--lcdls-text-dark);
}

/* ===================================================
   GRID DE PRODUCTOS (ESTILO PRIMOR LIMPIO)
   =================================================== */
.lcdls-product-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
}

.lcdls-p-card {
    background: #ffffff;
    border: 1px solid var(--lcdls-border);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
}

.lcdls-p-card:hover {
    border-color: var(--lcdls-primary);
    box-shadow: 0 8px 24px rgba(63, 107, 89, 0.1);
    transform: translateY(-2px);
}

.lcdls-p-thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #fafbfa;
    overflow: hidden;
}

.lcdls-p-thumb-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.lcdls-p-card:hover .lcdls-p-thumb-wrap img {
    transform: scale(1.04);
}

.lcdls-p-discount {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--lcdls-accent);
    color: var(--lcdls-primary-dark);
    font-family: var(--lcdls-font-btn);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

.lcdls-p-details {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.lcdls-p-cat {
    font-size: 0.75rem;
    color: var(--lcdls-gray);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lcdls-p-title {
    font-family: var(--lcdls-font-body) !important;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 8px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lcdls-p-price-wrap {
    margin-top: auto;
    padding-top: 6px;
}

.lcdls-p-price {
    font-family: var(--lcdls-font-title) !important;
    font-weight: 700;
    color: var(--lcdls-primary-dark);
    font-size: 1.08rem;
}

.lcdls-p-price del {
    color: #9ca3af;
    font-size: 0.82rem;
    font-weight: normal;
    margin-right: 6px;
}

.lcdls-p-price ins {
    text-decoration: none;
    color: var(--lcdls-primary-dark);
}

/* ===================================================
   GRID DE RECETAS
   =================================================== */
.lcdls-recipe-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.lcdls-r-card {
    background: #ffffff;
    border: 1px solid var(--lcdls-border);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.lcdls-r-card:hover {
    border-color: var(--lcdls-primary-dark);
    box-shadow: 0 8px 24px rgba(63, 107, 89, 0.08);
    transform: translateY(-2px);
}

.lcdls-r-thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 62%;
    background: #fafbfa;
}

.lcdls-r-thumb-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lcdls-r-time {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(32, 107, 71, 0.88);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.lcdls-r-details {
    padding: 14px;
}

.lcdls-r-title {
    font-family: var(--lcdls-font-title) !important;
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
    line-height: 1.35;
}

/* ===================================================
   GRID DE BLOG
   =================================================== */
.lcdls-blog-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.lcdls-b-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid var(--lcdls-border);
    border-radius: 8px;
    padding: 10px 14px;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.lcdls-b-item:hover {
    border-color: var(--lcdls-primary);
    background: var(--lcdls-gray-light);
    transform: translateX(3px);
}

.lcdls-b-thumb {
    width: 54px;
    height: 54px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.lcdls-b-content {
    flex: 1;
    min-width: 0;
}

.lcdls-b-title {
    font-family: var(--lcdls-font-body) !important;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lcdls-b-meta {
    font-size: 0.75rem;
    color: var(--lcdls-gray);
    display: flex;
    gap: 8px;
}

/* Loader */
.lcdls-center-loader {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.lcdls-spinner-circle {
    width: 24px;
    height: 24px;
    border: 2.5px solid rgba(63, 107, 89, 0.2);
    border-top-color: var(--lcdls-primary);
    border-radius: 50%;
    animation: lcdls-spin 0.6s linear infinite;
}

@keyframes lcdls-spin {
    to { transform: rotate(360deg); }
}

/* Estado Vacío */
.lcdls-empty-results {
    text-align: center;
    padding: 60px 10px;
}

.lcdls-empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--lcdls-text-dark);
    margin: 0 0 6px;
}

.lcdls-empty-sub {
    font-size: 0.9rem;
    color: var(--lcdls-gray);
    margin: 0;
}

/* Responsive */
@media (max-width: 680px) {
    .lcdls-product-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .lcdls-recipe-cards-grid {
        grid-template-columns: 1fr;
    }
    .lcdls-top-bar {
        padding: 12px 14px 10px;
    }
}
