/* Buscador de regalos. El diseño de la tarjeta de producto y las primitivas
   de interacción (glow wrap, "pensando", chips, animaciones de entrada)
   viven en product-card.css — compartidas con el buscador general y la
   vidriera del home. */

#abot-gift-finder {
    max-width: 760px;
    margin: 0 auto;
    text-align: left;
}

#abot-gift-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Campo principal ─────────────────────────────────────────────────── */
.abot-gift-textarea-wrap {
    display: flex;
    align-items: flex-start;
}
.abot-gift-textarea-wrap .abot-glow-icon { padding: 20px 0 0 20px; }

#abot-gift-form textarea {
    flex: 1;
    min-width: 0;
    resize: none;
    min-height: 88px;
    padding: 18px 20px 18px 14px;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    line-height: 1.5;
    font-family: inherit;
    color: #1a1a1a;
    background: transparent;
}
#abot-gift-form textarea::placeholder { color: #6b6b6b; }
#abot-gift-form textarea:focus { outline: none; }
.abot-gift-textarea-wrap:focus-within { box-shadow: 0 0 0 3px rgba(52, 131, 250, .25), 0 4px 20px rgba(0, 0, 0, .08); }

/* ── Presupuesto + botón ─────────────────────────────────────────────── */
.abot-gift-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 16px;
}

.abot-gift-budget {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}
.abot-gift-budget legend {
    padding: 0;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}
.abot-gift-budget legend span { font-weight: 400; color: #4d4d4d; }

.abot-gift-budget-fields {
    display: flex;
    align-items: center;
    gap: 8px;
}
.abot-gift-budget-sep { color: #4d4d4d; }

.abot-gift-money {
    position: relative;
    display: block;
}
.abot-gift-money-sign {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #4d4d4d;
    pointer-events: none;
}

#abot-gift-form .abot-money-input {
    width: 160px;
    height: 48px;
    padding: 0 14px 0 28px;
    border: 1px solid rgba(26, 26, 26, .14);
    border-radius: 12px;
    background: #fff;
    font-size: 16px;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    transition: border-color .2s ease, box-shadow .2s ease;
}
#abot-gift-form .abot-money-input::placeholder { color: #6b6b6b; }
#abot-gift-form .abot-money-input:focus {
    outline: none;
    border-color: #3483fa;
    box-shadow: 0 0 0 3px rgba(52, 131, 250, .18);
}

#abot-gift-form button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    padding: 0 28px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(26, 26, 26, .18);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
#abot-gift-form button[type="submit"] svg { color: #ffe600; }
#abot-gift-form button[type="submit"]:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(26, 26, 26, .24);
}
#abot-gift-form button[type="submit"]:focus-visible { outline: 3px solid rgba(52, 131, 250, .5); outline-offset: 3px; }
#abot-gift-form button[type="submit"]:disabled { cursor: progress; opacity: .75; }
#abot-gift-form button[type="submit"].is-busy svg { animation: abot-gift-spin 1.2s linear infinite; }
@keyframes abot-gift-spin { to { transform: rotate(360deg); } }

/* Ejemplos: en mobile una sola fila deslizable en vez de 4 renglones */
.abot-gift-suggestions .abot-suggestion-chip { white-space: nowrap; }
@media (max-width: 600px) {
    .abot-gift-suggestions {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 -16px;
        padding: 0 16px 4px;
        scrollbar-width: none;
    }
    .abot-gift-suggestions::-webkit-scrollbar { display: none; }
    .abot-gift-suggestions > * { flex: 0 0 auto; }
}

@media (max-width: 600px) {
    .abot-gift-budget,
    .abot-gift-filters #abot-gift-submit { width: 100%; }
    .abot-gift-budget-fields .abot-gift-money { flex: 1; }
    #abot-gift-form .abot-money-input { width: 100%; }
}

/* ── Resultados: sección propia, a ancho completo ─────────────────────── */
.abot-gift-results-section,
#abot-gift-results.ef-gift-results-section {
    background: #fff;
    border-bottom: 1px solid #efefef;
    scroll-margin-top: 140px;
}
.abot-gift-results-inner {
    max-width: var(--ef-max-width, 1180px);
    margin: 0 auto;
    padding: 40px 24px 48px;
}

