/* ── Mini-Cart Styles — Kush & Coil Redesign (Phase 4) ─────────────────── */
/* Scope: contents of .vv-cart-drawer only. Drawer shell is in main.css.    */

/* ── 1. Header ───────────────────────────────────────────────────────────── */

.kc-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-5) var(--s-5) var(--s-4);
  border-bottom: 1px solid var(--vv-grey-200);
}

.kc-cart__head-text {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
}

.kc-cart__title {
  font-family: var(--ff-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: var(--vv-black);
  line-height: 1.1;
  margin: 0;
}

.kc-cart__count {
  font-family: var(--ff-body);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--fg-muted);
  line-height: 1;
}

.kc-cart__close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--vv-grey-100);
  border: none;
  border-radius: var(--r-pill);
  cursor: pointer;
  color: var(--vv-grey-700);
  transition: background var(--dur-fast);
}
.kc-cart__close:hover { background: var(--vv-grey-200); }
.kc-cart__close:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--vv-green-500); }

/* ── 2. Body scroll area ─────────────────────────────────────────────────── */

.vv-cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--s-4) var(--s-5);
  display: flex;
  flex-direction: column;
}

/* ── 3. Item list ────────────────────────────────────────────────────────── */

.kc-cart__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── 4. Line-item row ────────────────────────────────────────────────────── */

.kc-cart__row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  column-gap: var(--s-3);
  align-items: start;
  padding: var(--s-3) var(--s-2);
  border-radius: var(--r-md);
  border-bottom: 1px solid var(--vv-grey-150);
  transition: background var(--dur-fast);
  position: relative;
}
.kc-cart__row:last-child { border-bottom: 0; }
.kc-cart__row:hover { background: var(--vv-grey-50); }

/* Grid placement */
.kc-cart__row-img    { grid-column: 1; grid-row: 1 / 4; align-self: start; }
.kc-cart__row-meta   { grid-column: 2; grid-row: 1 / 4; padding-top: 2px; }
.kc-cart__row-remove { grid-column: 3; grid-row: 1; justify-self: end; }
.kc-cart__row-price  { grid-column: 3; grid-row: 2; justify-self: end; margin-top: var(--s-1); }
.kc-cart__row-unit   { grid-column: 3; grid-row: 3; justify-self: end; }

/* ── 4a. Image ───────────────────────────────────────────────────────────── */

.kc-cart__row-img a { display: block; }

.kc-cart__row-img img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: var(--r-md);
  background: var(--vv-white);
  border: 1px solid var(--vv-grey-150);
  display: block;
}

/* ── 4b. Meta ────────────────────────────────────────────────────────────── */

.kc-cart__row-title {
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--vv-black);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kc-cart__row-title a {
  color: inherit;
  text-decoration: none;
}
.kc-cart__row-title a:hover { text-decoration: underline; }

.kc-cart__row-variant {
  font-family: var(--ff-body);
  font-size: var(--fs-micro);
  color: var(--fg-muted);
  letter-spacing: .02em;
  margin-top: var(--s-1);
}
.kc-cart__row-variant dl,
.kc-cart__row-variant p { margin: 0; }

/* ── 4c. Qty stepper ─────────────────────────────────────────────────────── */

.kc-cart__qty {
  display: inline-flex;
  align-items: stretch;
  height: 32px;
  border: 1px solid var(--vv-grey-200);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: var(--s-2);
}

.kc-qty-minus,
.kc-qty-plus {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--vv-white);
  border: 0;
  cursor: pointer;
  color: var(--vv-black);
  transition: background var(--dur-fast);
  padding: 0;
}
.kc-qty-minus:hover,
.kc-qty-plus:hover  { background: var(--vv-grey-100); }
.kc-qty-minus:active,
.kc-qty-plus:active { background: var(--vv-grey-200); }
.kc-qty-minus:focus-visible,
.kc-qty-plus:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--vv-green-500);
}
.kc-qty-minus[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.kc-qty-num {
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--vv-black);
  border-left: 1px solid var(--vv-grey-200);
  border-right: 1px solid var(--vv-grey-200);
  padding: 0 var(--s-2);
  user-select: none;
}

/* ── 4d. Remove button ───────────────────────────────────────────────────── */

.kc-cart__row-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
  color: var(--vv-grey-500);
  text-decoration: none;
  transition: background var(--dur-fast), color var(--dur-fast);
  padding: 0;
  margin-top: -2px;
}
.kc-cart__row-remove:hover {
  background: var(--vv-grey-100);
  color: var(--vv-danger);
}
.kc-cart__row-remove:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--vv-green-500);
}

/* ── 4e. Price ───────────────────────────────────────────────────────────── */

.kc-cart__row-price {
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--vv-black);
  text-align: right;
  white-space: nowrap;
}

.kc-cart__row-unit {
  font-family: var(--ff-body);
  font-size: var(--fs-micro);
  color: var(--vv-grey-400);
  text-align: right;
  white-space: nowrap;
  margin-top: 2px;
}

/* ── 4f. Row loading state ───────────────────────────────────────────────── */

