/* =========================================================
   SOMOSTORTA — CART.CSS (CUTE + PRO) — CLEAN
   - Drawer layout (overlay + panel)
   - Woo mini-cart styling
   - Solo botones del footer (abajo) ✅
========================================================= */

:root{
  --st-ease: cubic-bezier(.22,1,.36,1);
  --st-shadow: -18px 0 50px rgba(0,0,0,.12);
  --st-border: rgba(0,0,0,.10);
  --st-border-soft: rgba(0,0,0,.08);
  --st-muted: rgba(0,0,0,.62);
}

/* =========================
   DRAWER SHELL
========================= */

.st-cart-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  opacity:0;
  pointer-events:none;
  transition: opacity .22s var(--st-ease);
  z-index:9998;
}

body.st-cart-open .st-cart-overlay{
  opacity:1;
  pointer-events:auto;
}

.st-cart-drawer{
  position:fixed;
  top:0;
  right:0;
  height:100dvh;

  width: min(860px, 55vw);
  min-width: 520px;

  background:#fff;
  transform:translateX(100%);
  transition: transform .32s var(--st-ease);
  z-index:9999;

  display:flex;
  flex-direction:column;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: var(--st-shadow);
}

body.st-cart-open .st-cart-drawer{ transform:translateX(0); }

html.st-cart-open{
  overflow:hidden;
}
body.st-cart-open{
  touch-action:none;
}

/* 📱 Móvil: full width */
@media (max-width:768px){
  .st-cart-drawer{ width:100vw; min-width:0; }
}

/* Admin bar */
body.admin-bar .st-cart-drawer{ top:32px; height:calc(100dvh - 32px); }
@media (max-width:782px){
  body.admin-bar .st-cart-drawer{ top:46px; height:calc(100dvh - 46px); }
}

/* =========================
   HEADER
========================= */

.st-cart-drawer__head{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;

  padding: 22px 42px;
  border-bottom:1px solid var(--st-border-soft);

  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 2;
}

.st-cart-drawer__title{
  font-weight:700;
  letter-spacing:.01em;
}

.st-cart-drawer__close,
.st-cart-drawer__clear{
  border:0;
  background:transparent;
  cursor:pointer;
  font-weight:600;
  opacity:.8;
  transition: opacity .15s var(--st-ease), transform .15s var(--st-ease);
}

.st-cart-drawer__close:hover,
.st-cart-drawer__clear:hover{
  opacity:1;
  transform: translateY(-1px);
}

/* =========================
   BODY (scroll)
========================= */

.st-cart-drawer__body{
  flex:1 1 auto;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  padding: 40px 42px;

  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.25) transparent;
}

.st-cart-drawer__body::-webkit-scrollbar{ width: 10px; }
.st-cart-drawer__body::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,.22);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

/* =========================
   FOOTER (sticky)
========================= */

.st-cart-drawer__foot{
  flex:0 0 auto;
  border-top:1px solid var(--st-border-soft);
  padding: 18px 42px;
  background:#fff;

  display:grid;
  grid-template-columns: 1fr 1.2fr;
  gap:12px;

  position: sticky;
  bottom: 0;
  z-index: 2;
}

.st-cart-drawer__btn{
  height:52px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  font-weight:700;
  text-decoration:none;
  transition: transform .15s var(--st-ease), filter .15s var(--st-ease);
}

