/* WooCommerce Product Bundle - Frontend
 * Estilos blindados contra interferencia del tema:
 * - Todo va anidado bajo .wcpb-bundle para alta especificidad.
 * - Reset interno para evitar herencia rara.
 * - Sin !important salvo cuando es estrictamente necesario contra estilos globales.
 */

/* ============ Scope reset ============ */
.wcpb-bundle,
.wcpb-bundle * {
    box-sizing: border-box;
}

.wcpb-bundle {
    margin: 32px 0 !important;
    padding: 0 !important;
    font-family: inherit;
    color: #1f2937;
    line-height: 1.4;
}

/* Bloquear <p> vacíos o sueltos que el tema/wpautop inyecta dentro */
.wcpb-bundle > p:empty,
.wcpb-bundle p:empty {
    display: none !important;
}

/* ============ Header ============ */
.wcpb-bundle .wcpb-bundle__header {
    display: flex !important;
    align-items: center;
    gap: 16px;
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
}

.wcpb-bundle .wcpb-bundle__title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 1.35em;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.01em;
    white-space: nowrap;
    line-height: 1.2;
    border: 0;
    background: transparent;
}

.wcpb-bundle .wcpb-bundle__divider {
    flex: 1 1 auto;
    display: block;
    height: 1px;
    background: #111827;
    opacity: 0.85;
    border: 0;
    margin: 0;
    padding: 0;
}

/* ============ Grid ============ */
.wcpb-bundle .wcpb-bundle__grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

@media (max-width: 900px) {
    .wcpb-bundle .wcpb-bundle__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 540px) {
    .wcpb-bundle .wcpb-bundle__grid {
        grid-template-columns: 1fr;
    }
}

/* ============ Card ============ */
.wcpb-bundle .wcpb-bundle__card {
    display: flex !important;
    align-items: center;
    gap: 14px;
    padding: 14px 16px !important;
    margin: 0 !important;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-height: 110px;
    box-shadow: none;
}

.wcpb-bundle .wcpb-bundle__card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* ============ Imagen ============ */
.wcpb-bundle .wcpb-bundle__img-link {
    flex: 0 0 80px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    line-height: 0;
    background: #fff;
    border-radius: 4px;
    text-decoration: none;
    box-shadow: none;
    border: 0;
    padding: 0;
    margin: 0;
}

.wcpb-bundle .wcpb-bundle__img-link img,
.wcpb-bundle .wcpb-bundle__img {
    max-width: 80px !important;
    max-height: 80px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

/* ============ Body ============ */
.wcpb-bundle .wcpb-bundle__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
}

/* ============ Nombre + cantidad ============ */
.wcpb-bundle .wcpb-bundle__name {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.95em;
    font-weight: 500;
    line-height: 1.35;
    color: #1f2937;
    overflow-wrap: break-word;
    word-break: break-word;
    border: 0;
    background: transparent;
    letter-spacing: 0;
    text-transform: none;
}

.wcpb-bundle .wcpb-bundle__name a {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
    box-shadow: none;
    border: 0;
    background: transparent;
}

.wcpb-bundle .wcpb-bundle__name a:hover {
    text-decoration: underline;
    color: inherit;
}

.wcpb-bundle .wcpb-bundle__qty {
    display: inline-block;
    margin: 0 0 0 4px;
    padding: 0;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    font-size: inherit;
}

/* ============ Pricing ============ */
.wcpb-bundle .wcpb-bundle__pricing {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.wcpb-bundle .wcpb-bundle__price {
    display: inline-block;
    font-size: 1.15em;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    background: transparent;
}

.wcpb-bundle .wcpb-bundle__price-old {
    display: inline-block;
    font-size: 0.9em;
    color: #9ca3af;
    text-decoration: line-through;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    background: transparent;
    font-weight: 400;
}

.wcpb-bundle .wcpb-bundle__badge {
    display: inline-block;
    padding: 2px 8px;
    background: #dc2626;
    color: #ffffff !important;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 3px;
    line-height: 1.5;
    text-transform: uppercase;
    border: 0;
    text-decoration: none;
}

/* Asegurar que <bdi> de WooCommerce (envuelve los precios) herede correctamente */
.wcpb-bundle .wcpb-bundle__price bdi,
.wcpb-bundle .wcpb-bundle__price-old bdi,
.wcpb-bundle .wcpb-bundle__price .woocommerce-Price-amount,
.wcpb-bundle .wcpb-bundle__price-old .woocommerce-Price-amount,
.wcpb-bundle .wcpb-bundle__price .woocommerce-Price-currencySymbol,
.wcpb-bundle .wcpb-bundle__price-old .woocommerce-Price-currencySymbol {
    font: inherit;
    color: inherit;
    background: transparent;
    text-decoration: inherit;
    margin: 0;
    padding: 0;
}
