/* ═══════════════════════════════════════════════════════
   Cart Drawer — eurosmak
   ═══════════════════════════════════════════════════════ */

/* Hide WC "View Cart" anchor injected by add-to-cart.min.js */
a.added_to_cart.wc-forward { display: none !important; }

/* ── Drawer wrapper (covers full screen, pointer reset) ── */
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s .35s;
}
.cart-drawer.is-open {
  pointer-events: all;
  visibility: visible;
  transition: visibility 0s 0s;
}

/* ── Overlay / backdrop ──────────────────────────────── */
.cart-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background .35s ease;
  cursor: pointer;
}
.cart-drawer.is-open .cart-drawer__overlay {
  background: rgba(0, 0, 0, 0.45);
}

/* ── Slide panel ─────────────────────────────────────── */
.cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 390px;
  max-width: 100vw;
  background: var(--surface, #fff);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  box-shadow: -4px 0 40px rgba(0, 0, 0, 0.14);
  z-index: 1;
  will-change: transform;
}
.cart-drawer.is-open .cart-drawer__panel {
  transform: translateX(0);
}

/* ── Header ──────────────────────────────────────────── */
.cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}
.cart-drawer__title {
  font-family: 'Geologica', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--text, #111);
  margin: 0;
}
.cart-drawer__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-muted, #777);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color .18s, background .18s;
  margin: -6px;
}
.cart-drawer__close:hover {
  color: var(--red, #e53e3e);
  background: rgba(229, 62, 62, 0.09);
}

/* ── Body (scrollable) ───────────────────────────────── */
.cart-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 16px 8px;
  overscroll-behavior: contain;
  position: relative;
  min-height: 100px;
}

/* Loading spinner overlay */
.cart-drawer__body.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.cart-drawer__body.is-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid var(--border, #e5e7eb);
  border-top-color: var(--red, #e53e3e);
  border-radius: 50%;
  animation: cart-spin .7s linear infinite;
  z-index: 3;
}
@keyframes cart-spin {
  to { transform: rotate(360deg); }
}

/* ── Footer ──────────────────────────────────────────── */
.cart-drawer__foot {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
  transition: opacity .2s;
}
.cart-drawer__foot.is-updating {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Cart Item ───────────────────────────────────────── */
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
  transition: opacity .28s ease, transform .28s ease;
  will-change: opacity, transform;
}
.cart-item:last-child {
  border-bottom: none;
}
.cart-item.removing {
  opacity: 0;
  transform: translateX(24px);
}

/* thumbnail */
.cart-item__img-wrap {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--bg, #f3f3f3);
  display: block;
  text-decoration: none;
}
.cart-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s;
}
.cart-item__img-wrap:hover .cart-item__img {
  transform: scale(1.04);
}

/* info column */
.cart-item__info {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cart-item__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #111);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
  transition: color .18s;
}
.cart-item__name:hover {
  color: var(--red, #e53e3e);
}

/* meta row: qty + price */
.cart-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* qty controls */
.cart-item__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  overflow: hidden;
}
.cart-qty-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 28px;
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
  color: var(--text, #222);
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.cart-qty-btn:hover:not(:disabled) {
  background: var(--border, #e5e7eb);
  color: var(--red, #e53e3e);
}
.cart-qty-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.cart-qty-val {
  min-width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #111);
  padding: 0 3px;
  user-select: none;
}

/* price */
.cart-item__price {
  font-size: 14px;
  font-weight: 700;
  color: var(--red, #e53e3e);
  white-space: nowrap;
}
.cart-item__price ins {
  text-decoration: none;
}

/* remove button */
.cart-item__remove {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #bbb);
  padding: 5px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .18s, background .18s;
  align-self: center;
}
.cart-item__remove:hover {
  color: var(--red, #e53e3e);
  background: rgba(229, 62, 62, 0.09);
}

/* ── Footer elements ─────────────────────────────────── */
.cart-foot-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--text, #111);
}
.cart-foot-total strong {
  font-size: 19px;
  font-weight: 700;
  color: var(--red, #e53e3e);
}
.cart-foot-total strong .woocommerce-Price-amount {
  color: inherit;
}

.cart-foot-checkout {
  display: block;
  width: 100%;
  background: var(--red, #e53e3e);
  color: #fff;
  text-align: center;
  padding: 13px 16px;
  border-radius: 8px;
  font-family: 'Geologica', sans-serif;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background .2s, transform .15s;
  margin-bottom: 8px;
  line-height: 1;
}
.cart-foot-checkout:hover {
  background: #c53030;
  transform: translateY(-1px);
  color: #fff;
}
.cart-foot-checkout:active {
  transform: translateY(0);
}

/* ── Empty cart ──────────────────────────────────────── */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 50px 20px 40px;
  text-align: center;
  color: var(--text-muted, #aaa);
}
.cart-empty svg {
  opacity: 0.35;
  display: block;
}
.cart-empty p {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  color: var(--text, #555);
}
.cart-empty__btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 7px;
  background: var(--red, #e53e3e);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}
.cart-empty__btn:hover {
  background: #c53030;
  color: #fff;
}

/* ── Body scroll lock when drawer open ───────────────── */
/*
 * scrollbar-gutter: stable ensures the scrollbar slot is always reserved,
 * so locking overflow never causes a layout jump.
 * The padding-right fallback handles old browsers.
 */
html {
  scrollbar-gutter: stable;
}
body.cart-drawer-open {
  overflow: hidden;
}

/* ── Mobile: full-width panel ────────────────────────── */
@media (max-width: 420px) {
  .cart-drawer__panel {
    width: 100vw;
  }
}
