.spb-product-blocks {
    --spb-surface: #ffffff;
    --spb-text: #1a1f26;
    --spb-muted: #61656c;
    --spb-line: #e7e8eb;
    --spb-line-strong: #d9dadd;
    --spb-radius: 12px;
    --spb-shadow-soft: 0 6px 18px rgba(18, 24, 33, .06);
    --spb-brand-yellow: #ffcc4d;
    --spb-brand-red: #d11b2e;
    --spb-brand-red-dark: #7a0f1b;
    --spb-brand-teal: #0f766e;
    margin: 20px 0 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Item acordeón (no usa <details>) --- */

.spb-pb {
    border: 1px solid var(--spb-line);
    border-radius: var(--spb-radius);
    background: var(--spb-surface);
    box-shadow: var(--spb-shadow-soft);
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.spb-pb.is-open {
    border-color: var(--spb-line-strong);
    box-shadow: 0 10px 28px rgba(18, 24, 33, .09);
}

.spb-pb__summary {
    all: unset;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--spb-text);
    background: var(--spb-pb-header-bg, transparent);
    transition: filter .18s ease, background-color .18s ease;
}

.spb-pb__summary:hover {
    filter: brightness(0.97);
}

/* Sin color custom en header: usar un gris muy suave al hacer hover. */
.spb-pb:not([style*="--spb-pb-header-bg"]) .spb-pb__summary:hover {
    background: #fafbfc;
    filter: none;
}

.spb-pb__summary:focus-visible {
    outline: 2px solid #1f3a8a33;
    outline-offset: -2px;
}

.spb-pb__summary-label {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.spb-pb__summary-title {
    font-weight: 700;
    line-height: 1.25;
}

/* Hint resumido (p.ej. "Faltan 12,00 € para envío gratis") */
.spb-pb__hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.25;
}

.spb-pb__hint-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    flex: 0 0 7px;
}

.spb-pb__hint--shipping.is-ok {
    color: #15803d;
}

.spb-pb__hint--shipping.is-warn {
    color: #b45309;
}

.spb-pb__hint--promo {
    color: var(--spb-brand-red);
    font-weight: 700;
}

.spb-pb.is-open .spb-pb__hint {
    opacity: .45;
}

.spb-pb__summary-icon {
    position: relative;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #f2f4f7;
    transition: background-color .2s ease, transform .2s ease;
}

.spb-pb__summary-icon::before,
.spb-pb__summary-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: #3c434a;
    border-radius: 2px;
}

.spb-pb__summary-icon::before {
    width: 11px;
    height: 2px;
    transform: translate(-50%, -50%);
}

.spb-pb__summary-icon::after {
    width: 2px;
    height: 11px;
    transform: translate(-50%, -50%);
    transition: transform .2s ease;
}

.spb-pb.is-open .spb-pb__summary-icon {
    background: #e6edf5;
}

.spb-pb.is-open .spb-pb__summary-icon::after {
    transform: translate(-50%, -50%) scaleY(0);
}

/* --- Contenido animado por max-height --- */

.spb-pb__content {
    overflow: hidden;
    max-height: 0;
    transition: max-height .32s ease;
    will-change: max-height;
    background: var(--spb-pb-content-bg, transparent);
}

.spb-pb.is-open .spb-pb__content {
    max-height: 4000px;
}

.spb-pb__inner {
    padding: 2px 16px 16px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--spb-text);
}

.spb-pb__inner > *:first-child {
    margin-top: 0;
}

.spb-pb__inner > *:last-child {
    margin-bottom: 0;
}

/* --- Modo compacto --- */

.spb-product-blocks--compact {
    gap: 8px;
}

.spb-product-blocks--compact .spb-pb__summary {
    padding: 11px 13px;
    font-size: 14px;
}

.spb-product-blocks--compact .spb-pb__inner {
    padding: 2px 13px 13px;
    font-size: 13px;
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .spb-product-blocks {
        margin-top: 14px;
    }

    .spb-pb__summary {
        padding: 12px 14px;
        font-size: 14.5px;
    }

    .spb-pb__inner {
        padding: 2px 14px 14px;
        font-size: 13.5px;
    }
}

