/*
 * UPSEX — Mini carrito compacto V2.
 * Exclusivo para tablet y PC.
 * No modifica móvil ni la lógica interna del envío.
 */

@media screen and (min-width:768px){

    /*
     * Fondo menos pesado.
     */
    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-backdrop-v1{
        background:rgba(35,27,25,.38)!important;
        backdrop-filter:blur(2px)!important;
        -webkit-backdrop-filter:blur(2px)!important;
    }

    /*
     * Tarjeta flotante compacta.
     * Ya no ocupa toda la altura de la pantalla.
     */
    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-panel-v1{
        top:72px!important;
        right:18px!important;
        bottom:auto!important;

        width:min(408px,calc(100vw - 28px))!important;
        height:auto!important;
        min-height:0!important;
        max-height:calc(100dvh - 92px)!important;

        border:1px solid rgba(184,138,0,.24)!important;
        border-radius:22px!important;

        background:
            radial-gradient(
                circle at 100% 0,
                rgba(243,238,255,.86),
                transparent 34%
            ),
            linear-gradient(
                145deg,
                #fffdf8 0%,
                #fffaf1 58%,
                #f8f4ff 100%
            )!important;

        box-shadow:
            0 24px 64px rgba(29,22,20,.28),
            0 5px 18px rgba(184,138,0,.11)!important;

        animation:upsexCompactCartEnterV2 .20s ease-out both!important;
    }

    @keyframes upsexCompactCartEnterV2{
        from{
            opacity:.45;
            transform:translateY(-7px) scale(.985);
        }

        to{
            opacity:1;
            transform:translateY(0) scale(1);
        }
    }

    /*
     * Encabezado más compacto.
     */
    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-header-v1{
        min-height:66px!important;
        padding:12px 14px 11px!important;

        border-bottom:1px solid rgba(184,138,0,.16)!important;

        background:rgba(255,253,248,.94)!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-heading-v1{
        gap:2px!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-heading-v1 small{
        color:#8f6b00!important;

        font-size:9.5px!important;
        line-height:1.1!important;
        letter-spacing:.48px!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-heading-v1 strong{
        color:#2d2321!important;

        font-size:19px!important;
        line-height:1.12!important;
        letter-spacing:-.25px!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-close-v1{
        flex-basis:35px!important;

        width:35px!important;
        height:35px!important;
        min-width:35px!important;
        min-height:35px!important;

        border-radius:11px!important;

        color:#4d423f!important;

        font-size:24px!important;

        box-shadow:0 4px 11px rgba(65,49,43,.07)!important;
    }

    /*
     * Cuerpo de altura automática.
     */
    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1{
        flex:0 1 auto!important;

        min-height:0!important;
        max-height:calc(100dvh - 168px)!important;

        padding:11px 12px 12px!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1
    > li
    + li{
        margin-top:10px!important;
        padding-top:10px!important;
    }

    /*
     * Productos.
     */
    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1
    .table-striped
    > tbody
    > tr
    > td{
        padding:8px 4px!important;

        font-size:12px!important;
        line-height:1.3!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1
    td.cart-image{
        width:65px!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1
    td.cart-image img{
        width:56px!important;
        height:56px!important;
        max-width:56px!important;

        padding:3px!important;

        border-radius:11px!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1
    td.cart-info
    > a{
        margin-bottom:4px!important;

        color:#2d2321!important;

        font-size:12.5px!important;
        line-height:1.25!important;
        font-weight:800!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1
    td.cart-info p{
        gap:4px!important;
        margin-top:4px!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1
    .cart-quantity{
        font-size:10.5px!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1
    .cart-product-price{
        color:#9a7200!important;

        font-size:11.5px!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1
    .table-striped td:last-child{
        width:34px!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1
    .button-cart-remove{
        width:27px!important;
        min-width:27px!important;
        height:27px!important;
        min-height:27px!important;

        border-radius:8px!important;
    }

    /*
     * Nuevo aviso de envío resumido.
     */
    html body
    #upsex-cart-drawer-v1
    .upsex-cart-shipping-row-v2{
        margin-top:8px!important;
        padding:0!important;

        border-top:0!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-shipping-note-v2{
        display:flex!important;
        align-items:center!important;
        gap:9px!important;

        width:100%!important;

        margin:0!important;
        padding:9px 10px!important;

        border:1px solid rgba(184,138,0,.22)!important;
        border-radius:12px!important;

        background:
            linear-gradient(
                135deg,
                rgba(255,250,238,.98),
                rgba(247,241,255,.94)
            )!important;

        color:#4d423f!important;

        box-shadow:
            inset 0 1px 0 rgba(255,255,255,.94),
            0 4px 12px rgba(73,54,35,.05)!important;

        box-sizing:border-box!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-shipping-icon-v2{
        display:inline-flex!important;
        flex:0 0 32px!important;
        align-items:center!important;
        justify-content:center!important;

        width:32px!important;
        height:32px!important;

        border-radius:10px!important;

        background:#2f2421!important;
        color:#d2ad52!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-shipping-icon-v2 svg{
        display:block!important;

        width:17px!important;
        height:17px!important;

        fill:none!important;
        stroke:currentColor!important;
        stroke-width:1.9!important;
        stroke-linecap:round!important;
        stroke-linejoin:round!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-shipping-copy-v2{
        display:flex!important;
        flex:1 1 auto!important;
        flex-direction:column!important;
        gap:2px!important;

        min-width:0!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-shipping-copy-v2 strong{
        color:#2d2321!important;

        font-size:12px!important;
        font-weight:850!important;
        line-height:1.15!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-shipping-copy-v2 span{
        color:#6a5d59!important;

        font-size:10.5px!important;
        font-weight:650!important;
        line-height:1.25!important;
        white-space:normal!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-shipping-copy-v2 b{
        color:#8f6b00!important;
        font-weight:850!important;
    }

    /*
     * Totales.
     */
    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1
    .table-bordered
    > tbody
    > tr
    > td{
        padding:4px 3px!important;

        font-size:11.5px!important;
        line-height:1.25!important;
    }

    /*
     * Botón Bold bien separado.
     */
    html body
    #upsex-cart-drawer-v1
    .upsex-cart-bold-wrap-v2{
        margin:9px 0 8px!important;
    }

    html body
    #upsex-cart-drawer-v1
    a.btn-bold-mini.upsex-cart-bold-v2{
        display:flex!important;
        align-items:center!important;
        justify-content:center!important;
        gap:5px!important;

        width:100%!important;
        min-height:39px!important;

        margin:0!important;
        padding:8px 12px!important;

        border-radius:11px!important;

        font-size:12px!important;
        line-height:1!important;
        font-weight:650!important;

        text-decoration:none!important;
    }

    html body
    #upsex-cart-drawer-v1
    a.btn-bold-mini.upsex-cart-bold-v2 strong{
        margin:0!important;

        color:#fff!important;

        font-size:13px!important;
        font-weight:850!important;
        line-height:1!important;
    }

    /*
     * Botones inferiores.
     */
    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1
    p.text-right{
        gap:7px!important;

        margin-top:8px!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1
    p.text-right
    > a{
        min-height:38px!important;
        padding:7px 8px!important;

        border-radius:10px!important;

        font-size:10.5px!important;
        line-height:1.15!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1
    p.text-right
    > a:first-child{
        border-color:#392c29!important;
        background:#392c29!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1
    p.text-right
    > a:last-child{
        border-color:#b88a00!important;
        background:#b88a00!important;
    }
}

@media screen and (min-width:768px) and (max-width:991px){

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-panel-v1{
        top:64px!important;
        right:10px!important;

        width:min(385px,calc(100vw - 20px))!important;
        max-height:calc(100dvh - 78px)!important;
    }

    html body
    #upsex-cart-drawer-v1
    .upsex-cart-drawer-body-v1{
        max-height:calc(100dvh - 150px)!important;
    }
}

/*
 * Seguridad: móvil permanece intacto.
 */
@media screen and (max-width:767px){

    #upsex-cart-drawer-v1.upsex-cart-drawer-compact-v2{
        display:none!important;
    }
}
