:root{
  --cart-bg: #ffffff;           /* drawer background - pure white */
  --cart-ink: #000000;          /* text - pure black */
  --cart-muted: #757575;        /* secondary text - medium gray */
  --cart-accent: #000000;       /* BLACK accent (tab + badge) */
  --cart-accent-2: #1a1a1a;     /* secondary dark accent */
  --cart-border: #e5e5e5;       /* light gray border */
  --cart-danger: #000000;       /* black for consistency */
  --cart-head-grad: linear-gradient(180deg, #000000 0%, #1a1a1a 100%);
  --cart-width: 400px;          /* drawer width (JS keeps this synced) */
}

/* ===== Pull-tab Cart Button (attached to drawer edge) ===== */
#cartFab {
  position: fixed;
  right: 0;                     /* attached to viewport edge when closed */
  top: 96px;                    /* JS positions this just under the header */
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;

  /* BLACK tab with subtle gradient */
  background: linear-gradient(180deg, #1a1a1a, #000000);
  border: 1px solid var(--cart-border);
  border-right: none;
  border-radius: 12px 0 0 12px; /* tab shape */
  padding: .38rem .65rem .38rem .5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);

  /* Smoothly follow the drawer edge */
  transition:
    right .22s cubic-bezier(.2,.8,.2,1),
    top .18s ease,
    background .18s ease,
    transform .18s ease;
}

#cartFab:hover { transform: translateX(-2px); background: #000000; }

#cartFab .fab-img-wrap{
  width: 56px; height: 56px; border-radius: 999px; overflow: hidden;
  background: #ffffff; display:flex; align-items:center; justify-content:center; /* white circle for icon */
  border: 2px solid #ffffff;
}
#cartFab img { width: 100%; height: 100%; object-fit: contain; filter: none; mix-blend-mode: normal; }

#cartFab .fab-label{
  color: #fff; font-weight: 700; letter-spacing: .3px; padding-right: .2rem;
  text-transform: uppercase;
  font-size: .85rem;
}

#cartFab .fab-badge{
  min-width: 22px; height: 22px; border-radius: 999px;
  background: #ffffff; color: #000000; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; font-size: .75rem;
  margin-left: .25rem;
  border: 1px solid #ffffff;
}

/* When cart is open, the tab keeps black look */
#cartFab.open{
  background: #000000;
  border-left: 2px solid #ffffff;
}

/* ===== Backdrop + Drawer ===== */
#cartBackdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998; display: none; opacity: 0; transition: opacity .25s ease;
  backdrop-filter: blur(4px);
}
#cartBackdrop.show { display: block; opacity: 1; }

#sideCart {
  position: fixed; top: 0; right: 0; height: 100vh;
  width: var(--cart-width); max-width: 92vw;
  background: var(--cart-bg); color: var(--cart-ink);
  border-left: 2px solid var(--cart-border);
  z-index: 9999; transform: translateX(100%);
  box-shadow: -24px 0 48px rgba(0,0,0,.15);
  display: grid; grid-template-rows: auto 1fr auto;
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
#sideCart.show { transform: translateX(0%); }

/* Header with black background */
.sc-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:.6rem; padding:1.2rem .95rem; border-bottom: 2px solid var(--cart-border);
  background: var(--cart-head-grad);
}
.sc-head .title { 
  font-weight: 700; 
  letter-spacing: .5px; 
  color:#fff;
  text-transform: uppercase;
  font-size: 1rem;
}
.sc-head .close {
  background: transparent; 
  border: 2px solid #ffffff;
  color: #fff; 
  border-radius: 0; 
  padding: .5rem .85rem; 
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  font-size: .85rem;
  letter-spacing: .3px;
  transition: all .2s ease;
}
.sc-head .close:hover{ 
  background: #ffffff;
  color: #000000;
}

/* List */
.sc-list { overflow:auto; padding: 1rem .95rem; }
.sc-empty { 
  text-align:center; 
  color: var(--cart-muted); 
  padding: 2rem .4rem;
  font-size: .95rem;
}

