.compra-conjunta {
    --cc-azul: #104c71;
    --cc-naranja: #f07f3c;
    --cc-borde: #dce7ee;
    max-width: 1280px;
    margin: 40px auto;
    padding: clamp(20px, 3vw, 36px);
    color: var(--cc-azul);
    font-family: 'Open Sans Variable', sans-serif;
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.compra-conjunta *, .compra-conjunta *::before, .compra-conjunta *::after { box-sizing: border-box; }
.compra-conjunta__cabecera { margin-bottom: 28px; max-width: 850px; }
.compra-conjunta h2 {
    margin: 0;
    font-family: 'Podkova Variable', serif;
    font-size: clamp(26px, 2.5vw, 34px);
    font-weight: 700;
    line-height: 1.15;
    text-wrap: balance;
}
.compra-conjunta__texto {
    margin: 12px 0 0;
    color: #536d7e;
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.compra-conjunta__contenido {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
    gap: 28px;
}
.compra-conjunta__productos {
    display: flex;
    align-items: stretch;
    gap: 10px;
    min-width: 0;
    overflow-x: auto;
    padding: 3px 3px 16px;
    scrollbar-width: thin;
    scrollbar-color: #b8cdd9 #f1f5f8;
    scroll-snap-type: x proximity;
}
.compra-conjunta__producto {
    flex: 1 0 160px;
    max-width: 260px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--cc-borde);
    border-radius: 16px;
    background: #fff;
    scroll-snap-align: start;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.compra-conjunta__producto:has(input:checked) {
    border-color: #8bb9d1;
    box-shadow: 0 2px 8px rgb(16 76 113 / 6%);
}
.compra-conjunta__portada {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 232px;
    padding: 28px 12px 16px;
    margin: 0;
    cursor: pointer;
    background: #f5f7f9;
    transition: background .18s ease;
}
.compra-conjunta__producto:has(input:checked) .compra-conjunta__portada { background: #edf5f9; }
/* El enlace de portada y el selector son controles independientes. */
.compra-conjunta__enlace-portada { display: block; width: 100%; max-width: 160px; }
.compra-conjunta__enlace-portada > div { display: flex; align-items: center; justify-content: center; height: 180px; aspect-ratio: auto; }
.compra-conjunta__productos.is-dragging { scroll-snap-type: none; user-select: none; }
.compra-conjunta__productos img { -webkit-user-drag: none; }
.compra-conjunta__seleccion {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    cursor: pointer;
}
.compra-conjunta__seleccion input {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: 1.5px solid #93aebf;
    border-radius: 7px;
    background-color: #fff;
    background-image: none;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 18px 18px;
    box-shadow: 0 2px 5px rgb(16 76 113 / 8%);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.compra-conjunta__seleccion input:checked {
    border-color: var(--cc-azul);
    background-color: var(--cc-azul);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m5 12 4 4 10-10' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.compra-conjunta__seleccion:hover input:not(:disabled) { border-color: var(--cc-azul); box-shadow: 0 0 0 4px rgb(16 76 113 / 10%); }
.compra-conjunta__seleccion input:focus-visible { outline: 3px solid #21abd2; outline-offset: 3px; box-shadow: none; }
.compra-conjunta__seleccion:has(input:disabled), .compra-conjunta__seleccion input:disabled { cursor: not-allowed; }
.compra-conjunta__seleccion input:disabled { opacity: .45; box-shadow: none; }
@media (forced-colors: active) {
    .compra-conjunta__seleccion input { appearance: auto; -webkit-appearance: checkbox; }
}
.compra-conjunta__portada img {
    display: block;
    height: auto;
    width: auto;
    max-height: 180px;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 6px 4px rgb(16 40 56 / 12%));
    transition: opacity .18s ease;
}
.compra-conjunta__portada:has(input:not(:checked)) img { opacity: .55; }
.compra-conjunta__detalle { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 16px; }
.compra-conjunta__autor {
    margin: 0;
    color: #6b8190;
    font-size: 11px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.compra-conjunta__nombre {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    color: var(--cc-azul);
    font-size: 14px;
    line-height: 1.45;
    font-weight: 700;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.compra-conjunta__nombre:hover { text-decoration: underline; }
.compra-conjunta__precio { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 8px; }
.compra-conjunta__precio strong { font-family: 'Podkova Variable', serif; font-size: 23px; font-weight: 700; line-height: 1.1; }
.compra-conjunta__precio del { color: #7d8c97; font-size: 12px; }
.compra-conjunta__mas {
    display: flex;
    flex: 0 0 24px;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    width: 24px;
    height: 24px;
    margin-top: 104px;
    border-radius: 50%;
    background: #edf3f7;
    color: #66879b;
    font-size: 21px;
    font-weight: 400;
}
.compra-conjunta__resumen { padding: 24px; border-radius: 18px; background: #edf5f9; border: 1px solid #e0ecf3; }
.compra-conjunta__icono { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: 16px; border-radius: 13px; background: #fff; }
.compra-conjunta__icono svg { width: 24px; height: 24px; }
.compra-conjunta__resumen-titulo { margin: 0 0 20px; font-size: 15px; font-weight: 700; }
.compra-conjunta__total { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.compra-conjunta__total > span { color: #536d7e; font-size: 13px; }
.compra-conjunta__total strong { font-family: 'Podkova Variable', serif; font-size: 38px; font-weight: 700; line-height: 1.1; letter-spacing: -.5px; }
.compra-conjunta__resumen button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    margin: 20px 0 12px;
    padding: 12px 14px;
    border: 0;
    border-radius: 10px;
    background: var(--cc-naranja);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    transition: background .18s ease, box-shadow .18s ease;
}
.compra-conjunta__resumen button::after { content: '\2192'; font-size: 20px; line-height: 1; }
.compra-conjunta__resumen button:hover:not(:disabled) { background: #df6b28; box-shadow: 0 4px 12px rgb(223 107 40 / 18%); }
.compra-conjunta__resumen button:disabled { opacity: .5; cursor: not-allowed; }
.compra-conjunta__aviso { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid #d6e5ee; color: #536d7e; font-size: 11px; line-height: 1.6; }
.compra-conjunta__no-disponible { color: #a13f32; font-size: 12px; }
.compra-conjunta [data-estado] { margin: 12px 0 0; font-size: 13px; line-height: 1.5; }
.compra-conjunta [data-estado]:empty { display: none; }
.compra-conjunta :focus-visible { outline: 3px solid #16add2; outline-offset: 3px; }
@media (max-width: 900px) {
    .compra-conjunta__contenido { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .compra-conjunta__resumen { width: 100%; }
    .compra-conjunta__icono { display: none; }
    .compra-conjunta__total { flex-direction: row; align-items: baseline; justify-content: space-between; }
    .compra-conjunta__resumen-titulo { margin-bottom: 12px; }
    .compra-conjunta__producto { max-width: none; }
}
@media (max-width: 540px) {
    .compra-conjunta { margin: 24px 12px; padding: 20px 0; border-radius: 0; }
    .compra-conjunta__cabecera { margin-bottom: 20px; }
    .compra-conjunta__texto { font-size: 14px; }
    .compra-conjunta__producto { flex: 0 0 160px; }
    .compra-conjunta__productos { gap: 6px; }
    .compra-conjunta__detalle { padding: 12px; }
    .compra-conjunta__mas { flex-basis: 20px; width: 20px; height: 20px; font-size: 18px; }
    .compra-conjunta__resumen { padding: 20px; }
    .compra-conjunta__total strong { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
    .compra-conjunta *, .compra-conjunta *::before, .compra-conjunta *::after { transition: none; scroll-behavior: auto; }
}
