/* =============================================
   MedBuy Custom Cart Page Styles
   ============================================= */

#medbuy-custom-cart-wrapper {
    max-width: 1250px;
    margin: 40px auto 80px auto;
    padding: 0 20px;
}

#medbuy-custom-cart-wrapper .woocommerce {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 40px;
    align-items: flex-start;
}
#medbuy-custom-cart-wrapper .woocommerce-notices-wrapper {
    grid-column: 1 / -1;
}

/* ------------------------------------
   TABLA DE PRODUCTOS (IZQUIERDA)
   ------------------------------------ */
#medbuy-custom-cart-wrapper .woocommerce-cart-form {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    min-width: 300px;
}

#medbuy-custom-cart-wrapper table.shop_table {
    border: none !important;
    border-collapse: collapse !important;
    width: 100% !important;
    margin-top: 0;
}

#medbuy-custom-cart-wrapper table.shop_table th {
    border: none !important;
    border-bottom: 1px solid #eaeaea !important;
    background: transparent !important;
    color: #666 !important;
    font-weight: 600 !important;
    padding: 15px 10px !important;
    text-transform: none !important;
    font-size: 14px !important;
}

#medbuy-custom-cart-wrapper table.shop_table td {
    border: none !important;
    border-bottom: 1px solid #eaeaea !important;
    background: transparent !important;
    padding: 20px 10px !important;
    vertical-align: middle !important;
}

#medbuy-custom-cart-wrapper table.cart img {
    width: 60px !important;
    height: auto !important;
    border-radius: 4px !important;
    box-shadow: none !important;
}

#medbuy-custom-cart-wrapper table.cart td.product-name a {
    color: #333 !important;
    font-size: 14px !important;
    text-decoration: none !important;
}

/* ------------------------------------
   BOTÓN ELIMINAR (BASURERO)
   ------------------------------------ */
#medbuy-custom-cart-wrapper table.shop_table th.product-remove,
#medbuy-custom-cart-wrapper table.shop_table td.product-remove {
    text-align: center;
}

#medbuy-custom-cart-wrapper a.remove {
    font-size: 0 !important; 
    color: transparent !important;
    text-indent: -9999px !important;
    overflow: hidden !important;
    display: inline-block !important;
    width: 24px !important;
    height: 24px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff0000'%3E%3Cpath d='M9 3v1H4v2h1v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6h1V4h-5V3H9zm0 5h2v9H9V8zm4 0h2v9h-2V8z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    border: none !important;
    transition: opacity 0.3s;
}
#medbuy-custom-cart-wrapper a.remove:hover {
    opacity: 0.7 !important;
}
/* Forzar ocultamiento de iconos nativos (Astra / WooCommerce) */
#medbuy-custom-cart-wrapper a.remove::before,
#medbuy-custom-cart-wrapper a.remove::after,
#medbuy-custom-cart-wrapper a.remove * {
    display: none !important;
}

/* ------------------------------------
   ESTILOS DE CANTIDAD (+ / -)
   ------------------------------------ */
#medbuy-custom-cart-wrapper .quantity {
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center;
    padding: 0 !important;
    background: #fdfdfd;
}
#medbuy-custom-cart-wrapper .quantity .minus,
#medbuy-custom-cart-wrapper .quantity .plus,
#medbuy-custom-cart-wrapper .quantity .qty {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
    height: 40px !important;
}
#medbuy-custom-cart-wrapper .quantity .minus,
#medbuy-custom-cart-wrapper .quantity .plus {
    width: 30px !important;
    font-size: 18px !important;
    color: #666 !important;
    cursor: pointer;
}
#medbuy-custom-cart-wrapper .quantity .qty {
    width: 40px !important;
    text-align: center !important;
    font-weight: bold !important;
    padding: 0 !important;
}

/* ------------------------------------
   ZONA DE CUPONES Y ACTUALIZAR
   ------------------------------------ */
#medbuy-custom-cart-wrapper .actions {
    padding: 20px 0 !important;
    border: none !important;
    background: transparent !important;
}
#medbuy-custom-cart-wrapper .coupon {
    display: flex;
    gap: 10px;
    float: left;
}
#medbuy-custom-cart-wrapper .coupon input.input-text {
    padding: 10px 15px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    width: 200px !important;
}
#medbuy-custom-cart-wrapper .coupon button.button {
    background: #67c6ed !important;
    color: #fff !important;
    border-radius: 4px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    border: none !important;
}

/* Ocultar botón Actualizar Carrito */
#medbuy-custom-cart-wrapper button[name="update_cart"] {
    display: none !important;
}

/* ------------------------------------
   TOTALES Y VENTAS CRUZADAS (DERECHA E IZQUIERDA ABAJO)
   ------------------------------------ */
#medbuy-custom-cart-wrapper .cart-collaterals {
    display: contents; /* Permite que el grid controle directamente a sus hijos */
}

/* Ventas Cruzadas (Se mueven a la izquierda debajo del carrito) */
#medbuy-custom-cart-wrapper .cross-sells {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
    margin-top: 20px;
    width: 100% !important;
    max-width: 100% !important;
}
#medbuy-custom-cart-wrapper .cross-sells h2 {
    font-size: 20px !important;
    color: #333 !important;
    margin-bottom: 20px !important;
    border-bottom: 2px solid #67c6ed !important;
    display: inline-block;
    padding-bottom: 5px;
}
#medbuy-custom-cart-wrapper .cross-sells ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}
#medbuy-custom-cart-wrapper .cross-sells ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    background: #fff !important;
    border: 1px solid #eaeaea !important;
    border-radius: 8px !important;
    padding: 15px !important;
    text-align: center !important;
}

/* Totales (Se mantienen a la derecha) */
#medbuy-custom-cart-wrapper .cart_totals {
    grid-column: 2 / 3;
    grid-row: 2 / 4;
    background: #f9f9f9 !important;
    border: 1px solid #eaeaea !important;
    padding: 30px !important;
    border-radius: 4px !important;
    width: 100% !important;
    float: none !important;
}

#medbuy-custom-cart-wrapper .cart_totals h2 {
    font-size: 22px !important;
    color: #333 !important;
    margin-bottom: 25px !important;
    padding-bottom: 15px !important;
    border-bottom: 1px solid #eaeaea !important;
}

#medbuy-custom-cart-wrapper .wc-proceed-to-checkout a.checkout-button {
    background: #67c6ed !important;
    color: #fff !important;
    border-radius: 4px !important;
    padding: 15px 30px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-align: center !important;
    display: block !important;
    float: right;
    margin-top: 20px;
}

@media (max-width: 768px) {
    #medbuy-custom-cart-wrapper .woocommerce {
        display: flex;
        flex-direction: column;
    }
    #medbuy-custom-cart-wrapper .cart-collaterals {
        display: block; /* Desactiva el contents en móvil para que caigan de forma natural */
    }
    #medbuy-custom-cart-wrapper .cross-sells ul.products {
        grid-template-columns: 1fr !important;
    }
    #medbuy-custom-cart-wrapper .coupon {
        flex-direction: column;
        width: 100%;
        margin-bottom: 15px;
    }
    #medbuy-custom-cart-wrapper .coupon input.input-text,
    #medbuy-custom-cart-wrapper .coupon button.button {
        width: 100% !important;
        float: none !important;
    }
}
