/* 100 Rose BD — Cart Drawer (brand-aligned + a11y + mobile polish) */
/* === Brand Tokens (from your kit) === */
:root{
  --hr-red:#D32F2F;        /* Primary Red */
  --hr-pink:#F8BBD0;       /* Romantic Pink */
  --hr-rose:#B76E79;       /* Rose Gold Accent */
  --hr-white:#FFFFFF;      /* Background */
  --hr-soft:#F2F2F2;       /* Card BG */
  --hr-charcoal:#212121;   /* Text */
  --hr-border-color:#ececec;

  --hr-radius:18px;
  --hr-radius-sm:12px;
  --hr-shadow:0 10px 30px rgba(0,0,0,.14);
  --hr-border:1px solid var(--hr-border-color);

  --hr-overlay:rgba(0,0,0,.4);
  --hr-focus:rgba(248,187,208,.55); /* Romantic pink focus ring */
}

/* Overlay */
.hr-cart-overlay{
  position:fixed; inset:0; background:var(--hr-overlay);
  opacity:0; pointer-events:none; transition:opacity .25s ease;
  z-index:9998; -webkit-tap-highlight-color:transparent;
}

/* Drawer */
.hr-cart-drawer{
  position:fixed; inset:0 0 0 auto; height:100dvh; width:390px; max-width:92vw;
  background:var(--hr-white); color:var(--hr-charcoal);
  box-shadow:var(--hr-shadow); z-index:9999;
  display:flex; flex-direction:column;
  transition:transform .28s ease;
  transform:translateX(110%);
  font-family:"Open Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  border-left: var(--hr-border);
  overscroll-behavior:contain; /* prevent iOS bounce propagating */
  contain:content; /* small perf gain */
  will-change:transform;
}

/* Open state (body toggled by JS) */
body.hr-cart-open .hr-cart-drawer{ transform:none; }
body.hr-cart-open .hr-cart-overlay{ opacity:1; pointer-events:auto; }

