/* =========================================================================
   SLIDE-OUT CART DRAWER  (right side)
   Matches the UrbWellness "Yuva" storefront behaviour.
   Colours/radii pulled from the theme tokens in main.css — never hardcode.
   ========================================================================= */

/* ---- Overlay ---------------------------------------------------------- */
.uw-drawer-overlay{
  position:fixed; inset:0; z-index:998;
  background:rgba(0,0,0,.5);
  opacity:0; visibility:hidden;
  transition:opacity .3s ease, visibility .3s ease;
}
.uw-drawer-overlay.is-open{ opacity:1; visibility:visible; }

/* ---- Panel ------------------------------------------------------------ */
.uw-drawer{
  position:fixed; top:0; right:0; z-index:999;
  width:400px; max-width:100%; height:100%;
  background:var(--body-bg);
  display:flex; flex-direction:column;
  box-shadow:-8px 0 40px rgba(0,0,0,.16);
  transform:translateX(100%);
  transition:transform .34s cubic-bezier(.4,0,.2,1);
  will-change:transform;
}
.uw-drawer.is-open{ transform:translateX(0); }

/* ---- Header ----------------------------------------------------------- */
.uw-drawer__head{
  display:flex; align-items:center; justify-content:space-between;
  padding:20px 24px; border-bottom:1px solid rgba(0,0,0,.08);
  flex:0 0 auto;
}
.uw-drawer__title{
  font-family:var(--font-head); font-weight:600; font-size:20px;
  text-transform:capitalize; margin:0;
}
.uw-drawer__close{
  background:none; border:none; cursor:pointer; padding:4px;
  color:var(--text); display:flex; line-height:0;
  transition:color .2s ease;
}
.uw-drawer__close:hover{ color:var(--olive); }
.uw-drawer__close svg{ width:22px; height:22px; }

/* ---- Free-shipping progress zone -------------------------------------- */
.uw-drawer__ship{ flex:0 0 auto; }
.uw-ship{
  padding:16px 24px;
  background:var(--header-bg);
  border-bottom:1px solid rgba(0,0,0,.06);
}
.uw-ship__msg{
  font-size:12.5px; font-weight:700; color:var(--text);
  margin-bottom:10px; line-height:1.35; text-align:center;
}
.uw-ship__msg strong{ color:var(--olive-dark); }
.uw-ship__track{
  height:8px; border-radius:9px; background:#e2e0da; overflow:hidden;
}
.uw-ship__fill{
  height:100%; border-radius:9px; width:0;
  background:var(--olive);
  transition:width .4s ease, background .3s ease;
}
.uw-ship.is-unlocked .uw-ship__fill{ background:var(--sale); }
.uw-ship.is-unlocked .uw-ship__msg{ color:var(--olive-dark); }

/* ---- Body / scroll region --------------------------------------------- */
.uw-drawer__body{
  flex:1 1 auto; overflow-y:auto; -webkit-overflow-scrolling:touch;
}
.uw-drawer__body .widget_shopping_cart_content{ height:100%; }

/* WooCommerce prints its mini-cart inside .widget_shopping_cart_content.
   We lay out that content as a flex column so the buttons pin to the bottom. */
.uw-drawer__body ul.cart_list,
.uw-drawer__body ul.product_list_widget{
  list-style:none; margin:0; padding:8px 0;
}

/* ---- Empty state ------------------------------------------------------ */
.uw-drawer__body .woocommerce-mini-cart__empty-message{
  padding:48px 24px; text-align:center; color:var(--muted); font-size:14px;
}

/* ---- Line items --------------------------------------------------------
   WooCommerce's real mini-cart markup wraps the thumbnail image AND the
   product title in a SINGLE <a> (not two separate links) — grid-area only
   applies to direct grid children, so the nested <img>'s own grid-area rule
   below has zero effect, and assigning that whole <a> to the same area as
   .quantity/.dl.variation put three things on top of each other in one
   cell. Fix: the <a> spans both the thumb+info columns as one flex row
   (image + title side by side internally); .quantity/dl.variation drop to
   a second grid row, indented under the title (not under the image). */
