/* Custom Pack – ficha de producto (Warehouse 4.5 / classic) */

/* Precio nativo oculto solo en el producto principal (el JS añade esta clase);
   los precios de carruseles y productos relacionados no se tocan. */
.cp-native-price-hidden {
    display: none !important;
}

/* ---------- Precio del pack (mismo diseño que tenía la web) ---------- */
.cp-main-price-container {
    margin-bottom: 20px;
    font-family: inherit;
}
.cp-price-display-wrapper {
    display: inline-flex;
    align-items: flex-start;
    color: #b30000;
    line-height: 0.9;
}
.cp-price-whole-part {
    font-size: 58px;
    font-weight: bold;
    letter-spacing: -2px;
}
.cp-price-decimal-part {
    font-size: 26px;
    font-weight: bold;
    margin-top: 8px;
    margin-left: 2px;
}
.cp-price-symbol-part {
    font-size: 20px;
    font-weight: 500;
    margin-top: 12px;
    margin-left: 3px;
}
.cp-price-tax-label {
    font-size: 12px;
    color: #777;
    margin-top: 6px;
}

/* ---------- Selector ---------- */
.product-custompack {
    margin-top: 1.5rem;
}
.product-custompack .cp-title {
    margin-bottom: .75rem;
}
.cp-total-rule {
    margin-bottom: .5rem;
    font-weight: 600;
}
.cp-items-list {
    margin-bottom: .75rem;
}
.cp-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: opacity .2s;
}
.cp-item-inactive {
    opacity: .5;
}
.cp-item-soldout {
    opacity: .4;
}
.cp-item-media {
    flex: 0 0 52px;
}
.cp-item-media img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 4px;
}
.cp-item-media:empty {
    display: none;
}
.cp-item-info {
    flex: 1 1 auto;
    min-width: 0;
}
.cp-item-name {
    font-weight: 600;
    color: inherit;
}
.cp-item-meta {
    font-size: 12px;
    color: #777;
}
.cp-badge-required {
    color: #b30000;
    font-weight: bold;
    margin-left: 2px;
}
.cp-item-qty {
    flex: 0 0 auto;
}
.cp-stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}
.cp-qty-btn {
    width: 34px;
    border: 0;
    background: #f5f5f5;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.cp-qty-btn:hover:not(:disabled) {
    background: #e8e8e8;
}
.cp-qty-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}
.cp-qty-input {
    width: 46px;
    height: 34px;
    border: 0;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    text-align: center;
    font-weight: 600;
    -moz-appearance: textfield;
}
.cp-qty-input::-webkit-outer-spin-button,
.cp-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.cp-summary {
    margin-bottom: .5rem;
    font-size: 14px;
}
.cp-units.cp-invalid {
    color: #b30000;
    font-weight: 600;
}
.cp-feedback {
    margin-top: .5rem;
}
.cp-loading {
    opacity: .6;
    pointer-events: none;
}

@media (max-width: 575px) {
    .cp-price-whole-part { font-size: 44px; }
    .cp-price-decimal-part { font-size: 20px; margin-top: 6px; }
    .cp-price-symbol-part { font-size: 16px; margin-top: 9px; }
    .cp-item-row { gap: 8px; }
}

/* ---------- Ahorro frente a comprar por separado ---------- */
.cp-savings {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 14px;
}
.cp-savings-regular {
    color: #777;
}
.cp-savings-regular s {
    color: #777;
}
.cp-savings-badge {
    background: #2e7d32;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    padding: 2px 8px;
    border-radius: 3px;
}

/* ---------- Barra fija inferior (solo móvil) ---------- */
.cp-sticky-bar {
    display: none;
}
@media (max-width: 767px) {
    body > .cp-sticky-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: #fff;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, .15);
        transform: translateY(110%);
        transition: transform .25s ease;
    }
    body > .cp-sticky-bar.cp-sticky-visible {
        transform: translateY(0);
    }
    .cp-sticky-info {
        display: flex;
        flex-direction: column;
        line-height: 1.15;
    }
    .cp-sticky-units {
        font-size: 12px;
        color: #777;
    }
    .cp-sticky-invalid .cp-sticky-units {
        color: #b30000;
        font-weight: 600;
    }
    .cp-sticky-price {
        font-size: 20px;
        font-weight: bold;
        color: #b30000;
    }
    .cp-sticky-buy {
        flex: 0 0 auto;
        min-width: 130px;
    }
}

/* Copia del precio en barras fijas del tema (versión compacta) */
.cp-price-compact .cp-price-whole-part { font-size: 24px; }
.cp-price-compact .cp-price-decimal-part { font-size: 13px; margin-top: 2px; }
.cp-price-compact .cp-price-symbol-part { font-size: 12px; margin-top: 3px; }

/* ------------------------------------------------------------------ */
/* Ventana emergente de los productos del pack                        */
/* Hereda tipografía y botones del tema; solo define la caja.          */
/* ------------------------------------------------------------------ */
.cp-item-name[data-cp-qv],
.cp-item-media a[data-cp-qv] { cursor: pointer; }
.cp-item-media a[data-cp-qv] { display: block; }
html.cp-qv-open, html.cp-qv-open body { overflow: hidden; }
.cp-qv-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 0, 0, .55);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.cp-qv-overlay[hidden] { display: none; }
.cp-qv-dialog {
    position: relative; background: #fff; color: inherit;
    width: 100%; max-width: 820px; max-height: calc(100vh - 32px);
    overflow: auto; border-radius: 4px; padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}
.cp-qv-dialog:focus { outline: none; }
.cp-qv-close {
    position: absolute; top: 6px; right: 8px;
    width: 40px; height: 40px; border: 0; background: transparent;
    font-size: 30px; line-height: 1; cursor: pointer; color: inherit;
}
.cp-qv-close:focus-visible, .cp-qv-thumb:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.cp-qv-body { display: flex; gap: 24px; align-items: flex-start; }
.cp-qv-gallery { flex: 0 0 45%; }
.cp-qv-main { width: 100%; height: auto; display: block; }
.cp-qv-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cp-qv-thumb { border: 1px solid #ddd; background: #fff; padding: 2px; cursor: pointer; width: 56px; }
.cp-qv-thumb.is-active { border-color: currentColor; }
.cp-qv-thumb img { width: 100%; height: auto; display: block; }
.cp-qv-info { flex: 1 1 auto; min-width: 0; }
.cp-qv-title { margin: 0 32px 8px 0; }
.cp-qv-price { margin-bottom: 12px; }
.cp-qv-desc { margin-bottom: 16px; }
.cp-qv-desc img { max-width: 100%; height: auto; }
@media (max-width: 767px) {
    .cp-qv-overlay { padding: 0; align-items: flex-end; }
    .cp-qv-dialog { max-height: 92vh; border-radius: 12px 12px 0 0; padding: 20px 16px; }
    .cp-qv-body { flex-direction: column; }
    .cp-qv-gallery { flex-basis: auto; width: 100%; max-width: 320px; margin: 0 auto; }
    .cp-qv-link { display: block; width: 100%; text-align: center; }
}