/* Header */
.hr-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 18px; border-bottom:var(--hr-border);
}
.hr-h{
  font-family:"Montserrat", Arial, sans-serif;
  font-weight:700; font-size:20px; margin:0;
}
.hr-close{
  border:0; background:#f4f4f4; width:36px; height:36px; border-radius:10px;
  font-size:20px; line-height:1; cursor:pointer;
}
.hr-close:hover{ background:#eee; }
.hr-close:focus-visible{
  outline:none; box-shadow:0 0 0 3px var(--hr-focus);
}

/* Body */
.hr-body{
  padding:12px 12px 0;
  overflow:auto; flex:1;
  -webkit-overflow-scrolling:touch;
}
.hr-empty{ padding:24px; text-align:center; color:#666; }

/* Items */
.hr-cart-item{
  display:grid; grid-template-columns:72px 1fr; gap:12px;
  padding:12px; border:1px solid #eee; border-radius:14px; background:#fff;
  box-shadow:0 2px 10px rgba(0,0,0,.03); margin-bottom:12px;
}
.hr-thumb img{ width:72px; height:72px; object-fit:cover; border-radius:12px; }

.hr-title{
  font-weight:600; text-decoration:none; color:var(--hr-charcoal);
  display:inline-block; margin-bottom:6px;
  font-size:15px; line-height:1.35;
  max-height:calc(1.35em * 2);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.hr-title:focus-visible{
  outline:none; box-shadow:0 0 0 3px var(--hr-focus); border-radius:8px;
}

.hr-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.hr-subtotal{ font-weight:700; }

/* Qty control */
.hr-qty{
  display:inline-flex; align-items:center; gap:8px; background:var(--hr-soft);
  border-radius:999px; padding:6px 8px; border:1px solid #e8e8e8;
}
.hr-qty-btn{
  width:28px; height:28px; border-radius:8px; border:0; cursor:pointer;
  background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.06);
}
.hr-qty-btn:hover{ filter:brightness(.97); }
.hr-qty-btn:focus-visible{
  outline:none; box-shadow:0 0 0 3px var(--hr-focus);
}
.hr-qty-input{
  width:42px; text-align:center; border:0; background:transparent; font-weight:600;
}

/* Remove */
.hr-remove{
  margin-top:8px; border:0; background:transparent; color:#888; cursor:pointer;
  padding:0; text-decoration:underline; font-size:12px;
}
.hr-remove:hover{ color:#555; }
.hr-remove:focus-visible{
  outline:none; box-shadow:0 0 0 3px var(--hr-focus); border-radius:6px;
}

/* Footer */
.hr-footer{
  border-top:var(--hr-border);
  padding:14px 16px calc(18px + env(safe-area-inset-bottom));
  background:linear-gradient(#fff, #fff6);
}
.hr-subtotal-row{
  display:flex; justify-content:space-between; align-items:center; font-weight:700; margin-bottom:12px;
}
.hr-actions{ display:grid; grid-template-columns:1fr; gap:10px; }
.hr-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  height:46px; border-radius:12px; text-decoration:none; font-weight:700;
  border:1px solid transparent;
}
.hr-btn:focus-visible{ outline:none; box-shadow:0 0 0 3px var(--hr-focus); }
.hr-btn.hr-primary{ background:var(--hr-red); color:#fff; }
.hr-btn.hr-primary:hover{ filter:brightness(.95); }
.hr-btn.hr-secondary{ background:#fff; color:var(--hr-charcoal); border-color:#e5e5e5; }
.hr-btn.is-loading{ position:relative; pointer-events:none; opacity:.8; }
.hr-btn.is-loading::after{
  content:""; width:1em; height:1em; border-radius:50%;
  border:2px solid #fff; border-right-color:transparent;
  animation:hr-spin .8s linear infinite; margin-left:6px;
}

/* Mobile */
@media (max-width: 540px){
  .hr-cart-drawer{ width:100vw; border-left:0; }
}

/* ===== Compact variant (your “Fix” block kept) ===== */
.hr-cart-drawer * { box-sizing: border-box; }

/* tighter card */
.hr-cart-drawer .hr-cart-item{
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
}
/* smaller thumb */
.hr-cart-drawer .hr-thumb img{
  width: 56px; height: 56px; border-radius: 10px; object-fit: cover;
}
/* subtotal + spacing */
.hr-cart-drawer .hr-subtotal{ font-size:14px; font-weight:700; }
.hr-cart-drawer .hr-row{ gap: 8px; }
/* qty compact */
.hr-cart-drawer .hr-qty{ padding: 4px 6px; gap: 6px; }
.hr-cart-drawer .hr-qty-btn{ width: 26px; height: 26px; border-radius: 8px; }
.hr-cart-drawer .hr-qty-input{ width: 38px; font-size: 14px; }
/* remove compact */
.hr-cart-drawer .hr-remove{ font-size: 12px; }
/* headings safe */
.hr-cart-drawer h1, .hr-cart-drawer h2, .hr-cart-drawer h3,
.hr-cart-drawer h4, .hr-cart-drawer h5, .hr-cart-drawer h6{
  font-size: 16px; line-height: 1.4; margin: 0;
}

/* Scrollbar styling (optional, non-blocking) */
.hr-body::-webkit-scrollbar{ width:10px }
.hr-body::-webkit-scrollbar-thumb{ background:#e1e1e1; border-radius:10px }
.hr-body::-webkit-scrollbar-thumb:hover{ background:#d4d4d4 }

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ transition:none!important; animation:none!important }
}

/* RTL niceties */
[dir="rtl"] .hr-cart-drawer{ inset:0 auto 0 0; transform:translateX(-110%); border-left:0; border-right:var(--hr-border); }
[dir="rtl"] body.hr-cart-open .hr-cart-drawer{ transform:none; }
[dir="rtl"] .hr-row{ flex-direction:row-reverse; }
[dir="rtl"] .hr-title{ text-align:right; }

/* Keyframes */
@keyframes hr-spin { to { transform:rotate(360deg) } }
