/* ============================================================
   Czech Drinks — Mini-Cart Drawer
   Component styles: header cart icon + slide-out panel
   ============================================================ */

/* ─── Header icon enhancements ─────────────────────────────── */

.cart-total-label {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-70);
  white-space: nowrap;
  transition: color .2s var(--ease);
}
@media (max-width: 760px) { .cart-total-label { display: none; } }

.icon-btn:hover .cart-total-label {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.icon-btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: var(--radius);
}

@keyframes cdBadgePulse {
  0%   { transform: scale(1); }
  38%  { transform: scale(1.64); }
  66%  { transform: scale(0.84); }
  100% { transform: scale(1); }
}
.cart-count.is-pulsing {
  animation: cdBadgePulse 300ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* ─── Backdrop overlay ──────────────────────────────────────── */

.cd-overlay {
  position: fixed; inset: 0; z-index: 298;
  background: rgba(28, 26, 23, 0.46);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.cd-overlay.is-open { opacity: 1; pointer-events: all; }

/* ─── Drawer shell ──────────────────────────────────────────── */

.cd-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 299;
  width: 400px; max-width: 96vw;
  background: var(--paper);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(28, 26, 23, 0.14);
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}
.cd-drawer.is-open { transform: translateX(0); }

/* ─── Drawer head ───────────────────────────────────────────── */

.cd-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--ink-08);
  flex-shrink: 0; gap: 12px;
}
.cd-head-title {
  font-family: var(--display);
  font-size: 21px; font-weight: 400;
  letter-spacing: -.01em; line-height: 1.1;
  margin: 0;
}
.cd-head-count {
  font-family: var(--sans);
  font-size: 13px; font-weight: 400;
  color: var(--ink-55);
  margin-left: 5px;
}
.cd-x-btn {
  flex-shrink: 0; background: none; border: 0; padding: 0;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-55); cursor: pointer;
  border-radius: var(--radius);
  transition: color .18s, background .18s;
  margin: -8px -10px -8px 0;
}
.cd-x-btn:hover { color: var(--ink); background: var(--ink-08); }
.cd-x-btn svg { width: 20px; height: 20px; }

/* ─── Confirmation banner ───────────────────────────────────── */

.cd-confirm {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 24px;
  background: #EAF4EF; color: #1B5E40;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  border-bottom: 1px solid rgba(27, 94, 64, 0.1);
  overflow: hidden; max-height: 48px; opacity: 1;
  transition: max-height .35s ease, opacity .28s ease, padding .35s ease;
}
.cd-confirm.is-hidden { max-height: 0; opacity: 0; padding-block: 0; }
.cd-confirm svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ─── Items scroll area ─────────────────────────────────────── */

.cd-items {
  flex: 1; overflow-y: auto;
  padding: 0 24px;
  overscroll-behavior: contain;
}
.cd-items::-webkit-scrollbar { width: 3px; }
.cd-items::-webkit-scrollbar-thumb { background: var(--ink-15); border-radius: 2px; }

/* ─── Single item ───────────────────────────────────────────── */

.cd-item {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--ink-08);
  transition: opacity .2s ease, transform .2s ease;
}
.cd-item:last-child { border-bottom: 0; }
.cd-item.is-removing { opacity: 0; transform: translateX(14px); pointer-events: none; }

.cd-thumb {
  grid-column: 1; grid-row: 1 / 3;
  width: 68px; height: 68px;
  border-radius: var(--radius); overflow: hidden;
  align-self: start; flex-shrink: 0;
}
.cd-thumb .ph { width: 100%; height: 100%; }

.cd-meta { grid-column: 2; grid-row: 1; align-self: start; min-width: 0; }
.cd-item-name {
  font-family: var(--display);
  font-size: 15px; font-weight: 400; line-height: 1.25;
  margin: 0 0 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cd-variant {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--sans); font-size: 12px; color: var(--ink-55);
}
.cd-dot {
  width: 6px; height: 6px;
  border-radius: 50%; flex-shrink: 0;
}
.cd-dot.amber    { background: var(--amber); }
.cd-dot.burgundy { background: var(--burgundy); }

.cd-price {
  grid-column: 3; grid-row: 1;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  white-space: nowrap; align-self: start; padding-top: 1px;
}

.cd-actions {
  grid-column: 2 / 4; grid-row: 2;
  display: flex; align-items: center; gap: 10px;
  padding-top: 10px;
}