.sc-row{
  display:grid; grid-template-columns: 64px 1fr auto; gap:.75rem; align-items:center;
  padding: 1rem; 
  margin-bottom: .75rem;
  border: 2px solid var(--cart-border);
  background: #ffffff;
  border-radius: 0;
  transition: border-color .2s ease;
}
.sc-row:hover{ border-color: #000000; }
.sc-row:last-child{ border-bottom: 2px solid var(--cart-border); }
.sc-row img{ 
  width:64px; 
  height:64px; 
  object-fit:cover; 
  background:#f5f5f5; 
  border-radius: 0;
  border: 1px solid var(--cart-border);
}
.sc-row .title { 
  font-weight: 700; 
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.sc-row .variant {
  font-size: .8rem;
  color: #666;
  margin: .25rem 0;
  font-style: italic;
}
.sc-row .meta { 
  font-size: .85rem; 
  color: var(--cart-muted);
  margin-top: .25rem;
}
.qtyWrap { display: flex; gap: .4rem; align-items: center; justify-content: flex-end; flex-direction: column; }
.qtyBtn{
  width: 32px; 
  height: 32px; 
  border-radius: 0; 
  border: 2px solid var(--cart-border);
  background: #ffffff; 
  color: #000000; 
  cursor: pointer;
  font-weight: 700;
  transition: all .2s ease;
}
.qtyBtn:hover{ 
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}
.removeBtn{
  border: none; 
  background: transparent; 
  color: var(--cart-muted); 
  cursor: pointer; 
  font-size: .8rem;
  text-decoration: underline;
  text-transform: uppercase;
  letter-spacing: .3px;
  font-weight: 600;
}
.removeBtn:hover{ 
  color: #000000;
}

/* Clean black and white footer */
.sc-foot{
  border-top: 2px solid var(--cart-border);
  padding: 1.2rem .95rem;
  display:grid; grid-template-columns: 1fr; gap:.8rem;
  grid-template-areas:
    "total"
    "actions"
    "policy";
  background: #fafafa;
}
.sc-total { 
  font-weight: 700; 
  grid-area: total; 
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: .3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: .8rem;
  border-bottom: 2px solid var(--cart-border);
}
.sc-actions { 
  grid-area: actions; 
  display:flex; 
  gap:.75rem; 
  flex-direction: column;
}
.sc-actions .btn{
  background: #000000;
  color:#fff; 
  border:2px solid #000000;
  border-radius:0; 
  padding:.75rem 1.2rem; 
  cursor:pointer; 
  font-weight:700;
  text-transform: uppercase;
  letter-spacing: .3px;
  font-size: .9rem;
  transition: all .2s ease;
}
.sc-actions .btn:hover{ 
  background: #ffffff;
  color: #000000;
}
.sc-actions .btn-danger{
  background: #ffffff; 
  color: #000000; 
  border: 2px solid var(--cart-border);
}
.sc-actions .btn-danger:hover{
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}
.sc-policy {
  grid-area: policy;
  font-size: .8rem; 
  color: var(--cart-muted);
  text-align: center; 
  margin-top: .2rem;
  line-height: 1.5;
}
.sc-policy a{ 
  color: #000000; 
  text-decoration: none;
  font-weight: 600;
}
.sc-policy a:hover{ text-decoration: underline; }

/* Compact sizing on small screens */
@media (max-width: 480px){
  /* Make the drawer narrower and responsive on small devices */
  :root{ --cart-width: clamp(240px, 82vw, 320px); }
  #sideCart{ max-width: 90vw; }
  #cartFab{ top: 78px; padding: .35rem .55rem .35rem .45rem; }
  #cartFab .fab-img-wrap{ width: 50px; height: 50px; }
  #cartFab .fab-label{ font-size: .8rem; }
  #cartFab .fab-badge{ min-width: 20px; height: 20px; font-size: .7rem; }
  .sc-head{ padding: 1rem .8rem; }
  .sc-head .title{ font-size: .9rem; }
  .sc-head .close{ padding: .45rem .7rem; font-size: .8rem; }
  .sc-list{ padding: .75rem .8rem; }
  .sc-row{ 
    grid-template-columns: 54px 1fr auto; 
    gap:.6rem; 
    padding: .8rem;
    margin-bottom: .6rem;
  }
  .sc-row img{ width:54px; height:54px; }
  .sc-row .title{ font-size: .85rem; }
  .sc-row .meta{ font-size: .8rem; }
  .qtyBtn{ width: 28px; height: 28px; font-size: .85rem; }
  .removeBtn{ font-size: .75rem; }
  .sc-foot{ padding: 1rem .8rem; }
  .sc-total{ font-size: 1rem; padding-bottom: .6rem; }
  .sc-actions{ gap: .6rem; }
  .sc-actions .btn{ padding:.65rem 1rem; font-size:.85rem; }
  .sc-policy{ font-size:.75rem; }
}
