/* ==========================================================================
   Pack como compra principal · Esmoking
   Usa las variables de product.css (--primary-color, --text-dark, …) con
   valores de respaldo por si el archivo se carga en otro contexto.
   ========================================================================== */

/* Compra estándar oculta cuando hay pack: los IDs siguen en el DOM para el JS del SKU. */
.product-card.has-primary-pack .original-product-price,
.product-card.has-primary-pack .original-product-options,
.product-card.has-primary-pack .original-product-actions {
    display: none !important;
}

.pp-box {
    --pp-primary: var(--primary-color, #d32f2f);
    --pp-primary-dark: var(--primary-dark, #b71c1c);
    --pp-primary-soft: #fff4f4;
    --pp-primary-line: #f6d4d4;
    --pp-text: var(--text-dark, #1e293b);
    --pp-muted: var(--text-gray, #64748b);
    --pp-line: #e2e8f0;
    --pp-ok: #047857;
    --pp-ok-bg: #ecfdf5;
    --pp-radius: var(--radius-md, 12px);

    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 18px 0 0;
    color: var(--pp-text);
}
.pp-box [hidden] { display: none !important; }

/* ---------- Precio ---------- */
.pp-price {
    padding: 18px 20px 16px;
    border: 1px solid var(--pp-primary-line);
    border-radius: var(--radius-lg, 16px);
    background: linear-gradient(120deg, #ffecec 0%, #fff5f3 45%, #ffffff 100%);
}
.pp-price-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}
.pp-discount-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 13px;
    border-radius: 999px;
    background: var(--pp-primary);
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1;
    letter-spacing: -.2px;
}
.pp-price-total {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 2.55rem;
    line-height: 1;
    letter-spacing: -1px;
    color: var(--pp-text);
    font-variant-numeric: tabular-nums;
}
.pp-price-regular {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--pp-muted);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}
.pp-price-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 12px;
}
.pp-savings {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--pp-ok-bg);
    color: var(--pp-ok);
    font-weight: 700;
    font-size: .85rem;
}
.pp-price-note {
    font-size: .76rem;
    color: var(--pp-muted);
}

/* ---------- Pasos ---------- */
.pp-step { min-width: 0; }
.pp-step-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 9px;
    font-size: .88rem;
    font-weight: 700;
    color: var(--pp-text);
}
.pp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 4px 10px;
    border: 1px solid var(--pp-line);
    border-radius: 999px;
    background: #fff;
    color: var(--pp-muted);
    font-size: .72rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.pp-chip i { color: var(--pp-primary); }

