/**
 * FiboSearch en el header — estilo solaris, sin botón submit.
 */

.header-search-wrap .dgwt-wcas-search-wrapp {
    width: 100%;
    min-width: 0;
}

.header-search-wrap .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp {
    position: relative;
    display: block;
    width: 100%;
    padding: 0 !important;
    margin: 0;
    background: var(--scp-white, #fff) !important;
    border: 1.5px solid var(--scp-purple-light, #9333ea) !important;
    border-radius: 50px !important;
    overflow: visible;
    box-shadow: none !important;
}

.header-search-wrap .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp:focus-within {
    border-color: var(--scp-purple, #6b21a8) !important;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.2) !important;
}

.header-search-wrap .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 38px 0 48px !important;
    border: none !important;
    border-radius: 50px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--scp-text, #222) !important;
    font-size: 0.95rem !important;
    line-height: normal !important;
    font-family: inherit !important;
    font-style: normal !important;
    -webkit-appearance: none;
}

.header-search-wrap .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input:focus,
.header-search-wrap .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input:hover {
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.header-search-wrap .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input::placeholder {
    color: #999 !important;
    font-style: normal !important;
}

.header-search-wrap .dgwt-wcas-search-submit {
    display: none !important;
}

/* Lupa independiente (modo no-submit) */
.header-search-wrap .dgwt-wcas-no-submit .dgwt-wcas-ico-magnifier,
.header-search-wrap .dgwt-wcas-ico-magnifier-handler {
    left: 16px !important;
    right: auto !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%);
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    margin: 0 !important;
    opacity: 1 !important;
    fill: var(--scp-purple-light, #9333ea) !important;
    pointer-events: none;
    z-index: 2;
}

.header-search-wrap .dgwt-wcas-no-submit .dgwt-wcas-ico-magnifier path {
    fill: var(--scp-purple-light, #9333ea) !important;
}

.header-search-wrap .dgwt-wcas-preloader {
    right: 12px !important;
    width: 32px !important;
    z-index: 1;
    background-position: center;
}

/* Panel de sugerencias / autocompletado */
.header-search-wrap .dgwt-wcas-suggestions-wrapp {
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 6px 0 !important;
    border: 1px solid var(--scp-border, #e0e0e0) !important;
    border-top: 1px solid var(--scp-border, #e0e0e0) !important;
    border-radius: var(--scp-box-radius, 14px) !important;
    background: var(--scp-white, #fff) !important;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(107, 33, 168, 0.08) !important;
    overflow: hidden;
    z-index: 400;
}

.header-search-wrap .dgwt-wcas-suggestion {
    padding: 10px 16px !important;
    font-size: 0.9rem !important;
    line-height: 1.35 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    transition: background-color 0.15s ease !important;
}

.header-search-wrap .dgwt-wcas-suggestion:last-child,
.header-search-wrap .dgwt-wcas-suggestion.dgwt-wcas-suggestion-no-border-bottom {
    border-bottom: none !important;
}

.header-search-wrap .dgwt-wcas-suggestion:hover,
.header-search-wrap .dgwt-wcas-suggestion.dgwt-wcas-suggestion-selected {
    background: var(--scp-purple-faint, rgba(107, 33, 168, 0.12)) !important;
}

.header-search-wrap .dgwt-wcas-suggestion strong {
    color: var(--scp-purple, #6b21a8);
    font-weight: 600;
}

.header-search-wrap .dgwt-wcas-has-img .dgwt-wcas-suggestion.dgwt-wcas-suggestion-product {
    min-height: 64px;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.header-search-wrap .dgwt-wcas-si {
    width: 52px;
    flex-shrink: 0;
}

.header-search-wrap .dgwt-wcas-si img {
    border-radius: 8px !important;
    border-color: var(--scp-border, #e0e0e0) !important;
    padding: 3px !important;
}

.header-search-wrap .dgwt-wcas-content-wrapp {
    padding-left: 12px !important;
    gap: 8px;
}

.header-search-wrap .dgwt-wcas-st {
    font-size: 0.9rem;
    color: var(--scp-text, #222);
}

.header-search-wrap .dgwt-wcas-sp {
    font-size: 0.85rem;
    color: var(--scp-purple-light, #9333ea);
    font-weight: 600;
}

.header-search-wrap .dgwt-wcas-suggestion.dgwt-wcas-nores,
.header-search-wrap .dgwt-wcas-suggestion-nores {
    padding: 16px 18px !important;
    opacity: 1 !important;
    cursor: default !important;
    color: var(--scp-text-muted, #666) !important;
    font-size: 0.92rem !important;
    text-align: center;
}

.header-search-wrap .dgwt-wcas-suggestion-nores p {
    font-size: 0.95rem !important;
    margin: 0 !important;
}

.header-search-wrap a.dgwt-wcas-details-more-products {
    padding: 12px 16px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
    color: var(--scp-purple, #6b21a8) !important;
    font-size: 0.8rem !important;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-search-wrap a.dgwt-wcas-details-more-products:hover {
    background: var(--scp-purple-faint, rgba(107, 33, 168, 0.12));
    text-decoration: none !important;
}

/* Overrides del tema pirx de FiboSearch en el header */
body.dgwt-wcas-open-pirx .header-search-wrap .dgwt-wcas-suggestions-wrapp,
body.dgwt-wcas-open-pirx .header-search-wrap .dgwt-wcas-open .dgwt-wcas-suggestions-wrapp {
    border-color: var(--scp-border, #e0e0e0) !important;
    border-radius: var(--scp-box-radius, 14px) !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}

body.dgwt-wcas-open-pirx .header-search-wrap .dgwt-wcas-suggestions-wrapp > .dgwt-wcas-suggestion {
    padding-left: 16px !important;
    padding-right: 16px !important;
    border-right: none !important;
}

/* Respaldo si el admin usa pirx en ajustes globales */
.header-search-wrap .dgwt-wcas-style-pirx .dgwt-wcas-sf-wrapp {
    padding: 0 !important;
    background: var(--scp-white, #fff) !important;
    border: 1.5px solid var(--scp-purple-light, #9333ea) !important;
    border-radius: 50px !important;
}

.header-search-wrap .dgwt-wcas-style-pirx .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.header-search-wrap .dgwt-wcas-style-pirx .dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit {
    display: none !important;
}

/* Mobile: ocultar overlay nativo de FiboSearch (usamos toggle propio) */
@media (max-width: 768px) {
    .header-search-wrap .dgwt-wcas-enable-mobile-form,
    .header-search-wrap .dgwt-wcas-ico-magnifier-handler,
    .header-search-wrap .dgwt-wcas-icon-handler {
        display: none !important;
    }

    .header-top.is-search-open .header-search-wrap .dgwt-wcas-search-wrapp,
    .header-top.is-search-open .header-search-wrap .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp {
        width: 100% !important;
        max-width: 100% !important;
    }

    .header-top.is-search-open .header-search-wrap .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
        width: 100% !important;
        box-sizing: border-box !important;
    }
}