/* Quantity stepper */
.cd-stepper {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--ink-15);
  border-radius: var(--radius); overflow: hidden; height: 34px;
}
.cd-step-btn {
  width: 34px; height: 34px;
  background: none; border: none;
  font-size: 16px; font-weight: 400; line-height: 1;
  color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; font-family: var(--sans); padding: 0;
}
.cd-step-btn:hover:not(:disabled) { background: var(--ink-08); }
.cd-step-btn:disabled { color: var(--ink-40); cursor: default; }
.cd-step-qty {
  min-width: 30px; text-align: center;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  border-inline: 1.5px solid var(--ink-15);
  padding: 0 2px; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.cd-del-btn {
  width: 36px; height: 36px;
  background: none; border: none; cursor: pointer;
  color: var(--ink-40); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  transition: color .18s, background .18s;
  padding: 0; margin-left: auto;
}
.cd-del-btn:hover { color: var(--burgundy); background: var(--burgundy-tint); }
.cd-del-btn svg { width: 14px; height: 14px; }

/* ─── Free-shipping progress bar ────────────────────────────── */

.cd-ship {
  flex-shrink: 0;
  padding: 13px 24px 16px;
  border-top: 1px solid var(--ink-08);
}
.cd-ship-msg {
  font-family: var(--sans); font-size: 12.5px; color: var(--ink-70);
  margin: 0 0 9px;
  display: flex; align-items: center; gap: 6px;
}
.cd-ship-msg strong { font-weight: 700; color: var(--ink); }
.cd-ship-msg.is-free { color: #1B5E40; font-weight: 600; }
.cd-track {
  height: 3px; background: var(--ink-08);
  border-radius: 2px; overflow: hidden;
}
.cd-fill {
  height: 100%; border-radius: 2px; background: var(--amber);
  transition: width .45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.cd-fill.is-full { background: #2A7A50; }

/* ─── Sticky footer ─────────────────────────────────────────── */

.cd-foot {
  flex-shrink: 0;
  padding: 18px 24px 22px;
  border-top: 1px solid var(--ink-15);
}
.cd-subtotal {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
}
.cd-sub-label { font-family: var(--sans); font-size: 14.5px; font-weight: 600; }
.cd-sub-amount {
  font-family: var(--sans); font-size: 19px; font-weight: 700;
  letter-spacing: -.01em;
}
.cd-foot-note {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--sans); font-size: 11px; color: var(--ink-40);
  margin-bottom: 14px; gap: 8px;
}
.cd-age-note { font-weight: 600; }

.cd-btn-checkout {
  display: flex; align-items: center; justify-content: center;
  width: 100%; background: var(--amber); color: #fff;
  font-family: var(--sans); font-size: 15px; font-weight: 700;
  letter-spacing: .01em; padding: 14px 20px;
  border: none; border-radius: var(--radius);
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background .22s var(--ease), transform .22s var(--ease);
  margin-bottom: 8px;
}
.cd-btn-checkout:hover { background: var(--amber-deep); transform: translateY(-1px); }

.cd-btn-cart {
  display: flex; align-items: center; justify-content: center;
  width: 100%; background: transparent; color: var(--ink);
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  padding: 10px 20px;
  border: 1.5px solid var(--ink-15); border-radius: var(--radius);
  cursor: pointer; text-decoration: none; text-align: center;
  transition: border-color .2s, background .2s;
}
.cd-btn-cart:hover { border-color: var(--ink-55); background: var(--ink-08); }

/* ─── Empty state ───────────────────────────────────────────── */

.cd-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 24px; text-align: center;
}
.cd-empty-icon { color: var(--ink-15); margin-bottom: 16px; }
.cd-empty-icon svg { width: 56px; height: 56px; }
.cd-empty-label {
  font-family: var(--display); font-size: 21px; font-weight: 400;
  color: var(--ink-55); margin: 0 0 20px;
}
.cd-empty-shop {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  color: var(--amber-deep);
  border-bottom: 1.5px solid var(--amber-deep); padding-bottom: 1px;
  background: none; border-top: none; border-left: none; border-right: none;
  cursor: pointer; transition: gap .3s var(--ease);
}
.cd-empty-shop:hover { gap: 14px; }
.cd-empty-shop svg { width: 15px; height: 15px; }

/* ─── Mobile (<= 600px) ─────────────────────────────────────── */

@media (max-width: 600px) {
  .cd-drawer { width: 90vw; }
  .cd-head,
  .cd-confirm,
  .cd-items,
  .cd-ship,
  .cd-foot { padding-left: 18px; padding-right: 18px; }
}
