/**
 * DepositoTrujillo — cart page UX fixes (registered on all pages via
 * Olegnax/athlete2 Magento_Theme/layout/default.xml, selectors scoped to
 * .checkout-cart-index so nothing else is touched).
 *
 * 1. "Vaciar carrito" (DepositoTrujillo_CheckoutPages empty-cart form) is
 *    rendered inside .cart.page-title-wrapper, but the theme's title wrapper
 *    lays out floats: the button ended up half-overlapping the row below the
 *    "Proceder al pago" button. Flexbox row, title left, buttons right,
 *    secondary style matching the primary button's height.
 *
 * 2. Cart product sliders ("Más opciones" cross-sell, "Recientemente
 *    ordenado"): the Athlete2 template renders these with
 *    .products__listing-wrapper but the theme ships NO stylesheet for that
 *    class on the cart page (zero rules in styles-m, styles-l or any
 *    module css). Cards fall back to raw flow where the details block starts
 *    ~90px above the image bottom, so product names render over the images.
 *    Lay the cards out explicitly: responsive grid, image in flow, name and
 *    price below it.
 */

/* == 1. Vaciar carrito alignment ======================================== */

.checkout-cart-index .cart.page-title-wrapper {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center !important;
    gap: 10px 12px;
}

.checkout-cart-index .cart.page-title-wrapper .page-title {
    flex: 1 1 auto;
}

.checkout-cart-index .cart.page-title-wrapper .action.checkout {
    order: 3;
    float: none !important;
}

.checkout-cart-index .cart.page-title-wrapper .dt-cart-empty-top-form {
    order: 2;
    float: none !important;
    margin: 0 !important;
    display: flex;
}

.checkout-cart-index .cart.page-title-wrapper .dt-cart-empty-top {
    display: inline-flex !important;
    align-items: center !important;
    height: 55px !important;
    padding: 0 22px !important;
    font-size: 19px !important;
    line-height: 1 !important;
    background: transparent !important;
    color: #1a1a1a !important;
    border: 2px solid #d9d9d9 !important;
    border-radius: 3px !important;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease;
}

.checkout-cart-index .cart.page-title-wrapper .dt-cart-empty-top:hover,
.checkout-cart-index .cart.page-title-wrapper .dt-cart-empty-top:focus {
    border-color: #1a1a1a !important;
    color: #000 !important;
}

@media (max-width: 767px) {
    .checkout-cart-index .cart.page-title-wrapper .dt-cart-empty-top-form,
    .checkout-cart-index .cart.page-title-wrapper .action.checkout {
        flex: 1 1 100%;
    }

    /* primary action first, Vaciar carrito as the full-width row below it */
    .checkout-cart-index .cart.page-title-wrapper .dt-cart-empty-top-form {
        order: 3;
    }

    .checkout-cart-index .cart.page-title-wrapper .dt-cart-empty-top {
        width: 100%;
        justify-content: center;
    }
}

/* == 2. cart product sliders ============================================ */

.checkout-cart-index .products__listing-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    width: 100% !important;
}

/* owl-carousel initialized track: turn the slider into a wrapped grid.
   !important beats owl's inline styles (author-important > inline). */
.checkout-cart-index .products__listing-wrapper .owl-stage {
    display: flex !important;
    flex-wrap: wrap !important;
    width: auto !important;
    transform: none !important;
}

.checkout-cart-index .products__listing-wrapper .owl-item,
.checkout-cart-index .products__listing-wrapper .product-item {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: stretch !important;
}

@media (min-width: 640px) {
    .checkout-cart-index .products__listing-wrapper .owl-item,
    .checkout-cart-index .products__listing-wrapper .product-item {
        width: 33.3333% !important;
        flex: 0 0 33.3333% !important;
        max-width: 33.3333% !important;
    }
}

@media (min-width: 1024px) {
    .checkout-cart-index .products__listing-wrapper .owl-item,
    .checkout-cart-index .products__listing-wrapper .product-item {
        width: 25% !important;
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
}

.checkout-cart-index .products__listing-wrapper .product-item-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    position: relative !important;
    height: auto !important;
    min-height: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 100% !important;
}

/* image back into the flow */
.checkout-cart-index .products__listing-wrapper .product-grid__image-wrapper,
.checkout-cart-index .products__listing-wrapper .product-image-container {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    float: none !important;
    margin: 0 0 8px !important;
    width: 100% !important;
    max-width: 280px !important;
    padding: 0 !important;
    align-self: center !important;
}

.checkout-cart-index .products__listing-wrapper .product-item-photo {
    display: block !important;
}

.checkout-cart-index .products__listing-wrapper .product-item-photo img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    position: static !important;
}

/* details below the image, never overlapping */
.checkout-cart-index .products__listing-wrapper .product-item-details.-top,
.checkout-cart-index .products__listing-wrapper .product-item-details.-footer {
    position: static !important;
    margin: 8px 0 0 !important;
}

.checkout-cart-index .products__listing-wrapper .product-item-name {
    display: block !important;
    margin: 0 0 6px !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere;
}

.checkout-cart-index .products__listing-wrapper .product-item-link {
    position: static !important;
}

/* the theme's invisible hover overlay link duplicates the name inside the
   photo area; if its font-size:0 rule ever loses, the name paints over the
   image — remove it from the layout entirely */
.checkout-cart-index .products__listing-wrapper .product-item-inner .overlay-link {
    display: none !important;
}