.abot-gift-results-head { margin-bottom: 24px; }
.abot-gift-results-eyebrow {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #2968c8;
}
.abot-gift-results-title {
    margin: 0 0 8px;
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 800;
    line-height: 1.25;
    color: #1a1a1a;
    overflow-wrap: anywhere;
}
.abot-gift-results-title span { font-weight: 500; color: #4d4d4d; font-size: .75em; }

.abot-gift-status {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 22px;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #2968c8;
}
.abot-gift-status:empty { display: none; }

/* ── Grupo = una idea de la IA + sus productos ────────────────────────── */
.abot-gift-groups {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.abot-gift-group {
    animation: abot-pop-in .35s cubic-bezier(.2, .8, .3, 1.3) both;
}
.abot-gift-group-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.abot-gift-group-num {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: #ffe600;
    color: #1a1a1a;
    font-weight: 800;
    font-size: 15px;
}
.abot-gift-group.is-skeleton .abot-gift-group-num { background: #eee; }
.abot-gift-group-text { flex: 1; min-width: 0; }
.abot-gift-group-text h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
}
.abot-gift-group-text p {
    margin: 2px 0 0;
    font-size: 14px;
    color: #4d4d4d;
}
.abot-gift-group-text p::first-letter { text-transform: uppercase; }

.abot-gift-group-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #2968c8;
    text-decoration: none;
    white-space: nowrap;
}
.abot-gift-group-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 4 tarjetas por idea: grilla en desktop, carrusel deslizable en mobile */
.abot-gift-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 236px));
    gap: 16px;
}
.abot-gift-group.is-empty .abot-gift-track { display: block; }

.abot-gift-group-empty {
    margin: 0;
    padding: 16px 20px;
    border-radius: 14px;
    background: #f7f7f8;
    font-size: 14px;
    color: #4d4d4d;
}
.abot-gift-group-empty a { color: #2968c8; font-weight: 600; }

@media (max-width: 900px) {
    .abot-gift-track {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        margin: 0 -24px;
        padding: 0 24px 6px;
        scrollbar-width: none;
    }
    .abot-gift-track::-webkit-scrollbar { display: none; }
    .abot-gift-track > * {
        flex: 0 0 min(44%, 220px);
        scroll-snap-align: start;
    }
    .abot-gift-group-link { display: none; }
}
@media (max-width: 600px) {
    .abot-gift-results-inner { padding: 28px 16px 36px; }
    .abot-gift-track { margin: 0 -16px; padding: 0 16px 6px; }
    .abot-gift-track > * { flex-basis: 62%; }
    .abot-gift-group-text h3 { font-size: 17px; }
}

/* ── "Ver más ideas", errores y avisos ────────────────────────────────── */
.abot-gift-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 36px;
}
.abot-gift-more[hidden] { display: none; }
.abot-gift-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 26px;
    background: #fff;
    color: #2968c8;
    border: 1.5px solid #3483fa;
    border-radius: 999px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.abot-gift-more-btn:hover:not(:disabled) {
    background: rgba(52, 131, 250, .07);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 131, 250, .18);
}
.abot-gift-more-btn:focus-visible { outline: 3px solid rgba(52, 131, 250, .35); outline-offset: 2px; }
.abot-gift-more-btn:disabled { opacity: .6; cursor: default; }
.abot-gift-more-note {
    margin: 0;
    font-size: 14px;
    color: #4d4d4d;
    text-align: center;
}

.abot-gift-error {
    margin: 0;
    padding: 20px;
    border-radius: 14px;
    background: #f7f7f8;
    text-align: center;
    color: #4d4d4d;
    font-size: 15px;
}
.abot-gift-retry {
    margin-left: 6px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid #3483fa;
    border-radius: 999px;
    background: #fff;
    color: #2968c8;
    font: 600 14px/1 inherit;
    font-family: inherit;
    cursor: pointer;
}

/* Límite diario de búsquedas con IA — mensaje amable, no un error */
.abot-gift-limit {
    max-width: 560px;
    margin: 8px auto 0;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #ececec;
    border-left: 4px solid #ffe600;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
    color: #1a1a1a;
    font-size: 15px;
    line-height: 1.6;
}
.abot-gift-limit a {
    color: #2968c8;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.abot-gift-remaining {
    margin: 16px 0 0;
    text-align: center;
    font-size: 14px;
    color: #4d4d4d;
}

@media (prefers-reduced-motion: reduce) {
    .abot-gift-group,
    #abot-gift-form button[type="submit"].is-busy svg { animation: none; }
}