/* Opciones (modo de compra) */
.pp-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.pp-option {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 2px 10px;
    padding: 12px 14px;
    border: 1.5px solid var(--pp-line);
    border-radius: var(--pp-radius);
    background: #fff;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.pp-option:hover { border-color: #cbd5e1; }
.pp-option input,
.pp-variant input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}
.pp-option-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: .93rem;
}
.pp-option-price {
    font-weight: 700;
    font-size: .85rem;
    color: var(--pp-text);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.pp-option-sub {
    grid-column: 1 / -1;
    font-size: .75rem;
    color: var(--pp-muted);
    line-height: 1.35;
}

/* Variantes (nicotina / opciones del pack) */
.pp-variant-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pp-box .pp-variant {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 118px;
    padding: 9px 14px;
    border: 1.5px solid var(--pp-line);
    border-radius: var(--pp-radius);
    background: #fff;
    cursor: pointer;
    font-size: inherit;
    font-weight: normal;
    color: inherit;
    line-height: 1.3;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.pp-box .pp-variant:hover { border-color: #cbd5e1; }
.pp-variant-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: .9rem;
}
.pp-variant-meta {
    font-size: .75rem;
    color: var(--pp-muted);
    font-variant-numeric: tabular-nums;
}

/* Estado activo y foco (compartido) */
.pp-option.is-active,
.pp-box .pp-variant.is-active {
    border-color: var(--pp-primary);
    box-shadow: 0 0 0 1px var(--pp-primary);
    background: var(--pp-primary-soft);
}
.pp-option.is-active .pp-option-price,
.pp-box .pp-variant.is-active .pp-variant-meta { color: var(--pp-primary-dark); }
.pp-option:has(input:focus-visible),
.pp-box .pp-variant:has(input:focus-visible) {
    outline: 2px solid var(--pp-primary);
    outline-offset: 2px;
}

/* ---------- Qué incluye ---------- */
.pp-thumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.pp-thumbs .product-pack-extra-items { display: contents; }
.pp-box .product-pack-image-card {
    position: relative;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    padding: 4px;
    border: 1px solid var(--pp-line);
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pp-box .product-pack-image-card.is-current { border-color: var(--pp-primary-line); }
.pp-box .product-pack-image {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin: 0;
}
.pp-box .product-pack-plus {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fde8e8;
    color: var(--pp-primary);
    font-size: .55rem;
}
.pp-box .product-pack-qty-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--pp-text);
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
}
.pp-box .product-pack-image-card.is-current .product-pack-qty-badge { display: none; }

.pp-lines {
    padding: 2px 14px;
    border-radius: var(--pp-radius);
    background: #f8fafc;
}
.pp-lines:empty { display: none; }
.pp-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px solid #edf1f5;
    font-size: .8rem;
    color: #334155;
}
.pp-line:last-child { border-bottom: 0; }
.pp-line-name b { color: var(--pp-primary-dark); margin-right: 3px; }
.pp-line-price {
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.pp-note {
    margin: 8px 0 0;
    font-size: .75rem;
    color: var(--pp-muted);
}
.pp-note:empty { display: none; }
.pp-note--warning { color: #a51d26; font-weight: 600; }

/* ---------- CTA ---------- */
.pp-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 54px;
    padding: 12px 20px;
    border: 0;
    border-radius: var(--pp-radius);
    background: var(--pp-primary);
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    box-shadow: 0 4px 15px rgba(211, 47, 47, .3);
    transition: background-color .25s, transform .25s, box-shadow .25s;
}
.pp-cta:hover:not(:disabled) {
    background: var(--pp-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover, 0 10px 25px rgba(211, 47, 47, .15));
}
.pp-cta:focus-visible { outline: 3px solid rgba(211, 47, 47, .35); outline-offset: 2px; }
.pp-cta:disabled {
    background: #b6bcc6;
    box-shadow: none;
    cursor: not-allowed;
}
.pp-cta-price { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Stock y entrega ---------- */
.pp-stock {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: -6px;
    font-size: .84rem;
    color: #334155;
}
.pp-stock-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    color: var(--pp-ok);
}
.pp-stock-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color, #10b981);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .18);
}
.pp-stock-status.is-error { color: #b91c1c; }
.pp-stock-status.is-error::before { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.pp-stock.is-error .pp-delivery { display: none; }
.pp-delivery i { color: var(--pp-muted); margin-right: 3px; }

/* ---------- Garantías (fila existente, en formato tarjeta unida) ---------- */
.product-card.has-primary-pack .product-trust-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 18px 0 0 !important;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    background: #fff;
}
.product-card.has-primary-pack .product-trust-row > [class*="col-"] {
    width: auto;
    max-width: none;
    padding: 0;
    margin: 0;
}
.product-card.has-primary-pack .product-trust-row > [class*="col-"] + [class*="col-"] {
    border-left: 1px solid #e2e8f0;
}
.product-card.has-primary-pack .product-trust-row .feature-item {
    gap: 11px;
    padding: 12px 14px;
    border-radius: 0;
    background: #fff;
}
.product-card.has-primary-pack .product-trust-row .feature-icon {
    font-size: 1.05rem;
    color: var(--primary-color, #d32f2f);
}

/* ---------- Responsive ---------- */
@media (max-width: 575.98px) {
    .pp-price { padding: 15px 16px 14px; }
    .pp-price-total { font-size: 2.15rem; }
    .pp-discount-pill { font-size: .95rem; }
    .pp-option { padding: 11px 12px; }
    .pp-variant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pp-box .pp-variant { min-width: 0; }
    .product-card.has-primary-pack .product-trust-row .feature-item {
        flex-direction: column;
        gap: 5px;
        padding: 10px 6px;
        text-align: center;
    }
    .product-card.has-primary-pack .product-trust-row .feature-item .small { font-size: .74rem; }
}
@media (max-width: 380px) {
    .pp-mode-grid { grid-template-columns: 1fr; }
}

/* Los importes nunca se parten ("16,56 / €"). */
.pp-box [data-option-price],
.pp-box [data-option-from] { white-space: nowrap; }
