/* =========================================================
   RR Audiocar — Cart Drawer (extraído del inline en functions.php)
   Branding rojo unificado: usa --rr-red-1 / --rr-red-2 de style.css.
   ========================================================= */

/* overlay */
.rr-cart-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  z-index:999998;
  opacity:1;
  transition:opacity .25s ease;
}
.rr-cart-overlay[hidden]{
  display:none !important;
}

/* drawer */
.rr-cart-drawer{
  position:fixed;
  top:0;
  right:0;
  height:100vh;
  height:100dvh;
  width:420px;
  max-width:92vw;
  background:#fff;
  box-shadow:-12px 0 40px rgba(0,0,0,.18);
  transform:translateX(100%);
  transition:transform .32s ease;
  z-index:999999;
  display:flex;
  flex-direction:column;
}

body.rr-cart-open .rr-cart-drawer{
  transform:translateX(0);
}

/* header */
.rr-cart-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px;
  border-bottom:1px solid #eee;
  font-weight:800;
  font-size:18px;
}
.rr-cart-head h3{
  margin:0;
  font-size:inherit;
  font-weight:inherit;
}

/* close */
.rr-cart-close{
  width:36px;
  height:36px;
  border-radius:999px;
  border:0;
  background:#f3f4f6;
  font-size:22px;
  line-height:1;
  cursor:pointer;
  transition:background .15s, color .15s;
}
.rr-cart-close:hover{
  background:var(--rr-red-1, #d00000);
  color:#fff;
}

/* body */
.rr-cart-body{
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  padding:16px;
  display:flex;
  flex-direction:column;
}

.rr-cart-body .widget_shopping_cart_content{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding-right:4px;
}

.rr-cart-body .woocommerce-mini-cart{
  margin:0;
  padding:0;
  list-style:none;
}

/* mini cart items */
.rr-cart-body .woocommerce-mini-cart-item{
  display:flex !important;
  gap:12px !important;
  align-items:flex-start !important;
  padding:12px 0;
  border-bottom:1px solid #f0f0f0;
}

.rr-cart-body .woocommerce-mini-cart-item a{
  display:flex !important;
  gap:12px !important;
  align-items:flex-start !important;
  text-decoration:none !important;
  color:#111 !important;
  flex:1 1 auto;
}

.rr-cart-body .woocommerce-mini-cart-item img{
  width:70px !important;
  height:70px !important;
  object-fit:contain !important;
  border-radius:10px !important;
  display:block !important;
  flex-shrink:0 !important;
  border:1px solid #f0f0f0;
}

.rr-cart-body .woocommerce-mini-cart-item .remove,
.rr-cart-body .woocommerce-mini-cart-item .remove_from_cart_button{
  width:24px;
  height:24px;
  border-radius:50%;
  background:#f3f4f6;
  color:#6b7280 !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  text-decoration:none;
  transition:background .15s, color .15s;
  flex-shrink:0;
}
.rr-cart-body .woocommerce-mini-cart-item .remove:hover{
  background:var(--rr-red-1, #d00000);
  color:#fff !important;
}

/* quantity */
.rr-cart-body .quantity{
  font-size:13px;
  color:#666;
}

/* footer */
.rr-cart-footer{
  flex:0 0 auto;
  position:sticky;
  bottom:0;
  background:#fff;
  padding:14px 16px calc(16px + env(safe-area-inset-bottom));
  border-top:1px solid #eee;
  box-shadow:0 -10px 24px rgba(0,0,0,.08);
  z-index:3;
}

.rr-cart-footer__total{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
  font-size:16px;
}

.rr-cart-footer__label{
  font-weight:600;
  color:#111;
}

.rr-cart-footer__amount{
  font-size:22px;
  line-height:1;
  font-weight:800;
  color:#111;
}

.rr-cart-checkout{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:50px;
  background:var(--rr-red-1, #d00000);
  color:#fff !important;
  text-align:center;
  padding:0 14px;
  border-radius:12px;
  font-weight:800;
  font-size:15px;
  text-decoration:none !important;
  box-shadow:0 8px 20px rgba(208,0,0,.22);
  transition:background .15s, transform .05s;
}

.rr-cart-checkout:hover{
  background:var(--rr-red-2, #8f0000);
}
.rr-cart-checkout:active{
  transform:translateY(1px);
}

body.rr-cart-lock{
  overflow:hidden;
}

/* Mobile */
@media (max-width: 768px){
  .rr-cart-drawer{
    width:100%;
    max-width:100%;
  }
  .rr-cart-head{ padding:14px 16px; font-size:17px; }
  .rr-cart-footer{ padding:12px 14px calc(14px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce){
  .rr-cart-drawer{ transition:none; }
}
