.sts-search {
    --sts-accent: #FF33CC;
    position: relative;
    width: 100%;
    font-family: inherit;
    z-index: 30;
}

.sts-search *,
.sts-search *::before,
.sts-search *::after {
    box-sizing: border-box;
}

.sts-search__form {
    position: relative;
    width: 100%;
    margin: 0;
}

.sts-search__field {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 52px;
    border: 1px solid #d9d9df;
    border-radius: 999px;
    background: #fff;
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.sts-search__field:focus-within {
    border-color: var(--sts-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sts-accent) 15%, transparent);
}

.sts-search__icon {
    flex: 0 0 auto;
    margin-left: 18px;
    color: #60646c;
}

.sts-search__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 50px !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #202124 !important;
    font: inherit !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    appearance: none;
    -webkit-appearance: none;
}

.sts-search__input::-webkit-search-cancel-button {
    cursor: pointer;
}

.sts-search__input::placeholder {
    color: #777b83;
    opacity: 1;
}

.sts-search__button {
    align-self: stretch;
    flex: 0 0 auto;
    min-width: 96px;
    margin: 4px;
    padding: 0 20px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--sts-accent) !important;
    color: #fff !important;
    font: inherit !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    cursor: pointer;
    box-shadow: none !important;
    transition: transform .15s ease, filter .15s ease;
}

.sts-search__button:hover,
.sts-search__button:focus-visible {
    filter: brightness(.92);
    transform: translateY(-1px);
}

.sts-search__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 9999;
    max-height: min(570px, 70vh);
    overflow: auto;
    border: 1px solid #e3e4e8;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(23, 25, 35, .16);
}

.sts-search__panel[hidden] {
    display: none !important;
}

.sts-search__results {
    display: grid;
    gap: 0;
}

.sts-search__result {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    min-height: 94px;
    padding: 10px 14px;
    border-bottom: 1px solid #efeff2;
    color: #202124 !important;
    text-decoration: none !important;
    background: #fff;
    transition: background .15s ease;
}

.sts-search__result:hover,
.sts-search__result:focus-visible {
    background: #fff7fd;
    outline: 0;
}

.sts-search__thumb {
    width: 82px;
    height: 72px;
    overflow: hidden;
    border-radius: 11px;
    background: #f2f2f4;
}