.st-cart-drawer__btn:hover{
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.st-cart-drawer__btn:active{ transform: translateY(0); }

.st-cart-drawer__btn--cart{
  border:1px solid rgba(0,0,0,.14);
  color:inherit;
  background:#fff;
}

.st-cart-drawer__btn--checkout{
  border:0;
  color:#fff;
  background: var(--st-orange);
  letter-spacing:.04em;
}

/* Mobile spacing */
@media (max-width:768px){
  .st-cart-drawer__head{ padding: 18px 18px; }
  .st-cart-drawer__body{ padding: 22px 18px; }
  .st-cart-drawer__foot{ padding: 14px 18px; }
}

/* =========================
   WOO MINI CART (CONTENT)
========================= */

.st-cart-drawer__body .woocommerce-mini-cart{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap: 0;
}

.st-cart-drawer__body .woocommerce-mini-cart-item{
  position:relative;
  display:grid;
  grid-template-columns: 90px 1fr auto;
  gap:20px;
  align-items:center;

  padding: 24px 0;
  border-bottom:1px solid var(--st-border-soft);
}

.st-cart-drawer__body .woocommerce-mini-cart-item a img{
  width:90px !important;
  height:90px !important;
  object-fit:cover;
  border-radius:12px;
  display:block;
}

.st-cart-drawer__body .woocommerce-mini-cart-item > a{
  display:inline-block;
  font-weight:600;
  text-decoration:none;
  color:inherit;
  line-height:1.25;
  font-size:15px;
}

.st-cart-drawer__body .woocommerce-mini-cart-item .quantity{
  display:block;
  margin-top:8px;
  font-size:13px;
  color: var(--st-muted);
}

.st-cart-drawer__body .woocommerce-mini-cart-item .amount{
  font-weight:700;
  color: var(--st-text, #111);
}

.st-cart-drawer__body .woocommerce-mini-cart-item a.remove{
  position:absolute;
  top: 18px;
  right: 0;

  color:#999 !important;
  text-decoration:none !important;
  font-size:18px !important;
  line-height:1 !important;

  width:28px !important;
  height:28px !important;
  border-radius:10px;
  display:grid !important;
  place-items:center;

  transition: background .15s var(--st-ease), transform .15s var(--st-ease), color .15s var(--st-ease);
}

.st-cart-drawer__body .woocommerce-mini-cart-item a.remove:hover{
  color:#111 !important;
  background: rgba(0,0,0,.06) !important;
  transform: scale(1.04);
}

.st-cart-drawer__body .woocommerce-mini-cart__total{
  margin-top: 18px;
  padding-top: 18px;
  border-top:1px solid var(--st-border);
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-weight:700;
  font-size:15px;
}

.st-cart-drawer__body .woocommerce-mini-cart__total .amount{
  font-weight:800;
}

.st-cart-drawer__body .woocommerce-mini-cart__empty-message{
  margin:0;
  padding:18px 12px;
  border:1px dashed rgba(0,0,0,.18);
  border-radius:12px;
  text-align:center;
  color: var(--st-muted);
}

/* ✅ IMPORTANT: ocultamos los botones de Woo (dejamos solo footer) */
.st-cart-drawer__body .woocommerce-mini-cart__buttons{
  display:none !important;
}

/* Ajustes mobile item */
@media (max-width: 420px){
  .st-cart-drawer__body .woocommerce-mini-cart-item{
    grid-template-columns: 74px 1fr auto;
    gap:14px;
  }
  .st-cart-drawer__body .woocommerce-mini-cart-item a img{
    width:74px !important;
    height:74px !important;
  }
}

/* =========================
   UX EXTRAS (opcional)
========================= */

.st-cart.is-loading .st-cart-drawer__body{
  opacity:.55;
  pointer-events:none;
}

.st-cart.is-loading .st-cart-drawer__body::after{
  content:"Actualizando…";
  position: sticky;
  top: 14px;
  display:block;
  margin-bottom: 10px;

  padding: 10px 12px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  font-size: 13px;
}

.st-cart-toast{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10002;
  background: rgba(17,17,17,.92);
  color: #fff;
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,.22);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .22s var(--st-ease), transform .22s var(--st-ease);
  font-size: 13px;
}
.st-cart-toast.show{
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce){
  .st-cart-overlay,
  .st-cart-drawer,
  .st-cart-toast{
    transition:none !important;
  }
}

/* =========================================================
   OFFCANVAS CARRITO — SIN OSCURO (overlay transparente)
   Pegar AL FINAL de cart.css
========================================================= */

/* Overlay del carrito: 0 oscuridad, pero clickable para cerrar */
.st-cart-overlay{
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1 !important;         /* da igual, es transparente */
}

/* Cuando está cerrado, no estorba */
body:not(.st-cart-open) .st-cart-overlay{
  pointer-events: none !important;
}

/* Cuando está abierto, permite click fuera para cerrar (pero sin oscurecer) */
body.st-cart-open .st-cart-overlay{
  pointer-events: auto !important;
}

/* (Opcional) si notas “velo” por sombra del drawer en móvil */
@media (max-width: 768px){
  .st-cart-drawer{
    box-shadow: none !important;
  }
}

