/*
 * [bb_products_banner] — diseño "Slider Productos con Banner" (Claude Design).
 * Rail nativo con scroll-snap (§5.6): sin librería y sin CLS; cards y banner
 * reservan su geometría (flex-basis + aspect-ratio).
 */

.bb-pbs {
    padding: clamp(16px, 3vw, 40px) 0;
}

.bb-pbs__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bb-pbs__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.375rem, 3vw, 1.75rem);
    color: var(--bb-ink) !important; /* el tema fuerza color en h1-h6 */
    margin: 0;
}

.bb-pbs__nav {
    display: flex;
    gap: .5rem;
    margin-left: auto;
}

/* Llegan ocultas del servidor; el JS las revela solo si hay overflow */
.bb-pbs__nav[hidden] {
    display: none;
}

.bb-pbs__arrow {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--bb-line);
    background: var(--bb-white);
    color: var(--bb-purple);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 150ms;
    -webkit-appearance: none;
    appearance: none;
}

/* color explícito: Storefront pinta button:hover { color: #fff } */
.bb-pbs__arrow:hover {
    background: var(--bb-purple-50);
    color: var(--bb-purple);
}

.bb-pbs__arrow svg { display: block; }

.bb-pbs__arrow:focus-visible {
    outline: 2px solid var(--bb-purple-deep);
    outline-offset: 2px;
}

/* ---------- Layout: banner + rail ---------- */

.bb-pbs__layout {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.bb-pbs__banner {
    flex: 0 0 300px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    background: var(--bb-purple-50); /* color de marca mientras carga */
    display: block;
    position: relative;
    min-height: 420px;
    transition: transform 200ms ease-out, box-shadow 200ms ease-out;
}

a.bb-pbs__banner:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-pop);
}

a.bb-pbs__banner:focus-visible {
    outline: 2px solid var(--bb-purple-deep);
    outline-offset: 2px;
}

.bb-pbs__banner picture,
.bb-pbs__banner-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.bb-pbs__banner-img {
    object-fit: cover;
    display: block;
}

/* ---------- Rail de productos ---------- */

.bb-pbs__track {
    list-style: none;
    margin: 0;
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 8px 4px 16px;
    flex: 1;
    min-width: 0;
}

.bb-pbs__track::-webkit-scrollbar { display: none; }

.bb-pbs__card {
    flex: 0 0 240px;
    scroll-snap-align: start;
    margin: 0;
    background: var(--bb-white);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 200ms ease-out, box-shadow 200ms ease-out;
}

.bb-pbs__card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-pop);
}

.bb-pbs__media {
    position: relative;
    display: block;
    aspect-ratio: 1; /* reserva el cuadrado antes de que llegue la foto */
    background: var(--bb-white); /* las fotos de catálogo vienen sobre blanco: se funden */
    /* Sin esto, una foto vertical estira el cuadrado: una caja con
       aspect-ratio crece hasta el alto de su contenido. */
    overflow: hidden;
}

/* Foto de catálogo completa (contain): nunca se recorta el producto. */
.bb-pbs__img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 8px;
    box-sizing: border-box;
    object-fit: contain;
}

.bb-pbs__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--bb-coral);
    color: var(--bb-white);
    font-weight: 800;
    font-size: .75rem;
    padding: 4px 10px;
    border-radius: 999px;
}

.bb-pbs__body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.bb-pbs__brand {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--bb-purple);
}

.bb-pbs__name {
    margin: 0;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.35;
    flex: 1;
}

.site-main .bb-pbs__name a,
.bb-pbs__name a {
    color: var(--bb-ink);
    text-decoration: none;
}

.bb-pbs__name a:hover {
    color: var(--bb-purple-deep);
}

.bb-pbs__prices {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.bb-pbs__price {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--bb-ink);
}

.bb-pbs__old {
    font-size: .8125rem;
    color: var(--bb-ink-3);
}

/* CTA coral (sin la clase .button del tema: evita sus !important). Geometría
   (pill S de 40px), ícono y estados "Añadiendo"/"Añadido": patrón global de
   a.add_to_cart_button en bb-add-to-cart.css. Acá color y ancho. */
.bb-pbs__cta,
.bb-pbs__cta:visited {
    margin-top: 6px;
    width: 100%;
    background: var(--bb-coral);
    color: var(--bb-white);
    box-shadow: var(--shadow-cta);
}

.bb-pbs__cta:hover {
    background: var(--bb-coral-deep);
    color: var(--bb-white);
    text-decoration: none;
}

/* ---------- Mobile: columna, banner horizontal ---------- */

@media (max-width: 720px) {
    .bb-pbs__layout {
        flex-direction: column;
    }
    .bb-pbs__banner {
        flex: 0 0 auto;
        min-height: 0;
        aspect-ratio: 16 / 9; /* la relación del arte mobile: sin recorte */
    }
    .bb-pbs__card {
        flex-basis: 200px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bb-pbs__track { scroll-behavior: auto; }
    .bb-pbs__card,
    .bb-pbs__banner,
    .bb-pbs__cta { transition: none; }
}