.sts-search__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sts-search__thumb--empty {
    background: linear-gradient(135deg, #f7f7f8, #ececf0);
}

.sts-search__info {
    display: block;
    min-width: 0;
}

.sts-search__category {
    display: block;
    margin-bottom: 3px;
    overflow: hidden;
    color: #777b83;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.sts-search__title {
    display: block;
    color: #202124;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.sts-search__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}

.sts-search__price {
    color: #202124;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.sts-search__price ins {
    color: var(--sts-accent);
    text-decoration: none;
}

.sts-search__price del {
    margin-right: 4px;
    opacity: .55;
    font-size: 12px;
    font-weight: 500;
}

.sts-search__badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff0fb;
    color: #b00083;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.sts-search__view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 10px 16px;
    background: #fff;
    color: var(--sts-accent) !important;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
}

.sts-search__view-all:hover,
.sts-search__view-all:focus-visible {
    background: #fff7fd;
}

.sts-search__view-all span {
    margin-left: 5px;
    color: #737780;
    font-size: 15px;
    font-weight: 700;
}

.sts-search__status {
    padding: 18px;
    color: #62666e;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}

@media (max-width: 767px) {
    .sts-search__field {
        min-height: 48px;
    }

    .sts-search__input {
        height: 46px !important;
        font-size: 16px !important;
    }

    .sts-search__icon {
        margin-left: 14px;
    }

    .sts-search__button {
        min-width: 76px;
        padding: 0 14px !important;
        font-size: 13px !important;
    }

    .sts-search__panel {
        max-height: min(520px, 68vh);
        border-radius: 15px;
    }

    .sts-search__result {
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 11px;
        min-height: 84px;
        padding: 9px 11px;
    }

    .sts-search__thumb {
        width: 70px;
        height: 64px;
    }
}

@media (max-width: 420px) {
    .sts-search__button {
        min-width: 48px;
        width: 48px;
        padding: 0 !important;
        overflow: hidden;
        text-indent: -9999px;
        position: relative;
    }

    .sts-search__button::after {
        content: '→';
        position: absolute;
        inset: 0;
        display: grid;
        place-items: center;
        color: #fff;
        font-size: 20px;
        text-indent: 0;
    }
}

/* v1.0.2: el desplegable se porta al <body> para escapar de los contextos
   de apilado de Divi 5 y quedar siempre por encima del contenido posterior. */
.sts-search__panel--portal {
    position: fixed !important;
    z-index: 2147483000 !important;
    margin: 0 !important;
}

/* La barra sigue visible y sin recortes dentro del módulo Divi. */
.sts-search,
.et_pb_module:has(.sts-search),
.et_pb_column:has(.sts-search),
.et_pb_row:has(.sts-search),
.et_pb_section:has(.sts-search) {
    overflow: visible !important;
}

/* v1.0.7: panel realmente anclado a la ventana al portarlo al body.
   Si la barra sale del viewport, JS cierra el panel para que no quede flotando. */
.sts-search__panel--portal {
    position: fixed;
    z-index: 2147483000;
}

.sts-search__footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    border-top: 1px solid #efeff2;
    background: #fff;
}

.sts-search__footer .sts-search__view-all {
    border-top: 0;
}

.sts-search__close {
    min-width: 170px;
    padding: 10px 18px !important;
    border: 0 !important;
    border-left: 1px solid #efeff2 !important;
    background: #fff !important;
    color: #62666e !important;
    font: inherit !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    cursor: pointer;
}

.sts-search__close:hover,
.sts-search__close:focus-visible {
    background: #fff7fd !important;
    color: var(--sts-accent) !important;
    outline: 0;
}

.sts-search__close span {
    margin-left: 4px;
    font-size: 18px;
    line-height: 1;
}

@media (max-width: 600px) {
    .sts-search__footer {
        grid-template-columns: 1fr;
    }

    .sts-search__close {
        min-width: 0;
        min-height: 44px;
        border-top: 1px solid #efeff2 !important;
        border-left: 0 !important;
    }
}


/* v1.0.9: bloque comercial de descubrimiento cuando hay pocos resultados. */
.sts-search__suggestions {
    padding: 12px 12px 14px;
    border-top: 1px solid #efeff2;
    background: #fffafd;
}

.sts-search__suggestions-title {
    margin: 0 0 10px;
    color: #202124;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.25;
}

.sts-search__suggestions-title span {
    color: var(--sts-accent);
    font-size: 16px;
}

.sts-search__suggestions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.sts-search__suggestion {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ececf0;
    border-radius: 12px;
    background: #fff;
    color: #202124 !important;
    text-decoration: none !important;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.sts-search__suggestion:hover,
.sts-search__suggestion:focus-visible {
    border-color: color-mix(in srgb, var(--sts-accent) 40%, #ececf0);
    box-shadow: 0 8px 18px rgba(23, 25, 35, .09);
    transform: translateY(-1px);
    outline: 0;
}

.sts-search__suggestion-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f2f2f4;
}

.sts-search__suggestion-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sts-search__suggestion-title {
    display: -webkit-box;
    min-height: 38px;
    padding: 8px 9px 2px;
    overflow: hidden;
    color: #202124;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.sts-search__suggestion-price {
    display: block;
    padding: 4px 9px 9px;
    color: var(--sts-accent);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
}

.sts-search__suggestion-price ins {
    color: var(--sts-accent);
    text-decoration: none;
}

.sts-search__suggestion-price del {
    margin-right: 3px;
    opacity: .5;
    font-size: 10px;
    font-weight: 500;
}

@media (max-width: 520px) {
    .sts-search__suggestions-grid {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 3px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .sts-search__suggestion {
        flex: 0 0 138px;
        scroll-snap-align: start;
    }
}


/* v1.0.10: bloque comercial para la página completa de resultados Divi 5. */
.sts-results-recommendations {
    --sts-accent: #FF33CC;
    width: 100%;
    margin: 28px 0;
    font-family: inherit;
}

.sts-results-recommendations *,
.sts-results-recommendations *::before,
.sts-results-recommendations *::after {
    box-sizing: border-box;
}

.sts-results-recommendations__head {
    margin-bottom: 16px;
}

.sts-results-recommendations__title {
    margin: 0 0 4px !important;
    color: #202124;
    font-size: clamp(22px, 2.2vw, 30px) !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
}

.sts-results-recommendations__intro {
    margin: 0 !important;
    color: #666a72;
    font-size: 14px;
    line-height: 1.4;
}

.sts-results-recommendations__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.sts-results-recommendations__card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ececf0;
    border-radius: 16px;
    background: #fff;
    color: #202124 !important;
    text-decoration: none !important;
    box-shadow: 0 6px 20px rgba(23, 25, 35, .06);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.sts-results-recommendations__card:hover,
.sts-results-recommendations__card:focus-visible {
    border-color: color-mix(in srgb, var(--sts-accent) 42%, #ececf0);
    box-shadow: 0 12px 30px rgba(23, 25, 35, .11);
    transform: translateY(-2px);
    outline: 0;
}

.sts-results-recommendations__image {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f4f4f6;
}

.sts-results-recommendations__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sts-results-recommendations__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--sts-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.sts-results-recommendations__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 13px 14px 15px;
}

.sts-results-recommendations__category {
    margin-bottom: 4px;
    color: #777b83;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
}

.sts-results-recommendations__name {
    display: -webkit-box;
    overflow: hidden;
    color: #202124;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.sts-results-recommendations__price {
    margin-top: 9px;
    color: var(--sts-accent);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.25;
}

.sts-results-recommendations__price ins {
    color: var(--sts-accent);
    text-decoration: none;
}

.sts-results-recommendations__price del {
    margin-right: 4px;
    color: #777b83;
    opacity: .65;
    font-size: 12px;
    font-weight: 500;
}

.sts-results-recommendations__cta {
    display: inline-flex;
    align-self: flex-start;
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff0fb;
    color: var(--sts-accent);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

@media (max-width: 980px) {
    .sts-results-recommendations__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .sts-results-recommendations__grid {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        padding: 0 1px 6px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .sts-results-recommendations__card {
        flex: 0 0 74%;
        scroll-snap-align: start;
    }
}

/* Resultados Divi: pestañas Tu búsqueda / Te proponemos */
.sts-result-tabs {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    margin: 10px 0 22px;
    padding: 5px;
    border: 1px solid #e8e8ee;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 7px 24px rgba(23, 25, 35, .06);
}

.sts-result-tabs__button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #4f5259;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 850;
    line-height: 1;
    padding: 12px 22px;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.sts-result-tabs__button:hover,
.sts-result-tabs__button:focus-visible {
    color: var(--sts-accent);
    outline: 0;
}

.sts-result-tabs__button.is-active {
    background: var(--sts-accent);
    color: #fff;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--sts-accent) 25%, transparent);
}

.sts-result-tabs__button:active {
    transform: translateY(1px);
}

@media (max-width: 520px) {
    .sts-result-tabs {
        display: flex;
        width: 100%;
    }

    .sts-result-tabs__button {
        flex: 1 1 50%;
        padding-inline: 12px;
        font-size: 14px;
        text-align: center;
    }
}