.uw-drawer__body ul.cart_list li{
  position:relative;
  display:grid;
  grid-template-columns:64px 1fr auto;
  grid-template-rows:auto auto;
  column-gap:14px; row-gap:4px; align-items:start;
  padding:16px 24px;
  border-bottom:1px solid rgba(0,0,0,.06);
}
.uw-drawer__body ul.cart_list li img{
  width:64px !important; height:64px; object-fit:contain; flex:0 0 64px;
  margin:0 !important; float:none !important;
  border:1px solid rgba(0,0,0,.06); border-radius:var(--prod-radius);
  background:#fff; padding:4px;
}
.uw-drawer__body ul.cart_list li a:not(.remove){
  grid-column:1 / 3; grid-row:1;
  display:flex; align-items:flex-start; gap:14px;
  font-size:13.5px; font-weight:700; line-height:1.35;
  color:var(--text); text-transform:none;
}
.uw-drawer__body ul.cart_list li a:not(.remove):hover{ color:var(--olive); }
.uw-drawer__body ul.cart_list li .quantity{
  grid-column:2; grid-row:2;
  display:block;
  font-size:13px; color:var(--muted); font-weight:700;
}
.uw-drawer__body ul.cart_list li .quantity .amount{ color:var(--text); }
.uw-drawer__body ul.cart_list li dl.variation{
  grid-column:2; grid-row:3; margin:0; font-size:12px; color:var(--muted);
}
.uw-drawer__body ul.cart_list li dl.variation dt,
.uw-drawer__body ul.cart_list li dl.variation dd{ display:inline; margin:0; }
.uw-drawer__body ul.cart_list li dl.variation dd p{ margin:0; }

/* Remove X */
.uw-drawer__body ul.cart_list li a.remove{
  grid-column:3; grid-row:1 / 3;
  position:static !important;
  width:22px; height:22px; line-height:20px;
  text-align:center; font-size:18px; border-radius:50%;
  color:var(--muted) !important; background:transparent;
  text-decoration:none; font-weight:400;
}
.uw-drawer__body ul.cart_list li a.remove:hover{
  color:#fff !important; background:var(--sold);
}

/* ---- Subtotal row ----------------------------------------------------- */
.uw-drawer__body p.woocommerce-mini-cart__total,
.uw-drawer__body p.total{
  display:flex; align-items:center; justify-content:space-between;
  margin:0; padding:18px 24px;
  border-top:1px solid rgba(0,0,0,.1);
  font-family:var(--font-head); font-weight:600; font-size:16px;
}
.uw-drawer__body p.total .amount,
.uw-drawer__body p.total .woocommerce-Price-amount{ color:var(--olive-dark); }

/* ---- Buttons ---------------------------------------------------------- */
.uw-drawer__body p.woocommerce-mini-cart__buttons,
.uw-drawer__body p.buttons{
  display:flex; flex-direction:column; gap:10px;
  margin:0; padding:0 24px 24px;
}
.uw-drawer__body p.buttons a{
  display:inline-flex; align-items:center; justify-content:center;
  width:100%; min-height:46px; padding:12px 22px;
  border-radius:var(--btn-radius);
  font-family:var(--font-head); font-weight:600; font-size:12px;
  letter-spacing:.06em; text-transform:uppercase; text-align:center;
  cursor:pointer; transition:background .3s ease, color .3s ease;
}
/* View Cart — outline olive */
.uw-drawer__body p.buttons a.wc-forward:not(.checkout){
  background:#fff; color:var(--olive); border:1px solid var(--olive);
}
.uw-drawer__body p.buttons a.wc-forward:not(.checkout):hover{
  background:var(--olive); color:#fff;
}
/* Checkout — solid olive */
.uw-drawer__body p.buttons a.checkout{
  background:var(--olive); color:#fff; border:1px solid var(--olive);
}
.uw-drawer__body p.buttons a.checkout:hover{ background:#585b31; }

/* ---- Mobile ----------------------------------------------------------- */
@media (max-width:900px){
  .uw-drawer{ width:100%; }
}
@media (max-width:560px){
  .uw-drawer__head{ padding:16px 18px; }
  .uw-ship{ padding:14px 18px; }
  .uw-drawer__body ul.cart_list li{ padding:14px 18px; grid-template-columns:56px 1fr auto; }
  .uw-drawer__body ul.cart_list li img{ width:56px !important; height:56px; }
  .uw-drawer__body p.total,
  .uw-drawer__body p.buttons{ padding-left:18px; padding-right:18px; }
}
