/**
 * Estilos para la página del Carrito
 *
 * @package B2C
 */

/* =============================================================================
   OCULTAR DEFAULTS DE WC (cupones y descuento nativo)
   ============================================================================= */

.cart_totals .cart-discount {
    display: none;
}

.woocommerce-cart-form .coupon {
    display: none;
}

/* =============================================================================
   BREAKDOWN DE TOTALES
   ============================================================================= */

.b2c-cart-breakdown {
    width: 100%;
    margin-bottom: 12px;
}

.b2c-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    margin-bottom: ;
}

.b2c-row-label {
    flex: 1;
     color: var(--e-global-color-primary);
     font-weight: 600;
}

.b2c-row-value {
    text-align: right;
    color: var(--e-global-color-primary);
}

.b2c-row-regular {
    color: #888;
}

.b2c-row-discount {
    padding:20px;
    border-radius: 10px;
    border: 1px solid var(--e-global-color-e91c093);
    margin-bottom:10px;
    align-items: center;
}

.b2c-row-discount .b2c-row-label,
.b2c-row-discount .b2c-row-value {
    color: var(--e-global-color-primary);
    font-weight: 600;
}

.b2c-discount-reason {
    display: block;
    color: var(--e-global-color-primary);
    font-size: 12px;
    font-weight: 400;

}

.b2c-discount-reason .coupon-tag-inline {
    display: inline-flex;
    width: auto;
    justify-content: flex-start;
}

.b2c-row-coupon-form {
    display: block;
    padding: 0px;
}

.b2c-row-coupon-form + .b2c-row-divider {
    display: none;
}

.b2c-row-coupon-form .b2c-coupon-form-wrapper {
    margin-top: 0;
}

.b2c-coupon-restrictions {
    display: block;
    width: 100%;
    padding: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.6;
}

.b2c-coupon-rule {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 2px;
    color: var(--e-global-color-primary);
}

.b2c-coupon-rule b {
    font-size: 10px;
    font-weight: 700;
    color: var(--e-global-color-primary);
    margin-right: 3px;
}

.b2c-row-divider {
    height: 1px;
    background: var(--e-global-color-e91c093);
    margin: 4px 0;
}

.b2c-row-shipping {
padding: 20px;
border-radius: 10px;
border: 1px solid var(--e-global-color-e91c093);
margin-bottom: 10px;
}
.b2c-row-shipping + .b2c-row-divider {
    display: none;
}

.b2c-row-subtotal {
    padding-top: 14px;
}

.b2c-row-total {
    padding:20px;
    border-radius: 10px;
    border: 1px solid var(--e-global-color-e91c093);
    margin-bottom:10px;
}

.b2c-row-total .b2c-row-value {
    font-size:25px;
    font-weight: 600;
    color:var(--e-global-color-secondary);

}

.b2c-wc-hidden {
    display: none;
}


/* =============================================================================
   CUPÓN TAG INLINE
   ============================================================================= */

.b2c-coupon-wrapper {
    width: auto;
    max-width: 200px;
    display: flex;
    flex-direction: column;
}

.coupon-tag-inline {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 6px 12px;
    background: var(--e-global-color-primary);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom:5px;
    gap: 5px;
}

.coupon-tag-inline span:first-child {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

button.mini-cart-remove-coupon-inline {
    padding: 3px !important;
}

.mini-cart-remove-coupon-inline {
    background: none;
    border: none;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    padding: 3px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
    flex-grow: 0;
    border-radius: 50%;
    transition: all 0.2s;
}

.mini-cart-remove-coupon-inline:hover {
    background: #fff;
    color: #000;
}

.mini-cart-remove-coupon-inline.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
    color: transparent;
}

.mini-cart-remove-coupon-inline.loading::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    top: 50%;
    left: 50%;
    margin-left: -5px;
    margin-top: -5px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: b2c-spin 0.8s linear infinite;
}

/* =============================================================================
   FORMULARIO DE CUPÓN
   ============================================================================= */

.b2c-coupon-form-wrapper {
    display: block;
    margin-top: 12px;
    width: 100%;
}

.b2c-coupon-form-inner {
    display: flex;
    gap: 8px;
    width: 100%;
}

.b2c-input-wrapper {
    flex: 1;
    position: relative;
}

#mini_cart_coupon_code {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: border-color 0.3s;
}

#mini_cart_coupon_code:focus {
    outline: none;
    border-color: var(--e-global-color-primary);
}

#mini_cart_apply_coupon {
    padding: 15px 20px;
    background: var(--e-global-color-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    height: 48px;
    transition: background 0.3s;
}

#mini_cart_apply_coupon:hover {
    opacity: 0.9;
}

#mini_cart_apply_coupon.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

#mini_cart_apply_coupon.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: b2c-spin 0.8s linear infinite;
}

@keyframes b2c-spin {
    to { transform: rotate(360deg); }
}

/* Mensajes de error/éxito sobre el input */
.mini-cart-coupon-messages {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    transition: opacity 0.2s;
}

.mini-cart-coupon-messages.success,
.mini-cart-coupon-messages.error {
    display: flex;
}

.mini-cart-coupon-messages.success {
    background: rgba(16, 185, 129, 0.95);
    color: white;
}

.mini-cart-coupon-messages.error {
    background: rgba(239, 68, 68, 0.95);
    color: white;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 480px) {
    .b2c-coupon-form-inner {
        flex-direction: column;
    }

    #mini_cart_apply_coupon {
        width: 100%;
    }

    .b2c-coupon-wrapper {
        width: 100%;
    }
}
