/* ============================================================
   CraftyWorth v2 — Header, Footer, Layout
   ============================================================ */

/* ── Announcement Bar ── */
.cw-announce {
  background: var(--p);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  text-align: center;
  padding: 0 var(--px);
}
.cw-announce a { color: rgba(255,255,255,.8); font-weight: 700; margin-left: 8px; }
.cw-announce a:hover { color: #fff; }

/* ── Header ── */
.cw-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
  will-change: transform;
  transform: translateZ(0);
}

.cw-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--px);
  height: 68px;
  display: flex;
  align-items: center;
  gap: var(--s6);
}

/* Logo */
.cw-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 160px;
}
.cw-logo__mark {
  width: 32px;
  height: 36px;
  flex-shrink: 0;
  color: var(--p);
}
.cw-logo__text { display: flex; flex-direction: column; line-height: 1.1; }
.cw-logo__text b {
  font-family: var(--head);
  font-size: 20px;
  font-weight: 600;
  color: var(--p);
  letter-spacing: -.02em;
}
.cw-logo__text small {
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-style: italic;
  font-family: var(--head);
}
a.custom-logo-link.cw-logo img { height: 36px; width: auto; filter: none; }

/* Search bar */
.cw-search-wrap { flex: 1; position: relative; max-width: 560px; }
.cw-search-form {
  display: flex;
  align-items: center;
  height: 44px;
  background: var(--off);
  border: 1.5px solid var(--line);
  border-radius: var(--pill);
  overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t);
}
.cw-search-form:focus-within {
  border-color: var(--p);
  box-shadow: 0 0 0 3px var(--p-l);
  background: var(--white);
}
.cw-search-input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0 var(--s4);
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  min-width: 0;
}
.cw-search-input::placeholder { color: var(--ink-3); }
.cw-search-btn {
  height: 44px;
  width: 48px;
  background: var(--p);
  border: 0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0 var(--pill) var(--pill) 0;
  transition: background var(--t);
}
.cw-search-btn:hover { background: var(--p-d); }

