/* ===== Overlay + Drawer (con animación) ===== */
.mc-cart-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.5);
  opacity:0; visibility:hidden; transition:opacity .30s ease;
  z-index:100007;
}
.mc-cart-overlay.is-open{ opacity:1; visibility:visible; }

.mc-cart-drawer{
  position:fixed; top:0; right:0; height:100vh; width:min(420px,100vw);
  background:#0f0f10; color:#fff;
  transform:translateX(100%) scale(.98); opacity:0;
  transition:transform .35s cubic-bezier(.25,.8,.25,1), opacity .25s ease;
  z-index:100008; display:flex; flex-direction:column;
  box-shadow:-12px 0 30px rgba(0,0,0,.35);
  border-left:2px solid #00c853;
  overscroll-behavior: contain;
}
@supports (height: 100dvh){
  .mc-cart-drawer{ height:100dvh; }
}
.mc-cart-drawer.is-open{ transform:translateX(0) scale(1); opacity:1; }
/* Asegurar color de texto base en el drawer */
.mc-cart-drawer, .mc-cart-drawer *{ color-scheme: dark; }
.mc-cart-drawer .mc-cart-body{ color:#fff; }

/* Header */
.mc-cart-header{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  background:#0b0b0b; border-bottom:1px solid rgba(255,255,255,.1);
  padding:14px 14px;
}
.mc-cart-header h3{ margin:0; font-size:16px; letter-spacing:.5px; font-weight:700; }
.mc-cart-close{
  background:transparent; border:0; color:#fff; font-size:24px; line-height:1; cursor:pointer;
  width:36px; height:36px; border-radius:10px;
}
.mc-cart-close:hover{ background:rgba(255,255,255,.08); }

/* ===== Reseteos para que el listado arranque a la izquierda ===== */
.mc-cart-body ul.woocommerce-mini-cart{ list-style:none; padding:0; margin:0; }
.mc-cart-body li.woocommerce-mini-cart-item{ list-style:none; padding:0; margin:0; }
.mc-cart-body .product_list_widget li:before,
.mc-cart-body .woocommerce-mini-cart-item::before,
.mc-cart-body .woocommerce-mini-cart-item::marker{ content:none !important; }

/* Ocultar la X nativa de Woo en el mini-cart (dejamos solo la nuestra a la izquierda) */
.mc-cart-body li.woocommerce-mini-cart-item > a.remove{ display:none !important; }

/* Body */
.mc-cart-body{ flex:1 1 auto; overflow:auto; -webkit-overflow-scrolling:touch; }

.mc-head,
.mc-line{
  display:grid; grid-template-columns:28px 1fr 140px; gap:8px; align-items:center;
}
/* Forzar layout dentro del drawer (evita overrides del theme) */
.mc-cart-drawer .mc-line{ display:grid !important; grid-template-columns:28px 1fr 140px !important; }
.mc-cart-drawer .mc-x, .mc-cart-drawer .mc-title, .mc-cart-drawer .mc-price{ display:block !important; }
.mc-head{
  padding:10px 8px;
  position:sticky; top:0; z-index:1;
  background:#0b0b0b; border-bottom:1px solid rgba(255,255,255,.1);
}
.mc-h-x,.mc-h-title,.mc-h-price{
  font-size:12px; color:#b6bcc6; font-weight:700; text-transform:uppercase;
}

.mc-line{
  padding:10px 8px; border-bottom:1px dashed rgba(255,255,255,.1);
}

/* Producto legible: una sola línea con elipsis (evita doble renglón) */
.mc-cart-drawer .mc-title{
  font-size:15px; font-weight:600; color:#fff !important; text-align:left;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  display:block !important; max-width:100%; min-width:0; width:100%; /* min-width:0 necesario para elipsis en grid */
  position:relative; z-index:1;
}
.mc-price{ white-space:nowrap; font-weight:700; justify-self:end; text-align:right; max-width:140px; overflow:hidden; text-overflow:ellipsis; }

/* X pequeña a la izquierda (nuestra) */
.mc-x a.remove{
  display:inline-flex; align-items:center; justify-content:center;
  width:24px; height:24px; border-radius:6px;
  background:rgba(255,255,255,.06); color:#fff; text-decoration:none;
  font-size:16px; line-height:1;
}
.mc-x a.remove:hover{ background:#d50000; }

/* Footer con acciones */
.mc-cart-footer{
  position:sticky; bottom:0; z-index:2;
  padding:12px; display:grid; gap:8px;
  background:linear-gradient(180deg, rgba(15,15,16,.85), rgba(15,15,16,1));
  border-top:1px solid rgba(255,255,255,.10);
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
.mc-cart-footer .button{
  display:block; width:100%; text-align:center; border-radius:11px;
  padding:12px 14px; font-weight:700; font-size:15px;
  border:0; cursor:pointer; text-decoration:none;
  background:#00c853; color:#fff;
}
.mc-cart-footer .button.disabled,
.mc-cart-footer .button[aria-disabled="true"]{ opacity:.6; pointer-events:none; }
.mc-cart-footer .checkout{ background:#2ecc71; }
.mc-cart-footer .mc-go-register{ background:#39ff14; }

/* Oculta botones nativos dentro del mini-cart, por si algún theme los inyecta */
.woocommerce-mini-cart__buttons,
p.woocommerce-mini-cart__buttons,
.woocommerce-mini-cart__total{ display:none !important; }

/* ===== Flotante de consultas (WSP) ===== */
.mc-cart-open #mc-wsp-left,
.mc-cart-open .mc-wsp-fab,
.mc-cart-open .whatsapp-fab,
.mc-cart-open .wa-chat-btn,
.mc-cart-open .wame-float,
.mc-cart-open .whatsapp-button,
.mc-cart-open .wsp-floating,
.mc-cart-open .floating-cart,
.mc-cart-open .mc-cart-fab,
.mc-cart-open #woofc-floating-cart,
.mc-cart-open .woofc,
.mc-cart-open .woofc-area,
.mc-cart-open .woofc-cart,
.mc-cart-open .woofc-floating-cart{ display:none !important; }

#mc-wsp-left{
  position: fixed; left: 18px; bottom: 18px;
  width: 56px !important; height: 56px !important;
  border-radius: 50%;
  background: #25d366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  z-index: 2147483647;
}
#mc-wsp-left img{ width:28px !important; height:28px !important; display:block; }
#mc-wsp-left, #mc-wsp-left *{ box-sizing:border-box; }

/* Anti-fugas de estilos globales */
#mc-wsp-left, #mc-wsp-left *{ box-sizing:border-box; }

/* ----- Total al pie del mini-cart ----- */
.mc-total-row{
  display:grid; grid-template-columns:28px 1fr auto; gap:8px; align-items:center;
  padding:12px 8px; border-top:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.03);
}
.mc-total-label{ font-size:14px; font-weight:800; color:#fff; text-transform:uppercase; }
.mc-total-value{ font-size:16px; font-weight:900; white-space:nowrap; }

/* Estilos para los controles superiores del drawer (vaciar + esconder) */
.mc-cart-top-controls{
  background:transparent;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  width:100%;
  box-sizing:border-box;
}
.mc-cart-top-controls .mc-cart-empty-btn{
  background: #00c853 !important;
  color: #fff !important;
  border: 0 !important;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  font-weight:700 !important;
  font-size:13px !important;
  cursor: pointer !important;
}
.mc-cart-top-controls .mc-cart-empty-btn:hover{ filter:brightness(.98); }
.mc-cart-top-controls .mc-cart-hide-btn{
  margin-left: auto; /* push to the right */
  width: 40px;
  height: 40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background: rgba(255,255,255,0.04) !important;
  color: #fff !important;
  border: 0 !important;
  padding: 6px !important;
  cursor: pointer !important;
  opacity: .98;
}
.mc-cart-top-controls .mc-cart-hide-btn svg{ width:20px; height:20px; display:block; }
.mc-cart-top-controls .mc-cart-hide-btn:hover{ background: rgba(255,255,255,.08) !important; transform: translateX(1px); }

/* Temporal disabled state used to avoid accidental taps when drawer opens */
.mc-temp-disabled{ opacity: .6 !important; filter: grayscale(.05); }
.mc-temp-disabled[disabled], .mc-temp-disabled[aria-disabled="true"]{ pointer-events:none !important; }