.kc-cart__row.is-updating {
  opacity: 0.5;
  pointer-events: none;
}
.kc-cart__row.is-updating::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(82, 184, 74, 0.4);
  animation: kc-row-shimmer 1s ease-in-out infinite;
}
@keyframes kc-row-shimmer {
  0%   { opacity: 1; }
  50%  { opacity: 0.2; }
  100% { opacity: 1; }
}

/* ── 5. Totals block ─────────────────────────────────────────────────────── */

.kc-cart__totals {
  margin-top: var(--s-4);
  padding: var(--s-4) 0 0;
  border-top: 1px solid var(--vv-grey-200);
}

.kc-cart__totals-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--s-1) 0;
  font-size: var(--fs-small);
  color: var(--fg-muted);
}

.kc-cart__totals-num {
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  color: var(--vv-black);
  font-weight: 500;
  white-space: nowrap;
}

.kc-cart__totals-row.is-big {
  margin-top: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--vv-grey-200);
  align-items: baseline;
}

.kc-cart__totals-label {
  font-family: var(--ff-display);
  font-size: var(--fs-h3);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--vv-black);
  letter-spacing: .01em;
}

.kc-cart__totals-num.is-big {
  font-family: var(--ff-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--vv-black);
  letter-spacing: -.01em;
}

.kc-cart__foot-note {
  margin-top: var(--s-3);
  text-align: center;
  font-size: var(--fs-micro);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ── 6. Empty state ──────────────────────────────────────────────────────── */

.kc-cart__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  padding: var(--s-12) var(--s-6);
  text-align: center;
}

.kc-cart__empty-icon {
  color: var(--vv-grey-400);
  line-height: 0;
}

.kc-cart__empty-title {
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: var(--fs-h3);
  color: var(--vv-black);
  margin: 0;
}

.kc-cart__empty-sub {
  font-size: var(--fs-small);
  color: var(--fg-muted);
  margin: calc(-1 * var(--s-2)) 0 0;
}

.kc-cart__empty-cta {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 var(--s-5);
  border: 1px solid var(--vv-grey-300);
  border-radius: var(--r-md);
  background: transparent;
  font-family: var(--ff-body);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--vv-black);
  text-decoration: none;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.kc-cart__empty-cta:hover {
  background: var(--vv-grey-50);
  border-color: var(--vv-black);
}
.kc-cart__empty-cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--vv-green-500);
}

/* ── 7. CTA block (in .vv-cart-drawer-foot) ─────────────────────────────── */

.kc-cart__cta-block {
  padding: var(--s-4) var(--s-5) max(var(--s-5), env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  border-top: 1px solid var(--vv-grey-200);
}

.kc-cart__cta-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 52px;
  background: var(--vv-green-500);
  color: var(--vv-black);
  font-family: var(--ff-display);
  font-size: var(--fs-h4);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-radius: var(--r-md);
  border: 0;
  text-decoration: none;
  transition: background var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
  cursor: pointer;
}
.kc-cart__cta-primary:hover  { background: var(--vv-green-600); color: var(--vv-black); }
.kc-cart__cta-primary:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(14,14,14,.12);
}
.kc-cart__cta-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--vv-green-500);
}

.kc-cart__cta-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  background: transparent;
  color: var(--vv-black);
  font-family: var(--ff-body);
  font-size: var(--fs-small);
  font-weight: 600;
  border: 1px solid var(--vv-grey-300);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: background var(--dur-fast), border-color var(--dur-fast);
  cursor: pointer;
}
.kc-cart__cta-secondary:hover {
  background: var(--vv-grey-50);
  border-color: var(--vv-black);
  color: var(--vv-black);
}
.kc-cart__cta-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--vv-green-500);
}

/* ── 8. Drawer-level loading state ───────────────────────────────────────── */

.vv-cart-drawer-body.is-updating {
  position: relative;
  pointer-events: none;
}
.vv-cart-drawer-body.is-updating::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 9. Remove toast ─────────────────────────────────────────────────────── */

.kc-cart__toast {
  font-family: var(--ff-body);
  font-size: var(--fs-micro);
  color: var(--vv-green-600);
  letter-spacing: .04em;
  text-align: center;
  padding: var(--s-2) 0;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--dur-base), transform var(--dur-base);
}
.kc-cart__toast.is-visible {
  opacity: 1;
  transform: none;
}

/* ── 10. Responsive — ≤ 480px ────────────────────────────────────────────── */

@media (max-width: 480px) {
  .kc-cart__head,
  .kc-cart__cta-block {
    padding-left: var(--s-4);
    padding-right: var(--s-4);
  }

  .vv-cart-drawer-body {
    padding-left: var(--s-4);
    padding-right: var(--s-4);
  }

  .kc-cart__row-img img {
    width: 56px;
    height: 56px;
  }
  .kc-cart__row-img { grid-row: 1 / 4; }

  .kc-cart__cta-primary { height: 56px; }
}

/* ── 11. WC compat — strip plugin-injected button duplicates ─────────────── */

/* The before/after hooks may inject coupon fields; hide any stray <p class="buttons"> */
.woocommerce-mini-cart__buttons { display: none !important; }