/* Search dropdown */
#cwv2-search-drop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  z-index: 200;
  overflow: hidden;
  max-height: 420px;
  overflow-y: auto;
}
.cw-sdrop__group { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.cw-sdrop__group:last-child { border-bottom: 0; }
.cw-sdrop__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 6px 16px 4px;
}
.cw-sdrop__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  transition: background var(--t);
  cursor: pointer;
}
.cw-sdrop__item:hover, .cw-sdrop__item[aria-selected="true"] { background: var(--off); }
.cw-sdrop__item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--r);
  flex-shrink: 0;
}
.cw-sdrop__item__name { font-size: 13.5px; font-weight: 500; }
.cw-sdrop__item__meta { font-size: 12px; color: var(--p); font-weight: 600; margin-top: 2px; }
.cw-sdrop__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; }
.cw-sdrop__chip {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--pill);
  background: var(--off);
  border: 1px solid var(--line);
  color: var(--ink-2);
  transition: all var(--t);
}
.cw-sdrop__chip:hover { border-color: var(--p); color: var(--p); }
.cw-sdrop__footer { padding: 10px 16px; background: #faf7f3; text-align: center; }
.cw-sdrop__footer a { font-size: 13px; color: var(--p); font-weight: 600; }
.cw-sdrop__empty { padding: 20px 16px; color: var(--ink-3); font-size: 13px; text-align: center; }

/* Amazon-style keyword suggestions */
.cw-sdrop__kw {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; text-decoration: none;
  color: var(--ink, #1A1208); font-size: 14px;
  transition: background .12s;
  border-bottom: 1px solid var(--line-soft, #f0e8e0);
  min-height: 44px;
}
.cw-sdrop__kw:last-child { border-bottom: none; }
.cw-sdrop__kw:hover { background: var(--off, #FEF7F0); }
.cw-sdrop__kw__icon { font-size: 14px; flex-shrink: 0; width: 20px; text-align: center; opacity: .7; }
.cw-sdrop__kw__label { flex: 1; font-size: 14px; line-height: 1.3; }
.cw-sdrop__kw__arrow { font-size: 12px; color: var(--ink-3); opacity: 0; transition: opacity .12s; }
.cw-sdrop__kw:hover .cw-sdrop__kw__arrow { opacity: 1; }
.cw-sdrop__kw--all { color: var(--p, #A0293E); font-weight: 600; }
.cw-sdrop__kw--all .cw-sdrop__kw__icon { opacity: 1; }
.cw-sdrop__kw--cat { background: #fafaf8; }
.cw-sdrop__divider { height: 1px; background: var(--line, #EAD9CC); margin: 4px 0; }

/* Header icons */
.cw-hicons {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-left: auto;
  flex-shrink: 0;
}
.cw-hicon {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 var(--s3);
  border-radius: var(--r);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--t), color var(--t);
  position: relative;
}
.cw-hicon:hover { background: var(--off); color: var(--p); }
.cw-hicon--cta { background: var(--p); color: #fff; border-radius: var(--pill); }
.cw-hicon--cta:hover { background: var(--p-d); color: #fff; }
.cw-hicon__badge {
  position: absolute;
  top: 4px;
  right: 2px;
  background: var(--a);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* Hamburger */
.cw-ham {
  display: none;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 0;
  color: var(--ink);
  border-radius: var(--r);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cw-ham:hover { background: var(--off); }

/* ── Category nav ── */
.cw-catnav {
  border-top: 1px solid var(--line-soft);
  background: var(--white);
}
.cw-catnav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--px);
  display: flex;
  align-items: center;
  gap: 2px;
  height: 44px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cw-catnav__inner::-webkit-scrollbar { display: none; }
.cw-catnav a {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--t), border-color var(--t);
}
.cw-catnav a:hover, .cw-catnav a.is-active { color: var(--p); border-bottom-color: var(--p); }
.cw-catnav__all {
  font-weight: 600;
  color: var(--ink-2) !important;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
}
.cw-catnav__all:hover { background: var(--off); color: var(--p) !important; }
.cw-catnav__corp {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--p) !important;
  font-weight: 700 !important;
  flex-shrink: 0;
}

/* ── Mobile Drawer ── */
.cw-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26,18,8,.5);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}
.cw-backdrop.open { opacity: 1; pointer-events: auto; }

.cw-drawer {
  position: fixed;
  top: 0; left: 0;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--white);
  z-index: 301;
  transform: translateX(-100%);
  transition: transform .28s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,.12);
}
.cw-drawer.open { transform: translateX(0); }
.cw-drawer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.cw-drawer__brand { font-family: var(--head); font-size: 20px; font-weight: 600; color: var(--p); }
.cw-drawer__close {
  width: 32px; height: 32px;
  background: var(--off); border: 0;
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
}
.cw-drawer__sec { padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.cw-drawer__sec h6 { margin-bottom: 10px; }
.cw-drawer__sec a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
  font-size: 14px; font-weight: 500; color: var(--ink);
  gap: 10px;
}
.cw-drawer__sec a:last-child { border-bottom: 0; }
.cw-drawer__sec a:hover { color: var(--p); }

/* ── Mobile Search Overlay ── */
.cw-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--white);
  display: flex;
  flex-direction: column;
  transform: translateY(-100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.cw-search-overlay.open { transform: translateY(0); }
.cw-search-overlay__top {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  gap: 10px;
}
.cw-search-overlay__form {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--off);
  border: 1.5px solid var(--line);
  border-radius: var(--pill);
  height: 44px;
  padding: 0 12px 0 8px;
}
.cw-search-overlay__back { background: 0; border: 0; padding: 4px; color: var(--ink); }
.cw-search-overlay__input {
  flex: 1; border: 0; background: transparent;
  font-size: 16px; font-family: var(--body); color: var(--ink); outline: none;
  padding: 0 8px; height: 44px;
}
.cw-search-overlay__results { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ── Mobile Bottom Tab Bar ── */
.cw-tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 62px;
  background: var(--white);
  border-top: 1px solid var(--line-soft);
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  display: none;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.cw-tabbar__inner { display: flex; height: 62px; }
.cw-tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 600;
  position: relative;
  transition: color var(--t);
}
.cw-tabbar__item.is-active { color: var(--p); }
.cw-tabbar__item .cw-hicon__badge { top: 2px; right: 10px; }

/* ── WhatsApp Float ── */
.cw-wa {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 52px; height: 52px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,.4);
  z-index: 99;
  transition: transform var(--t), box-shadow var(--t);
}
.cw-wa:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(37,211,102,.5); }

/* ── Cookie Banner ── */
.cw-cookie {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--ink);
  color: #fff;
  padding: 16px var(--px);
  z-index: 9999;
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
.cw-cookie__inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.cw-cookie__text { flex: 1; font-size: 13px; color: rgba(255,255,255,.8); min-width: 200px; }
.cw-cookie__text strong { display: block; color: #fff; margin-bottom: 3px; }
.cw-cookie__actions { display: flex; gap: 8px; }
.cw-cookie__btn {
  padding: 8px 18px; border-radius: var(--pill);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: var(--body); border: 1.5px solid transparent;
}
.cw-cookie__btn--a { background: var(--a); color: #fff; border-color: var(--a); }
.cw-cookie__btn--r { background: transparent; color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.2); }
.cw-cookie__btn--r:hover { border-color: rgba(255,255,255,.5); color: #fff; }

/* ── Footer ── */
.cw-footer { background: var(--ink); color: rgba(255,255,255,.75); }
.cw-footer__main {
  max-width: var(--max); margin: 0 auto;
  padding: 64px var(--px) 40px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.cw-footer__brand .cw-logo { color: #fff; margin-bottom: 16px; }
.cw-footer__brand .cw-logo__text b { color: #fff; }
.cw-footer__brand p { font-size: 13.5px; line-height: 1.65; }
.cw-footer__socials { display: flex; gap: 8px; margin-top: 20px; }
.cw-footer__socials a {
  width: 38px; height: 38px; border-radius: var(--r);
  border: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.7);
  transition: background var(--t), border-color var(--t);
}
.cw-footer__socials a:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.3); }

.cw-footer__col h6 { color: #fff; margin-bottom: 16px; }
.cw-footer__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.cw-footer__col ul li a { font-size: 13.5px; color: rgba(255,255,255,.65); transition: color var(--t); }
.cw-footer__col ul li a:hover { color: #fff; }

.cw-footer__bottom {
  max-width: var(--max); margin: 0 auto;
  padding: 20px var(--px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(255,255,255,.4);
  flex-wrap: wrap;
  gap: 12px;
}
.cw-footer__bottom nav { display: flex; gap: 20px; }
.cw-footer__bottom nav a { color: rgba(255,255,255,.4); }
.cw-footer__bottom nav a:hover { color: rgba(255,255,255,.7); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .cw-footer__main { grid-template-columns: 1fr 1fr; gap: 32px; }
  .cw-footer__brand { grid-column: 1 / -1; }
}

/* Footer — mobile single column, no overlap, full safe-area bottom padding */
@media (max-width: 768px) {
  .cw-footer { overflow: hidden; }
  .cw-footer__main {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding: 40px 16px 28px !important;
  }
  .cw-footer__brand {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
  }
  .cw-footer__brand p { font-size: 13px; line-height: 1.6; }
  .cw-footer__col h6 { margin-bottom: 12px; }
  .cw-footer__col ul { gap: 8px; }
  .cw-footer__col ul li a { font-size: 13px; }
  /* Trust + payment rows wrap and center */
  .cw-footer__trust {
    padding: 14px 16px !important;
    gap: 10px !important;
    justify-content: center !important;
    text-align: center;
  }
  .cw-footer__trust-badges,
  .cw-footer__pay {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
  }
  /* Bottom bar — stacks, with extra padding so tabbar/wa float never overlap */
  .cw-footer__bottom {
    flex-direction: column !important;
    text-align: center !important;
    gap: 8px !important;
    padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0)) !important;
  }
  .cw-footer__bottom span { word-break: break-word; font-size: 12px; }
  .cw-footer__bottom nav { flex-wrap: wrap; justify-content: center; gap: 14px; }
}
@media (max-width: 768px) {
  /* Announcement bar — wrap so close button doesn't overlap text */
  .cw-announce {
    font-size: 11px;
    min-height: 32px;
    height: auto;
    white-space: normal;
    text-overflow: clip;
    overflow: visible;
    padding: 6px 44px 6px 12px; /* right padding clears close button */
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    line-height: 1.3;
  }
  .cw-announce a { margin-left: 4px; }
  .cw-announce__close { right: 8px; }

  /* Header — logo centered, hamburger left, icons right */
  .cw-header {
    overflow: visible; /* allow search dropdown to escape */
  }
  /* Admin bar: mobile = 46px, desktop = 32px */
  body.admin-bar .cw-header { top: 46px; }
  .cw-header__inner {
    height: 56px;
    gap: 0;
    padding: 0 12px;
    justify-content: space-between;
    position: relative;
    overflow: visible; /* must be visible so logo/icons don't merge/clip on mobile */
  }
  .cw-ham {
    display: inline-flex;
    order: 0;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }
  .cw-logo {
    order: 1;
    flex: 1;                  /* Fill space between ham and right icons */
    justify-content: center;  /* Center logo content within flex space */
    min-width: 0;
    max-width: none;          /* Uncap — flex:1 handles sizing */
    position: static;         /* No absolute — prevents icon overlap */
    left: auto;
    transform: none;
    pointer-events: auto;
    overflow: visible; /* don't clip logo image/text on mobile */
  }
  .cw-logo img { height: 32px; width: auto; max-width: 120px; object-fit: contain; }
  .cw-logo__mark { width: 28px; height: 32px; }
  .cw-logo__text b { font-size: 16px; white-space: nowrap; }
  .cw-logo__text small { display: none; }
  .cw-search-wrap { display: none !important; }

  /* Search trigger — no auto margin, logo flex handles the gap */
  .cw-search-trigger {
    display: inline-flex !important;
    order: 3;
    margin-left: 0 !important;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  /* Icons — right side, no labels, min 44px tap */
  .cw-hicons {
    margin-left: 0 !important;
    order: 4;
    gap: 0;
    flex-shrink: 0;
  }
  .cw-hicon {
    padding: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    justify-content: center;
    flex-shrink: 0;
  }
  .cw-hicon span { display: none !important; }
  .cw-hicon[data-hide-mobile] { display: none !important; }

  .cw-catnav { display: none !important; }
  /* Keep shrunk header height stable on mobile */
  .cw-header.is-shrunk .cw-header__inner { height: 56px !important; }
  .cw-header.is-shrunk .cw-catnav { display: none !important; }
  .cw-tabbar { display: block; }
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0)); }

  /* Mobile search overlay — full viewport width */
  .cw-search-overlay {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow: hidden;
  }
  .cw-search-overlay__form { width: 100%; }
  .cw-search-overlay__input { font-size: 16px !important; }

  /* Mobile drawer — sized to viewport, never overlaps header gutters */
  .cw-drawer {
    top: 0;
    width: min(320px, 88vw);
    max-width: 88vw;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 495;
  }
  .cw-backdrop { z-index: 490; }

  /* Global anti-overflow safety */
  html { overflow-x: hidden; }
  body { overflow-x: hidden; max-width: 100vw; }
}
@media (max-width: 640px) {
  /* Footer mobile rules handled in the 768px block above */
  /* Push WhatsApp button above tabbar + safe area */
  .cw-wa { bottom: calc(72px + env(safe-area-inset-bottom, 0)); right: 16px; width: 44px; height: 44px; }
  /* Cookie banner: sits above tabbar, never overlaps */
  .cw-cookie { padding: 12px var(--px); bottom: calc(62px + env(safe-area-inset-bottom, 0)); }
  .cw-cookie__actions { width: 100%; }
  .cw-cookie__btn { flex: 1; text-align: center; }
}

/* Desktop override: hide mobile-only elements */
@media (min-width: 769px) {
  .cw-tabbar { display: none !important; }
  body { padding-bottom: 0 !important; }
  .cw-search-overlay { display: none !important; }
}

/* Mobile search trigger — hidden by default, shown in mobile media query above */
.cw-search-trigger { display: none; }

/* ── Sticky shrink header (Phase 3) ── */
.cw-header { transition: box-shadow .25s, background .25s; }
.cw-header.is-shrunk {
  box-shadow: 0 2px 16px rgba(0,0,0,.10);
  background: #fff !important;
}
.cw-header.is-shrunk .cw-logo__text b { font-size: 15px; transition: font-size .2s; }
.cw-header.is-shrunk .cw-catnav { display: none !important; }
@media (min-width: 769px) {
  .cw-header.is-shrunk .cw-header__inner { height: 52px; transition: height .2s; }
  body.admin-bar .cw-header { top: 32px; }
}

/* ── Dismissible announcement bar (Phase 8) ── */
.cw-announce { position: relative; }
.cw-announce__close {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: rgba(255,255,255,.7); font-size: 16px;
  cursor: pointer; padding: 4px 6px; line-height: 1; font-family: inherit;
}
.cw-announce__close:hover { color: #fff; }
.cw-announce.is-dismissed { display: none; }

/* ── Side Cart Drawer (Phase 6) ── */
.cwv2-cart-drawer {
  position: fixed; inset: 0; z-index: 8000;
  pointer-events: none; visibility: hidden;
}
.cwv2-cart-drawer.is-open { pointer-events: all; visibility: visible; }
.cwv2-cart-drawer__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0; transition: opacity .25s;
}
.cwv2-cart-drawer.is-open .cwv2-cart-drawer__backdrop { opacity: 1; }
.cwv2-cart-drawer__panel {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: min(400px, 92vw); background: #fff;
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s;
  box-shadow: -4px 0 30px rgba(0,0,0,.15);
}
.cwv2-cart-drawer.is-open .cwv2-cart-drawer__panel { transform: translateX(0); }
.cwv2-cart-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.cwv2-cart-drawer__title { font-size: 16px; font-weight: 700; margin: 0; }
.cwv2-cart-drawer__close {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; font-size: 20px; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; color: var(--ink-3);
}
.cwv2-cart-drawer__close:hover { background: var(--off); }
.cwv2-cart-drawer__body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cwv2-cart-drawer__body .woocommerce-mini-cart__empty-message { text-align: center; color: var(--ink-3); padding: 32px 0; }
.cwv2-cart-drawer__body .mini_cart_item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.cwv2-cart-drawer__body .mini_cart_item img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.cwv2-cart-drawer__body .mini_cart_item a:not(.remove_from_cart_button) { font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; display: block; }
.cwv2-cart-drawer__body .mini_cart_item .quantity { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.cwv2-cart-drawer__body .remove_from_cart_button { color: var(--ink-3) !important; font-size: 18px; line-height: 1; }
.cwv2-cart-drawer__body .woocommerce-mini-cart__total { font-size: 14px; font-weight: 700; padding: 12px 0 0; border-top: 1px solid var(--line); margin-top: 4px; display: flex; justify-content: space-between; }
.cwv2-cart-drawer__foot {
  padding: 14px 20px; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex-shrink: 0;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}
.cwv2-cart-drawer__btn {
  display: block; text-align: center; padding: 12px; border-radius: 999px;
  font-weight: 700; font-size: 13px; text-decoration: none;
}
.cwv2-cart-drawer__btn--sec { background: var(--off); color: var(--p); border: 1px solid var(--p); }
.cwv2-cart-drawer__btn--pri { background: var(--p); color: #fff; }
.cwv2-cart-drawer__btn--sec:hover { background: var(--p); color: #fff; }
.cwv2-cart-drawer__btn--pri:hover { background: var(--p-d, #7A1E2F); }

/* ── Mobile safety: Quick View, Side Cart, Scroll-to-Top ── */
@media (max-width: 768px) {
  /* Side cart drawer — full-width bottom sheet on mobile */
  .cwv2-cart-drawer__panel {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 85vh !important;
    top: auto !important;
    bottom: 0 !important;
    right: 0 !important;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%) !important;
  }
  .cwv2-cart-drawer.is-open .cwv2-cart-drawer__panel {
    transform: translateY(0) !important;
  }
  .cwv2-cart-drawer__foot {
    padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
  }

  /* Scroll-to-top — sit above tabbar */
  .cwv2-scroll-top {
    bottom: 76px !important;
    right: 12px !important;
  }

  /* Quick View — bottom-sheet style, full-screen safe */
  .cwv2-qv-overlay { padding: 8px; align-items: flex-end; }
  .cwv2-qv-modal {
    max-height: 90dvh !important;
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
    width: 100% !important;
  }
  .cwv2-qv-inner { grid-template-columns: 1fr !important; gap: 16px; }
  .cwv2-qv-body { padding: 16px; }
  .cwv2-qv-close {
    position: sticky !important;
    top: 8px;
    margin-left: auto;
    margin-right: 8px;
    z-index: 10;
  }
}
