.mw-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .48);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    z-index: 19990;
}

.mw-cart-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.mw-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 94vw);

    /*
     * El drawer crece según su contenido.
     * Solo cuando el contenido supera la pantalla
     * se limita su altura.
     */
    height: auto;
    max-height: 92vh;

    background: #fff;
    box-shadow: -12px 0 35px rgba(0, 0, 0, .22);
    transform: translateX(105%);
    transition: transform .28s ease;
    z-index: 20000;

    display: flex;
    flex-direction: column;

    overflow: hidden;
    color: #212529;
}

.mw-cart-drawer.is-open {
    transform: translateX(0);
}

.mw-cart-header {
    padding: 20px 22px 17px;
    background: #15191d;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mw-cart-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.mw-cart-title i {
    margin-right: 8px;
}

.mw-cart-subtitle {
    margin-top: 3px;
    color: #adb5bd;
    font-size: .82rem;
}

.mw-cart-close {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 5px 8px;
}

.mw-cart-notice {
    margin: 14px 18px 0;
    padding: 10px 12px;
    background: #e9f7ef;
    border: 1px solid #badbcc;
    border-radius: 8px;
    color: #146c43;
    font-size: .84rem;
}

.mw-cart-loading,
.mw-cart-empty {
    padding: 45px 25px;
    text-align: center;
    color: #6c757d;
}

.mw-cart-empty {
    flex-direction: column;
    gap: 7px;
}

.mw-cart-empty:not([hidden]) {
    display: flex;
}

.mw-cart-empty i {
    font-size: 2rem;
    margin-bottom: 5px;
    color: #adb5bd;
}

.mw-cart-items {
    /*
     * No rellenar artificialmente el drawer.
     * Crece según la cantidad de productos y
     * usa scroll únicamente cuando sea necesario.
     */
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 18px 18px;
}

.mw-cart-item {
    padding: 17px 2px;
    border-bottom: 1px solid #e9ecef;
}

.mw-cart-item-label {
    color: #198754;
    text-transform: uppercase;
    font-size: .70rem;
    font-weight: 800;
    letter-spacing: .05em;
    margin-bottom: 7px;
}

.mw-cart-item-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #212529;
}

.mw-cart-item-location {
    margin-top: 2px;
    color: #6c757d;
    font-size: .82rem;
}

.mw-cart-item-details {
    margin-top: 10px;
    color: #495057;
    font-size: .82rem;
    line-height: 1.55;
}

.mw-cart-item-bottom {
    margin-top: 11px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.mw-cart-item-duration {
    color: #6c757d;
    font-size: .78rem;
    line-height: 1.45;
    flex: 1 1 auto;
    min-width: 0;
}

.mw-cart-item-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: #212529;
    white-space: nowrap;
    flex: 0 0 auto;
    text-align: right;
}

.mw-cart-footer {
    padding: 18px 20px 20px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}

.mw-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    text-transform: uppercase;
    font-weight: 700;
}

.mw-cart-total strong {
    font-size: 1.35rem;
}

.mw-cart-total small {
    font-size: .68rem;
    color: #6c757d;
}

.mw-cart-checkout {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: #198754;
    color: #fff;
    padding: 13px 16px;
    font-weight: 700;
    transition: background .2s ease;
}

.mw-cart-checkout:hover {
    background: #157347;
}

.mw-cart-checkout i {
    margin-left: 7px;
}

.mw-cart-secure {
    margin-top: 10px;
    text-align: center;
    color: #6c757d;
    font-size: .72rem;
}

body.mw-cart-open {
    overflow: hidden;
}

