/* Combina y Ahorra — Widget CSS v1.2 */

/* ── Estructura base ────────────────────────────────────────────────── */

.ca-widget {
    margin: 0 0 1.5rem;
    font-family: inherit;
    box-sizing: border-box;
}

.ca-widget *,
.ca-widget *::before,
.ca-widget *::after {
    box-sizing: border-box;
}

.ca-widget__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.ca-widget__link {
    font-size: 0.85rem;
    text-decoration: underline;
    opacity: 0.7;
}

.ca-widget__tiers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Oculta qty nativo */
.ca-widget ~ .quantity,
.ca-widget + * .quantity {
    display: none !important;
}

/* ── Tier row ──────────────────────────────────────────────────────── */

.ca-tier {
    display: block;
    position: relative;
    background: #ffffff;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    /* Elimina outline del label que causa el recuadro rojo */
    outline: none !important;
}

.ca-tier:focus,
.ca-tier:focus-visible {
    outline: none !important;
    box-shadow: none;
}

.ca-tier:hover {
    border-color: #8B6914;
}

.ca-tier--selected {
    border-color: #8B6914;
    box-shadow: 0 0 0 1px #8B6914;
}

.ca-tier__inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Radio button ──────────────────────────────────────────────────── */

.ca-tier__radio {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    border: 2px solid #cccccc !important;
    border-radius: 50% !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.ca-tier__radio:focus,
.ca-tier__radio:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.ca-tier__radio:checked {
    border-color: #8B6914 !important;
    background-color: transparent !important;
    background-image: radial-gradient(circle, #8B6914 38%, transparent 40%) !important;
}

/* Anula pseudoelementos que puedan inyectar temas */
.ca-tier__radio::before,
.ca-tier__radio::after {
    display: none !important;
    content: none !important;
}

/* ── Info (label + badge) ──────────────────────────────────────────── */

.ca-tier__info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    flex-wrap: wrap;
}

.ca-tier__label {
    font-weight: 600;
    font-size: 0.95rem;
}

.ca-tier__tag {
    display: inline-block;
    background: #FFF176;
    color: #5D4200;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    line-height: 1.4;
}

/* ── Pricing ───────────────────────────────────────────────────────── */

.ca-tier__pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    margin-left: auto;
}

.ca-tier__total,
.ca-tier__total .woocommerce-Price-amount,
.ca-tier__total .woocommerce-Price-amount bdi,
.ca-tier__total .woocommerce-Price-currencySymbol {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none !important;
}

/* Precio tachado: raya manual via ::after para evitar conflictos con bdi */
.ca-tier__orig {
    position: relative;
    display: inline-block;
    color: #999999;
}

.ca-tier__orig::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    height: 1px;
    background: #999999;
    pointer-events: none;
}

.ca-tier__orig,
.ca-tier__orig .woocommerce-Price-amount,
.ca-tier__orig .woocommerce-Price-amount bdi,
.ca-tier__orig .woocommerce-Price-currencySymbol {
    font-size: 0.82rem;
    font-weight: 400;
    color: #999999;
    text-decoration: none !important;
}

/* ── Unit price ────────────────────────────────────────────────────── */

.ca-tier__unit {
    color: #666666;
    font-size: 0.8rem;
    font-weight: 400;
    margin-top: 4px;
    padding-left: 26px;
}

.ca-tier__unit .woocommerce-Price-amount,
.ca-tier__unit .woocommerce-Price-amount bdi,
.ca-tier__unit .woocommerce-Price-currencySymbol {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

/* ── Badge highlight (Más vendido) ─────────────────────────────────── */

.ca-tier__badge-highlight {
    display: block;
    position: absolute;
    top: -12px;
    right: 12px;
    background: #2C1A00;
    color: #F5E6C8;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 4px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    z-index: 2;
    pointer-events: none;
}

.ca-tier:has(.ca-tier__badge-highlight),
.ca-tier--has-badge {
    margin-top: 14px;
    overflow: visible;
}

/* ── Badge en carrito ──────────────────────────────────────────────── */

.ca-cart-badge {
    display: inline-block;
    background: #FFF176;
    color: #5D4200;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

@media (max-width: 480px) {
    .ca-tier__label { font-size: 0.88rem; }
}
