/* ═══════════════════════════════════════════════════════════════════
   rwe-side-cart — CSS del carrito lateral
   R1: sacado del <style> inline (#uid scope, 3 ids: -trigger/-overlay/-panel).
   Los 3 ids SE MANTIENEN en el HTML porque el JS engancha por getElementById.
   El CSS cuelga de clases base fijas añadidas a esos 3 elementos:
     .rwe-cart-trigger / .rwe-cart-overlay / .rwe-cart-panel
   El lado (right/left) → clase modificadora .rwe-cart-right / .rwe-cart-left
   (la propiedad left/right:0 es un NOMBRE de propiedad, no sirve variable;
    y el translateX cambia de signo → se fija en cada clase).

   Variables (inyectadas en el wrapper del trigger y del panel):
     --rwe-cart-ff        fuente
     --rwe-cart-ic        color del icono
     --rwe-cart-bbg       fondo del badge
     --rwe-cart-bcol      color del badge
     --rwe-cart-w         ancho del panel px
     --rwe-cart-pbg       fondo del panel
     --rwe-cart-tcol      color del texto
     --rwe-cart-accent    acento (barra envío gratis)
     --rwe-cart-cobg      fondo del botón checkout
     --rwe-cart-cocol     texto del botón checkout
   ═══════════════════════════════════════════════════════════════════ */

.rwe-cart-trigger{
    display:inline-flex; align-items:center; gap:8px; cursor:pointer;
    color:var(--rwe-cart-ic,#1a1a1a);
    font-family:var(--rwe-cart-ff,inherit);
    background:none!important; border:none; padding:0;
    line-height:1; text-decoration:none!important; box-shadow:none!important;
    vertical-align:middle;
}
/* Hover explícito: mantiene el color del icono (o lo lleva al acento),
   anulando el hover del tema/Woo (evita el fondo rosa heredado). */
.rwe-cart-trigger:hover,
.rwe-cart-trigger:focus{
    color:var(--rwe-cart-accent,var(--rwe-cart-ic,#1a1a1a))!important;
    background:none!important; box-shadow:none!important; outline:none;
}
.rwe-cart-trigger .rwe-cart-ico{ position:relative; display:inline-flex; }
.rwe-cart-trigger .rwe-cart-ico svg{ display:block; }
.rwe-cart-trigger .rwe-cart-badge{
    position:absolute; top:-8px; right:-10px; min-width:18px; height:18px; padding:0 5px;
    background:var(--rwe-cart-bbg,#1a1a1a); color:var(--rwe-cart-bcol,#fff)!important;
    border-radius:50px; font-size:11px; font-weight:700;
    display:flex; align-items:center; justify-content:center; line-height:1;
}
.rwe-cart-trigger .rwe-cart-amt{ font-size:14px; font-weight:600; }

.rwe-cart-overlay{
    position:fixed; inset:0; background:rgba(0,0,0,0.45);
    opacity:0; visibility:hidden; transition:opacity .3s ease,visibility .3s ease; z-index:99998;
}
.rwe-cart-overlay.open{ opacity:1; visibility:visible; }

.rwe-cart-panel{
    position:fixed; top:0; width:var(--rwe-cart-w,400px); max-width:92vw; height:100%;
    background:var(--rwe-cart-pbg,#fff); color:var(--rwe-cart-tcol,#1a1a1a);
    z-index:99999; box-shadow:0 0 40px rgba(0,0,0,0.18);
    transition:transform .32s cubic-bezier(.4,0,.2,1);
    display:flex; flex-direction:column; font-family:var(--rwe-cart-ff,inherit);
}
.rwe-cart-panel.rwe-cart-right{ right:0; transform:translateX(100%); }
.rwe-cart-panel.rwe-cart-left{  left:0;  transform:translateX(-100%); }
.rwe-cart-panel.open{ transform:translateX(0); }

.rwe-cart-panel .rwe-cart-head{ display:flex; align-items:center; justify-content:space-between; padding:20px 22px; border-bottom:1px solid #eee; }
.rwe-cart-panel .rwe-cart-head h3{ margin:0; font-size:16px; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; }
.rwe-cart-panel .rwe-cart-close{ background:none; border:none; font-size:26px; line-height:1; cursor:pointer; color:var(--rwe-cart-tcol,#1a1a1a); padding:0; }
.rwe-cart-panel .rwe-cart-scroll{ flex:1; overflow-y:auto; padding:18px 22px; }
.rwe-cart-panel .rwe-cart-foot{ border-top:1px solid #eee; padding:18px 22px; }

/* Barra envío gratis */
.rwe-cart-panel .rwe-free{ margin-bottom:16px; }
.rwe-cart-panel .rwe-free-txt{ font-size:13px; margin:0 0 8px; }
.rwe-cart-panel .rwe-free-track{ height:6px; background:#eee; border-radius:50px; overflow:hidden; }
.rwe-cart-panel .rwe-free-fill{ height:100%; background:var(--rwe-cart-accent,#1a1a1a); border-radius:50px; transition:width .4s ease; }

/* Mini-cart de Woo dentro del panel */
.rwe-cart-panel ul.woocommerce-mini-cart{ list-style:none; margin:0; padding:0; }
.rwe-cart-panel li.woocommerce-mini-cart-item{ display:flex; gap:12px; padding:14px 0; border-bottom:1px solid #f2f2f2; position:relative; align-items:flex-start; }
.rwe-cart-panel li.woocommerce-mini-cart-item img{ width:64px; height:64px; object-fit:cover; border-radius:8px; order:-1; margin:0; }
.rwe-cart-panel li.woocommerce-mini-cart-item a:not(.remove){ color:var(--rwe-cart-tcol,#1a1a1a); text-decoration:none; font-size:14px; font-weight:600; display:block; }
.rwe-cart-panel li.woocommerce-mini-cart-item .quantity{ font-size:13px; color:#888; display:block; margin-top:2px; }
.rwe-cart-panel a.remove{ position:absolute; top:14px; right:0; width:20px; height:20px; line-height:18px; text-align:center; border-radius:50%; background:#f2f2f2; color:#999!important; font-size:14px; text-decoration:none; }
.rwe-cart-panel .woocommerce-mini-cart__total{ display:flex; justify-content:space-between; font-size:15px; font-weight:700; margin:0 0 14px; padding-top:6px; }
.rwe-cart-panel .woocommerce-mini-cart__buttons{ display:flex; flex-direction:column; gap:10px; margin:0; }
.rwe-cart-panel .woocommerce-mini-cart__buttons a{ display:block; text-align:center; padding:13px; border-radius:50px; font-size:13px; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; text-decoration:none; }
.rwe-cart-panel .woocommerce-mini-cart__buttons a:not(.checkout){ background:#f4f4f4; color:var(--rwe-cart-tcol,#1a1a1a); }
.rwe-cart-panel .woocommerce-mini-cart__buttons a.checkout{ background:var(--rwe-cart-cobg,#1a1a1a); color:var(--rwe-cart-cocol,#fff); }
.rwe-cart-panel .woocommerce-mini-cart__empty-message{ color:#888; text-align:center; padding:40px 0; }

@media(prefers-reduced-motion:reduce){
    .rwe-cart-overlay,
    .rwe-cart-panel,
    .rwe-cart-panel .rwe-free-fill{ transition:none; }
}