/* ===========================================
   Bloques predefinidos
   =========================================== */

/* Guía de tallas */
.spb-size-guide {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spb-size-guide__switch {
    display: inline-flex;
    align-self: flex-start;
    gap: 0;
    background: #f2f4f7;
    padding: 3px;
    border-radius: 999px;
}

.spb-size-guide__btn {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 6px 14px;
    font-weight: 600;
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--spb-muted);
    transition: background-color .18s ease, color .18s ease;
}

.spb-size-guide__btn:hover {
    color: var(--spb-text);
}

.spb-size-guide__btn.is-active {
    background: var(--spb-text);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}

.spb-size-guide__image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid var(--spb-line);
}

.spb-size-guide__image.is-hidden {
    display: none;
}

/* Envío gratis: contenido plano dentro del acordeón, sin doble caja. */
.spb-freeinfo {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spb-freeinfo__row {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 8px;
    align-items: center;
}

.spb-freeinfo__head {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    color: #b45309;
}

.spb-freeinfo.is-ok .spb-freeinfo__head {
    color: #15803d;
}

.spb-freeinfo__sub {
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 6px;
    color: var(--spb-muted);
    font-size: 12.5px;
}

.spb-freeinfo__progress {
    height: 6px;
    width: 100%;
    background: rgba(0, 0, 0, .06);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 2px;
}

.spb-freeinfo__fill {
    height: 100%;
    background: #d97706;
    transition: width .3s ease;
}

.spb-freeinfo.is-ok .spb-freeinfo__fill {
    background: #16a34a;
}

/* Promoción: layout minimalista, sin tarjeta con gradiente. */
.spb-promo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.spb-promo__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(209, 27, 46, .08);
    color: var(--spb-brand-red);
    border-radius: 999px;
    font-weight: 700;
    padding: 4px 10px;
    font-size: 11.5px;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.spb-promo__title {
    font-weight: 700;
    font-size: 15px;
    color: var(--spb-text);
    line-height: 1.35;
    margin: 0;
}

.spb-promo__timer {
    font-size: 18px;
    font-weight: 800;
    color: var(--spb-brand-red);
    letter-spacing: 1.5px;
    font-variant-numeric: tabular-nums;
}

.spb-promo__footer {
    font-size: 12px;
    color: var(--spb-muted);
}

/* CO2 Free: contenido fluido sin envoltura con borde/fondo propios. */
.spb-co2free {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spb-co2free__title {
    font-weight: 700;
    font-size: 15px;
    color: var(--spb-text);
    line-height: 1.3;
}

.spb-co2free__subtitle {
    margin: -4px 0 0;
    color: var(--spb-muted);
    font-size: 13.5px;
    line-height: 1.45;
}

.spb-co2free__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.spb-co2free__chips li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 118, 110, .08);
    border-radius: 999px;
    padding: 4px 10px 4px 8px;
    color: #0b524c;
    font-size: 12px;
    font-weight: 600;
}

.spb-co2free__chip-icon {
    font-size: 13px;
    line-height: 1;
}

.spb-co2free__bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.spb-co2free__bullets li {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 10px;
    align-items: flex-start;
    font-size: 13.5px;
    color: var(--spb-text);
    line-height: 1.5;
}

.spb-co2free__bullet-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 13px;
    line-height: 1;
}

.spb-co2free__prose {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
    margin-top: 2px;
    border-top: 1px solid rgba(0, 0, 0, .07);
}

.spb-co2free__prose p {
    margin: 0;
    color: var(--spb-text);
    font-size: 13.5px;
    line-height: 1.55;
}

.spb-product-blocks--compact .spb-co2free {
    gap: 10px;
}

/* Features flat block (sin acordeón ni fondo) */
.spb-features {
    margin: 2px 0;
    padding: 0;
}

.spb-features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-items: center;
    text-align: center;
}

.spb-features__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.spb-features__icon {
    width: auto;
    max-width: 48px;
    height: auto;
    object-fit: contain;
}

.spb-features__label {
    font-size: 13px;
    color: var(--spb-text);
    line-height: 1.3;
}

@media (max-width: 480px) {
    .spb-features__grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}
