/*
** Modal Cart — ymk-woo-extra
*/

/* ── Header: botones de navegación ──────────────────────────────────────────── */

.site-header .menu-button-container {
    width: auto !important;
}

.ymk-cart-modal-header {
    display: flex;
    align-items: center;
    width: 100%;
    font-size: var(--primary-nav--font-size-button);
    font-weight: var(--primary-nav--font-weight-button);
    justify-content: space-between;
    height: 3rem;
}

.ymk-cart-modal-title{
}

span.ymk-spacer,
span.dropdown-icon.close.toggle-text.cart-close {
    width: 24px;
    height: 24px;
    margin: 0 6px;
}

span.dropdown-icon.close.toggle-text.cart-close {
    position: relative;
    top: 0;
    left: 0;
}


/* ── Icono carrito + contador ────────────────────────────────────────────────── */

.cart-toggle span.toggle-inner {
    display: flex;
    align-items: center;
    font-size: 0;
    color: var(--header--color-text);
}

.cart-toggle .cart-count {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 1;
    height: 1rem;
    width: auto;
    left: -0.2rem;
    font-size: small;
    font-weight: 600;
    border-radius: 100%;
    margin-left: calc(0.25 * var(--global--spacing-unit));
}

.cart-toggle .cart-count a {
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
}

.site span.cart-count a.cart-contents.button:not(:hover):not(:active):not(.has-background) {
    background-color: var(--header--color-text);
    color: var(--header--color-background);
}

span.cart-count a.cart-contents {
    height: auto;
    min-width: 2.25rem;
    padding: 0.3rem;
    background-color: var(--header--color-text);
}

/* Modal system styles → modal-style.css */

/* ── Items del mini carrito ──────────────────────────────────────────────────── */

.modal-cart li {
    border-top: 0.1rem solid #cecece;
    min-height: 60px;
}

.widget_shopping_cart .cart_list .mini_cart_item > a {
    display: flex;
    align-items: center;
    column-gap: 1rem;
    text-decoration: none;
    flex-grow: 1;
}

.widget_shopping_cart .cart_list img {
    display: block;
    float: none;
    max-width: 45px !important;
    height: auto !important;
    border-radius: 50%;
}

.widget_shopping_cart .cart_list .mini_cart_item > img {
    margin-right: 1rem;
}

.widget_shopping_cart .cart_list li span.quantity {
    display: block;
    flex: 2;
    font-size: 12px;
    margin: 0;
}

/* ── Botón eliminar ──────────────────────────────────────────────────────────── */
.cart-modal-inner .widget .product_list_widget li a.remove {
    margin-right: 0;
    line-height: unset;
    background: transparent;
    color: var(--global--color-primary)
}

a.remove.remove_from_cart_button {
    right: 0;
    order: 1;
    padding: 6px;
    font-size: 24px;
    line-height: 14px;
    margin: 0;
    color: black;
    transition: all 0.47s cubic-bezier(0.3, 1, 0.3, 0.95);
}

@media (hover: hover) {
    .cart-modal-inner .widget .product_list_widget li a.remove:hover {
        background: black;
    }
}

/* ── Modal lateral (side) ────────────────────────────────────────────────────── */

.widget.woocommerce.widget_shopping_cart {
    max-height: 100%;
    flex-grow: 1;
}

.side .widget_shopping_cart_content {
    margin-top: 0;
    min-height: 100%;
    max-height: 100%;
    overflow-y: auto;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    gap: 0px;
}

.woocommerce-mini-cart {
    position: relative;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    flex-grow: 1;
    align-items: unset;
    overflow-y: auto;
    height: calc(100vh - 300px);
    width: 100%;
    padding: 0;
    margin: 0 !important;
}

.side .mini_cart_item:before, 
.side .mini_cart_item:after {
    display:none !important
}

.side .mini_cart_item {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: space-between;
    column-gap: 1rem;
}

.side .mini_cart_item > * {
    display: flex;
    align-items: center;
    line-height: 1;
}

.side .widget .product_list_widget li a.remove {
    justify-content: center;
    /* position: absolute; */
    right: 0;
    min-width: 32px;
    min-height: 32px;
    max-width: 2rem;
    flex: 1;
    margin: 0;
    z-index: 1;
    font-weight: 100;
}

.side .widget .product_list_widget li span.quantity {
    flex: 0;
    margin: 0;
    text-align: right;
}

/* Orden inverso de items (último añadido primero) */
.side .mini_cart_item:first-child        { order:   1; }
.side .mini_cart_item:last-child         { order: -119; }
.side .mini_cart_item:nth-last-child(2)  { order: -118; }
.side .mini_cart_item:nth-last-child(3)  { order: -117; }
.side .mini_cart_item:nth-last-child(4)  { order: -116; }
.side .mini_cart_item:nth-last-child(5)  { order: -115; }
.side .mini_cart_item:nth-last-child(6)  { order: -114; }
.side .mini_cart_item:nth-last-child(7)  { order: -113; }

/* ── Total y botones ─────────────────────────────────────────────────────────── */

p.woocommerce-mini-cart__total.total {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    line-height: 5.5;
    margin: 0;
}

p.woocommerce-mini-cart__total.total::before {
    content: " ";
    display: block;
    width: 100%;
    height: 1px;
    background: #18181a;
    margin-top: 1rem;
}

p.woocommerce-mini-cart__buttons.buttons {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

/* ── Cart wrapper ────────────────────────────────────────────────────────────── */

.modal-cart {
    position: relative;
}

.side .cart-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    width: 100%;
    margin: 0 auto;
    height: 100%;
    padding: 0 1rem 1rem;
}

.side .modal-cart {
    /* left: auto; */
    /* width: 100%; */
    /* height: 100%; */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* position: relative; */
    /* row-gap: 1rem; */
    min-height: 100%;
}

.side .modal-cart .widget-content {
    min-height: 100%;
    display: flex;
}

.side .modal-cart > li > .ancestor-wrapper > a {
    font-size: 2.4rem;
    padding: 2.5rem 0;
}

.cart-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4.4rem 0;
}

.mobile-cart   { display: none; }
.expanded-cart { display: block; }

/* ── Botones del carrito ─────────────────────────────────────────────────────── */

.cart-modal .widget_shopping_cart a.button {
    flex: 1;
    padding: var(--button--padding-vertical) var(--button--padding-horizontal);
    font-family: var(--button--font-family);
    font-size: var(--button--font-size);
    font-weight: var(--button--font-weight);
    line-height: var(--button--line-height);
    color: var(--wp--preset--color--buttontext) !important;
    background-color: var(--wp--preset--color--buttonback, var(--global--color-primary)) !important;
    border-radius: var(--button--border-radius);
    cursor: pointer;
}

@media (hover: hover) {
    .cart-modal .widget_shopping_cart .button:hover {
        background-color: transparent !important;
        color: var(--wp--preset--color--buttonback) !important;
        border: var(--button--border-width) solid var(--wp--preset--color--buttonback);
        text-decoration: none !important;
    }
}

a.button.wc-forward:not(.checkout) {
    background-color: transparent !important;
    color: var(--wp--preset--color--buttonback) !important;
    border: var(--button--border-width) solid var(--wp--preset--color--buttonback) !important;
    text-decoration: none !important;
}

.hentry a.added_to_cart.wc-forward {
    display: none;
}

/* v2 */
