/* Botones Cart - Estilos principales */
.woocommerce-cart #botones-cart-container,
.woocommerce-page #botones-cart-container,
#botones-cart-container {
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    position: relative;
    z-index: 1;
}

/* Clearfix para elementos después del contenedor flotante */
#botones-cart-container:after {
    content: "";
    display: table;
    clear: both;
}

/* Layout mejorado para escritorio - Posicionamiento paralelo */
@media (min-width: 769px) {
    /* Contenedor principal del carrito */
    .woocommerce-cart {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    /* La tabla del carrito arriba de todo */
    .woocommerce-cart-form {
        order: 1;
        width: 100%;
    }
    
    /* Contenedor para totales y botones */
    .cart-collaterals {
        order: 2;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 30px;
        width: 100%;
    }
    
    /* Los totales del carrito a la derecha */
    .cart-collaterals .cart_totals {
        flex: 1;
        max-width: 500px;
    }
    
    /* El contenedor de botones a la izquierda de los totales */
    #botones-cart-container {
        flex: 0 0 400px;
        order: -1;
        position: static !important;
        float: none !important;
        clear: none !important;
        margin: 0 !important;
    }
}

/* Fallback para temas que no soporten flexbox */
.cart-collaterals {
    clear: right;
}

#botones-cart-container h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

#botones-cart-container p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

.botones-cart-product-selector {
    margin-bottom: 15px;
}

#botones-cart-product-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
}

.botones-cart-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0;
}

.botones-cart-quantity-display {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    min-width: 30px;
    text-align: center;
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Botones con estilo similar al botón "Finalizar compra" */
.botones-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    margin: 0 2px;
    background-color: #333333;
    color: #ffffff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    min-width: 50px;
    height: 48px;
    line-height: 1;
    box-shadow: none;
    outline: none;
}

.botones-cart-btn:hover {
    background-color: #555555;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.botones-cart-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.botones-cart-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.3);
}

.botones-cart-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    animation: botones-cart-pulse 1.5s infinite;
}

@keyframes botones-cart-pulse {
    0% { opacity: 0.7; }
    50% { opacity: 0.9; }
    100% { opacity: 0.7; }
}

/* Flechas dentro de los botones */
.arrow-left,
.arrow-right {
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

.arrow-left:before {
    content: "‹";
}

.arrow-right:before {
    content: "›";
}

/* Posicionamiento específico para el carrito - Deshabilitado para layout paralelo */
.woocommerce-cart .cart-collaterals .cart_totals {
    position: relative;
}

/* Posicionamiento absoluto deshabilitado para permitir layout paralelo
#botones-cart-container {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
} */

/* Contenedor de botones en la sección de totales */
#botones-cart-totals-container {
    margin: 15px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.botones-cart-wrapper-totals {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.botones-cart-label {
    font-weight: 600;
    color: #333333;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Alternativa: Posicionar al lado del subtotal */
.cart-subtotal td {
    position: relative;
}

.cart-subtotal td #botones-cart-container {
    position: absolute;
    right: -80px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

/* Posicionamiento junto a los totales del carrito */
.woocommerce-cart .cart_totals .shop_table tbody tr:first-child td {
    position: relative;
}

.woocommerce-cart .cart_totals .shop_table tbody tr:first-child td:after {
    content: "";
    display: table;
    clear: both;
}

/* Notificaciones */
.botones-cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: #ffffff;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.botones-cart-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.botones-cart-success {
    background-color: #28a745;
}

.botones-cart-error {
    background-color: #dc3545;
}

/* Compatibilidad con Divi */
.et_pb_module .botones-cart-btn,
.et_builder_inner_content .botones-cart-btn {
    background-color: inherit;
    color: inherit;
    border: 2px solid currentColor;
}

.et_pb_module .botones-cart-btn:hover,
.et_builder_inner_content .botones-cart-btn:hover {
    background-color: currentColor;
    color: #ffffff;
}

/* Compatibilidad específica con el tema Divi */
body.divi #botones-cart-container {
    font-family: 'Open Sans', Arial, sans-serif;
}

body.divi .botones-cart-btn {
    font-family: inherit;
    border-radius: 0;
    letter-spacing: 0;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    #botones-cart-container {
        float: none !important;
        clear: both !important;
        max-width: 100%;
        margin: 10px 0;
        padding: 15px;
        margin-right: 0;
    }
    
    .botones-cart-wrapper {
        justify-content: center;
    }
    
    .botones-cart-btn {
        padding: 10px 14px;
        min-width: 45px;
        height: 42px;
        font-size: 13px;
    }
    
    #botones-cart-product-select {
        font-size: 14px;
    }
    
    .cart-collaterals {
        clear: both !important;
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .botones-cart-btn {
        padding: 8px 12px;
        min-width: 40px;
        height: 38px;
        font-size: 12px;
    }
    
    .botones-cart-notification {
        right: 10px;
        left: 10px;
        top: 10px;
    }
}

/* Estados adicionales */
.botones-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.botones-cart-btn:disabled:hover {
    background-color: #333333;
    transform: none;
    box-shadow: none;
}

/* Mejoras de accesibilidad */
.botones-cart-btn:focus-visible {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

/* Compatibilidad con temas oscuros */
@media (prefers-color-scheme: dark) {
    .botones-cart-btn {
        background-color: #555555;
        border-color: #666666;
    }
    
    .botones-cart-btn:hover {
        background-color: #777777;
    }
}