/**
 * Dekorum Search — Input siempre visible en header
 * Desktop: campo permanente + botón lupa
 * Mobile: campo permanente compacto
 */

.dk-search-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Ocultar el toggle — ya no se necesita, el input siempre está visible */
.dk-search-toggle {
    display: none;
}

/* Panel siempre visible */
.dk-search-panel {
    display: block;
    position: relative;
}

.dk-search-control {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    overflow: visible;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 380px;
}

.dk-search-control:focus-within {
    border-color: #E73D1E !important;
    box-shadow: 0 0 0 2px rgba(231,61,30,0.1);
}

#dk-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #152433;
    outline: none;
    font-family: inherit;
    padding: 9px 12px;
    width: 100%;
    box-shadow: none;
    border-radius: 8px 0 0 8px;
}

#dk-search-input::placeholder {
    color: #aaa;
}

/* Botón submit dentro del input — override reset.css de Hello Elementor */
.dk-search-control .dk-search-submit,
.dk-search-control button.dk-search-submit,
button.dk-search-submit {
    flex-shrink: 0;
    background: #fff !important;
    border: none !important;
    border-left: 1.5px solid #ddd !important;
    border-radius: 0 6px 6px 0 !important;
    cursor: pointer;
    color: #E73D1E !important;
    padding: 0 12px !important;
    height: 100%;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    box-shadow: none !important;
    outline: none;
}

/* Activo: cuando el input tiene foco */
.dk-search-control:focus-within .dk-search-submit,
.dk-search-control:focus-within button.dk-search-submit {
    background: #E73D1E !important;
    color: #fff !important;
    border-left-color: #E73D1E !important;
}

.dk-search-control .dk-search-submit:hover,
.dk-search-control button.dk-search-submit:hover {
    background: #E73D1E !important;
    color: #fff !important;
    border-left-color: #E73D1E !important;
}

/* Ocultar el botón X — no hace falta con input siempre visible */
.dk-search-close {
    display: none;
}

/* =====================================================
   SUGERENCIAS AUTOCOMPLETE
   ===================================================== */
.dk-autocomplete-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 460px;
    overflow-y: auto;
    z-index: 9999;
    min-width: 320px;
}

.dk-suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: #152433;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.dk-suggestion:last-of-type {
    border-bottom: none;
}

.dk-suggestion:hover {
    background: #f8f8f8;
}

.dk-suggestion-img {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.dk-suggestion-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dk-suggestion-info {
    flex: 1;
    min-width: 0;
}

.dk-suggestion-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #152433;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dk-suggestion-desc {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dk-suggestion-empty {
    padding: 18px 14px;
    color: #999;
    text-align: center;
    font-size: 14px;
}

.dk-suggestion-all {
    display: block;
    padding: 11px 14px;
    text-align: center;
    font-size: 13px;
    color: #E73D1E;
    font-weight: 600;
    text-decoration: none;
    background: #fafafa;
    border-top: 1px solid #eee;
    transition: background 0.15s;
}

.dk-suggestion-all:hover {
    background: #f0f0f0;
    color: #E73D1E;
}

/* =====================================================
   RESPONSIVE — buscador SIEMPRE abierto (sin lupa-toggle)
   ===================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .dk-search-control {
        width: 300px;
    }
}

/* Móvil (≤768px): el buscador queda abierto e inline, no detrás de la lupa */
@media (max-width: 768px) {

    /* Nunca mostramos el toggle: el campo está siempre visible */
    .dk-search-toggle { display: none !important; }

    /* El wrapper ocupa el ancho disponible en su contenedor */
    .dk-search-wrapper {
        position: relative;
        display: flex;
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }

    /* Panel siempre visible (anula el ocultarlo tras el toggle) */
    .dk-search-wrapper .dk-search-panel,
    .dk-search-wrapper.open .dk-search-panel {
        display: block;
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        background: transparent;
        padding: 0;
        box-shadow: none;
    }

    .dk-search-control {
        width: 100%;
        box-sizing: border-box;
        border-radius: 6px !important;
    }

    #dk-search-input {
        font-size: 14px;
        padding: 9px 10px;
    }

    /* Sugerencias: desplegable bajo el input, casi a pantalla completa */
    .dk-autocomplete-suggestions {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        min-width: 0;
        max-height: 60vh;
        border-radius: 8px;
    }

    /* Logo un poco más pequeño en móvil (widget Site Logo de Elementor) */
    .elementor-widget-theme-site-logo img {
        max-width: 130px !important;
        height: auto !important;
    }
}