@media (max-width: 576px) {
    .mw-cart-drawer {
        width: 100%;
        max-height: 100dvh;
    }

    .mw-cart-header {
        padding: 17px 18px 15px;
    }

    .mw-cart-items {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Acción secundaria: eliminar un espacio del carrito */
.mw-cart-remove {
    margin-top: .65rem;
    padding: .25rem 0;
    border: 0;
    background: transparent;
    font-size: .78rem;
    color: #6c757d;
    cursor: pointer;
}

.mw-cart-remove:hover {
    color: #dc3545;
}

.mw-cart-remove:disabled {
    opacity: .45;
    cursor: wait;
}

.mw-cart-remove i {
    margin-right: .25rem;
}



/* ==========================================================
   PAYPAL CHECKOUT - TRANSICION ESTABLE
   ========================================================== */

.mw-cart-checkout.is-loading {
    cursor: wait;
    opacity: .85;
}

.mw-cart-checkout.is-loading:hover {
    background: #198754;
}

.mw-paypal-checkout {
    width: 100%;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;

    opacity: 0;
    transform: translateY(-6px);

    transition:
        max-height .32s ease,
        margin-top .32s ease,
        opacity .20s ease,
        transform .20s ease;
}

.mw-paypal-checkout.is-rendering {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
}

.mw-paypal-checkout.is-ready {
    max-height: 360px;
    margin-top: 12px;
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 576px) {

    .mw-paypal-checkout.is-ready {
        max-height: 420px;
    }
}


/* ==========================================================
   MEJENGAWEB ADS - DURACION POR MESES
   ========================================================== */

.mw-cart-ad-commercial {
    margin-top: 10px;
    padding: 10px;

    border:
        1px solid rgba(148,163,184,.18);

    border-radius: 9px;

    background:
        rgba(15,23,42,.035);
}


.mw-cart-ad-price-row,
.mw-cart-months-row,
.mw-cart-ad-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
}


.mw-cart-ad-price-row {
    margin-bottom: 8px;

    font-size: .76rem;
}


.mw-cart-ad-price-row span {
    color: #64748b;
}


.mw-cart-ad-price-row strong {
    color: #0f172a;
}


.mw-cart-months-label {
    margin: 0;

    color: #334155;

    font-size: .76rem;
    font-weight: 700;
}


.mw-cart-months-control {
    display: flex;
    align-items: center;

    overflow: hidden;

    border:
        1px solid #cbd5e1;

    border-radius: 7px;

    background: #ffffff;
}


.mw-cart-months-button {
    width: 32px;
    height: 30px;

    border: 0;

    background: #f1f5f9;

    color: #0f172a;

    font-size: 1rem;
    font-weight: 700;

    cursor: pointer;
}


.mw-cart-months-button:hover {
    background: #e2e8f0;
}


.mw-cart-months-button:disabled {
    opacity: .55;
    cursor: wait;
}


.mw-cart-months-input {
    width: 45px;
    height: 30px;

    padding: 0 4px;

    border: 0;
    border-left:
        1px solid #cbd5e1;
    border-right:
        1px solid #cbd5e1;

    outline: 0;

    background: #ffffff;

    color: #0f172a;

    text-align: center;

    font-size: .78rem;
    font-weight: 700;

    appearance: textfield;
}


.mw-cart-months-input::-webkit-inner-spin-button,
.mw-cart-months-input::-webkit-outer-spin-button {
    margin: 0;

    -webkit-appearance: none;
}


.mw-cart-ad-summary {
    margin-top: 8px;
    padding-top: 8px;

    border-top:
        1px solid rgba(148,163,184,.18);

    font-size: .71rem;
}


.mw-cart-ad-summary span {
    color: #64748b;
}


.mw-cart-ad-summary strong {
    color: #0f172a;

    font-size: .78rem;
}


@media (max-width: 575px) {

    .mw-cart-ad-summary {
        align-items: flex-start;
        flex-direction: column;

        gap: 4px;
    }
}


/* ==========================================================
   MEJENGAWEB ADS - MESES SELECTOR
   ========================================================== */

.mw-cart-ad-commercial {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.mw-cart-ad-price-row,
.mw-cart-months-row,
.mw-cart-ad-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mw-cart-ad-price-row {
    margin-bottom: 9px;
    font-size: .78rem;
}

.mw-cart-ad-price-row span {
    color: #64748b;
}

.mw-cart-ad-price-row strong {
    color: #1f2937;
}

.mw-cart-months-label {
    margin: 0;
    color: #334155;
    font-size: .78rem;
    font-weight: 700;
}

.mw-cart-months-control {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
}

.mw-cart-months-button {
    width: 34px;
    height: 31px;
    border: 0;
    background: #eef2f7;
    color: #1f2937;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
}

.mw-cart-months-button:hover {
    background: #e2e8f0;
}

.mw-cart-months-button:disabled {
    opacity: .55;
    cursor: wait;
}

.mw-cart-months-input {
    width: 46px;
    height: 31px;
    padding: 0 4px;
    border: 0;
    border-left: 1px solid #cbd5e1;
    border-right: 1px solid #cbd5e1;
    outline: 0;
    text-align: center;
    font-size: .8rem;
    font-weight: 800;
    color: #111827;
    background: #fff;
    appearance: textfield;
}

.mw-cart-months-input::-webkit-inner-spin-button,
.mw-cart-months-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mw-cart-ad-summary {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid #e2e8f0;
    font-size: .72rem;
}

.mw-cart-ad-summary span {
    color: #64748b;
}

.mw-cart-ad-summary strong {
    color: #111827;
    font-size: .8rem;
}

@media (max-width: 575px) {
    .mw-cart-ad-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}


/* MW SIMPLE MONTH INPUT */

.mw-cart-month-control {
    margin: 12px 0 10px;
    padding: 10px 12px;
    border: 1px solid #dbe3ea;
    border-radius: 8px;
    background: #f8fafc;
}

.mw-cart-month-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mw-cart-month-line label {
    margin: 0;
    font-size: .8rem;
    font-weight: 700;
    color: #334155;
}

.mw-cart-month-line input {
    width: 72px;
    height: 34px;
    padding: 4px 8px;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    text-align: center;
    font-size: .9rem;
    font-weight: 800;
}

.mw-cart-month-summary {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid #e2e8f0;
    font-size: .74rem;
}

.mw-cart-month-summary span {
    color: #64748b;
}

.mw-cart-month-summary strong {
    color: #111827;
}


/* ==========================================================
   MW CART POSITION + TAX
   ========================================================== */

.mw-cart-slot-reference {
    margin-top: 5px;
    color: #0f766e;
    font-size: .76rem;
    font-weight: 800;
}

.mw-cart-slot-reference i {
    margin-right: 5px;
}


.mw-cart-tax-summary {
    margin: 0 0 14px;
    padding: 10px 0;

    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;

    font-size: .75rem;
}

.mw-cart-tax-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;

    padding: 2px 0;
}

.mw-cart-tax-summary span {
    color: #64748b;
}

.mw-cart-tax-summary strong {
    color: #334155;
}


/* ==========================================================
   MW CART COUPON
   ========================================================== */

.mw-cart-coupon {
    margin: 12px 0;
    padding: 12px;

    border: 1px solid #e2e8f0;
    border-radius: 9px;

    background: #f8fafc;
}

.mw-cart-coupon-title {
    margin-bottom: 8px;

    font-size: .78rem;
    font-weight: 800;

    color: #334155;
}

.mw-cart-coupon-form {
    display: flex;
    gap: 7px;
}

.mw-cart-coupon-form input {
    flex: 1;
    min-width: 0;

    height: 36px;

    padding: 6px 10px;

    border: 1px solid #cbd5e1;
    border-radius: 6px;

    background: #fff;

    font-size: .78rem;
    font-weight: 700;

    text-transform: uppercase;
}

.mw-cart-coupon-form button,
.mw-cart-coupon-applied button {
    border: 0;
    border-radius: 6px;

    padding: 6px 12px;

    background: #111827;
    color: #fff;

    font-size: .74rem;
    font-weight: 800;

    cursor: pointer;
}

.mw-cart-coupon-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    font-size: .76rem;
}

.mw-cart-coupon-applied i {
    color: #059669;
    margin-right: 4px;
}

.mw-cart-coupon-saving {
    display: flex;
    justify-content: space-between;

    margin-top: 9px;
    padding-top: 9px;

    border-top: 1px solid #e2e8f0;

    font-size: .75rem;
}

.mw-cart-coupon-saving span {
    color: #64748b;
}

.mw-cart-coupon-saving strong {
    color: #059669;
}

/* ==========================================================
   CUPON UX REFINEMENT
   ========================================================== */

.mw-cart-coupon {
    margin: 0 0 14px;
    padding: 12px;
}

.mw-cart-coupon-success {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.mw-cart-coupon-check {
    padding-top: 2px;
    color: #059669;
    font-size: 1rem;
}

.mw-cart-coupon-info {
    flex: 1;
    min-width: 0;
}

.mw-cart-coupon-code {
    font-size: .78rem;
    font-weight: 800;
    color: #111827;
}

.mw-cart-coupon-code span {
    margin-left: 3px;
    font-weight: 600;
    color: #64748b;
}

.mw-cart-coupon-benefit {
    margin-top: 3px;
    font-size: .78rem;
    font-weight: 800;
    color: #059669;
}

.mw-cart-coupon-saving {
    margin-top: 5px;
    padding-top: 0;
    border-top: 0;
    justify-content: flex-start;
    gap: 6px;
}

.mw-cart-coupon-saving span {
    color: #64748b;
}

.mw-cart-coupon-saving strong {
    color: #059669;
}

.mw-cart-coupon-remove {
    flex: 0 0 auto;
    background: transparent !important;
    color: #64748b !important;
    padding: 3px 4px !important;
    font-size: .70rem !important;
}

.mw-cart-coupon-remove:hover {
    color: #111827 !important;
}

/* ==========================================================
   MW CART SUMMARY V2
   ========================================================== */

.mw-cart-footer .mw-cart-coupon {
    margin: 0 0 16px;
}

.mw-cart-summary {
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.mw-cart-summary-title {
    margin-bottom: 12px;

    font-size: .78rem;
    font-weight: 800;

    color: #334155;
    text-transform: uppercase;
    letter-spacing: .025em;
}

.mw-cart-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    padding: 6px 0;

    font-size: .76rem;
    color: #64748b;
}

.mw-cart-summary-row strong {
    color: #334155;
    font-weight: 800;
    white-space: nowrap;
}

.mw-cart-summary-row small {
    font-size: .62rem;
    color: #64748b;
}

.mw-cart-summary-discount span,
.mw-cart-summary-discount strong {
    color: #059669;
}

.mw-cart-summary .mw-cart-total {
    margin-top: 9px;
    padding-top: 13px;

    border-top: 1px solid #dbe3ea;
}

.mw-cart-summary .mw-cart-total > span {
    font-size: .88rem;
    font-weight: 900;
    text-transform: uppercase;
}

.mw-cart-summary .mw-cart-total strong {
    font-size: 1.28rem;
    font-weight: 900;
}

/* ==========================================================
   CUPON REMOVE LINK - UX FINAL
   ========================================================== */

.mw-cart-coupon-remove {
    appearance: none !important;
    -webkit-appearance: none !important;

    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;

    background: transparent !important;

    padding: 2px 0 !important;
    margin: 0 !important;

    color: #64748b !important;

    font-size: .70rem !important;
    font-weight: 600 !important;

    text-decoration: underline;
    text-underline-offset: 2px;

    cursor: pointer;
}

.mw-cart-coupon-remove:hover {
    color: #111827 !important;
}

.mw-cart-coupon-remove:focus {
    outline: 2px solid currentColor !important;
    outline-offset: 3px !important;
}


/* ==========================================================
   MW CART FIXED VIEWPORT UX V1
   ========================================================== */

/*
 * El drawer no crece con los productos.
 * Siempre ocupa el viewport disponible.
 */
.mw-cart-drawer {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
}

/*
 * Header y mensajes no participan del scroll de productos.
 */
.mw-cart-header,
.mw-cart-notice {
    flex: 0 0 auto;
}

/*
 * Esta es la ÚNICA zona principal que crece y hace scroll.
 */
.mw-cart-items {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

/*
 * Total, resumen, cupón y CTA permanecen abajo.
 */
.mw-cart-footer {
    flex: 0 0 auto;
}

/* ==========================================================
   CUPON COLLAPSIBLE
   ========================================================== */

.mw-cart-coupon {
    padding: 0;
    margin: 0 0 12px;
}

.mw-cart-coupon-details {
    margin: 0;
}

.mw-cart-coupon-toggle {
    list-style: none;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding: 10px 12px;

    border: 1px solid #e2e8f0;
    border-radius: 8px;

    background: #fff;
    color: #475569;

    font-size: .78rem;
    font-weight: 700;

    cursor: pointer;
    user-select: none;
}

.mw-cart-coupon-toggle::-webkit-details-marker {
    display: none;
}

.mw-cart-coupon-toggle > span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.mw-cart-coupon-toggle:hover {
    background: #f8fafc;
    color: #0f172a;
}

.mw-cart-coupon-chevron {
    font-size: .68rem;
    transition: transform .18s ease;
}

.mw-cart-coupon-details[open]
.mw-cart-coupon-chevron {
    transform: rotate(180deg);
}

.mw-cart-coupon-panel {
    padding: 10px 0 0;
}

/*
 * Cuando YA existe un cupón aplicado,
 * conservamos su presentación actual.
 */
.mw-cart-coupon-success {
    padding: 12px;
}

/*
 * En móvil aprovechamos todo el alto disponible.
 */
@media (max-width: 576px) {
    .mw-cart-drawer {
        height: 100dvh;
        max-height: 100dvh;
    }

    .mw-cart-footer {
        padding: 14px 16px 16px;
    }
}
