/* v3955 D19 — Motta Unified Cart Drawer
   Premium tokenları (mc-*, ms-*, mca-*, pa-*, ta-prem-*) ile uyumlu .muc-* token seti.
   Drawer ilk add'de body'ye inject edilir (DOM ağırlığını sıfır pageload'a getirmek için). */

/* ─── Drawer kabuk ─── */
.muc-drawer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
}
.muc-drawer.is-open {
  pointer-events: auto;
}

.muc-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 25, 0.42);
  opacity: 0;
  transition: opacity 0.24s ease;
}
.muc-drawer.is-open .muc-drawer__backdrop {
  opacity: 1;
}

.muc-drawer__panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(260px, 70vw); /* === D36-Ajan4 === 420→260px kompakt drawer */
  background: #ffffff;
  box-shadow: -8px 0 28px rgba(15, 17, 25, 0.18);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  outline: none;
}
.muc-drawer.is-open .muc-drawer__panel {
  transform: translateX(0);
}

/* ─── Hero (üst başlık) ─── */
.muc-drawer__hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(180deg, #fefcf7 0%, #ffffff 100%);
}
.muc-drawer__hero-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.muc-drawer__eyebrow {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a87f2a;
}
.muc-drawer__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #1a1d27;
  letter-spacing: -0.01em;
}

.muc-drawer__close {
  background: transparent;
  border: 0;
  font-size: 28px;
  cursor: pointer;
  color: #6b7280;
  padding: 0 8px;
  line-height: 1;
  transition: color 0.15s ease;
}
.muc-drawer__close:hover {
  color: #0f1119;
}
.muc-drawer__close:focus-visible {
  outline: 2px solid #c39b3a;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── Item listesi ─── */
.muc-drawer__items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.muc-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  background: #f9fafb;
  transition: background 0.15s ease;
}
.muc-item:hover {
  background: #f3f4f6;
}

.muc-item__thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  flex-shrink: 0;
}

.muc-item__body {
  min-width: 0;
}
.muc-item__type {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a87f2a;
  margin-bottom: 2px;
}
.muc-item__name {
  font-weight: 600;
  color: #1a1d27;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.muc-item__sub {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 1px;
}
.muc-item__qty {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 4px;
}

.muc-item__remove {
  background: transparent;
  border: 0;
  font-size: 22px;
  cursor: pointer;
  color: #9ca3af;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s ease;
}
.muc-item__remove:hover {
  color: #dc2626;
}
.muc-item__remove:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
  border-radius: 4px;
}

.muc-empty {
  text-align: center;
  color: #9ca3af;
  padding: 40px 0;
  font-style: italic;
}

/* ─── Footer (totals + checkout) ─── */
.muc-drawer__footer {
  padding: 20px 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #ffffff;
}
.muc-drawer__totals {
  font-size: 1.05rem;
  color: #1a1d27;
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.muc-drawer__total-amount {
  font-weight: 800;
  color: #0f1119;
}
.muc-drawer__cta {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #c39b3a 0%, #a87f2a 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.muc-drawer__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(195, 155, 58, 0.32);
}
.muc-drawer__cta:focus-visible {
  outline: 2px solid #0f1119;
  outline-offset: 2px;
}

/* ─── Global counter badge ([data-cart-count] herhangi bir elemana eklenebilir) ─── */
[data-cart-count]:empty,
[data-cart-count][data-empty="1"] {
  display: none !important;
}
[data-cart-count] {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ─── Mobile (≤480px) ─── */
@media (max-width: 480px) {
  .muc-drawer__panel {
    width: 100vw;
  }
  .muc-drawer__hero {
    padding: 20px 18px 14px;
  }
  .muc-drawer__items {
    padding: 14px 18px;
  }
  .muc-drawer__footer {
    padding: 16px 18px;
  }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .muc-drawer__backdrop,
  .muc-drawer__panel {
    transition: none;
  }
}

/* === D40-B-CART-CHECKOUT START === */
/* D40-B — Premium cart drawer token paketi (320px width, premium typography, gold gradient CTA).
   Mevcut .muc-* token'larını override eder; D19-P4 unified cart logic'i KORUNUR.
   Cart drawer 260→320, item card premium grid (thumb 64 + qty stepper + remove),
   sticky footer (subtotal/KDV/kargo/total + ödemeye geç gold CTA), boş durum SVG illustration. */

.muc-drawer__panel {
  width: min(320px, 86vw); /* D40-B: 260→320 kavrayışlı drawer */
  background: linear-gradient(180deg, #ffffff 0%, #fdfbf6 100%);
  box-shadow: -12px 0 40px rgba(15, 17, 25, 0.22), -2px 0 8px rgba(195, 155, 58, 0.06);
}

.muc-drawer__hero {
  padding: 22px 22px 16px;
  background: linear-gradient(180deg, #fbf6ea 0%, #ffffff 100%);
  border-bottom: 1px solid rgba(195, 155, 58, 0.18);
}
.muc-drawer__title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: #0f1119;
}
.muc-drawer__eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.10em;
  color: #a87f2a;
}
.muc-drawer__close {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  background: rgba(15, 17, 25, 0.04);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.muc-drawer__close::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'><path d='M2 2 L12 12 M12 2 L2 12'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'><path d='M2 2 L12 12 M12 2 L2 12'/></svg>") center/contain no-repeat;
}
.muc-drawer__close:hover {
  background: rgba(195, 155, 58, 0.12);
  color: #a87f2a;
  transform: rotate(90deg);
}

/* Item listesi premium spacing */
.muc-drawer__items {
  padding: 18px 22px;
  gap: 12px;
}

/* Item card — premium grid 64px thumb + content + qty stepper + remove */
.muc-item {
  position: relative;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  padding: 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(15, 17, 25, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.muc-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #c39b3a 0%, #a87f2a 100%);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.muc-item:hover {
  background: #fdfbf6;
  border-color: rgba(195, 155, 58, 0.32);
  box-shadow: 0 4px 14px rgba(15, 17, 25, 0.04);
  transform: translateX(2px);
}
.muc-item:hover::before {
  opacity: 1;
}
.muc-item__thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: #f6f7fa;
  border: 1px solid rgba(15, 17, 25, 0.04);
  overflow: hidden;
}
.muc-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.muc-item__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.muc-item__name {
  font-size: 13px;
  font-weight: 600;
  color: #0f1119;
  line-height: 1.32;
  letter-spacing: -0.005em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.muc-item__variant {
  font-size: 11px;
  color: #6b7280;
  letter-spacing: 0.005em;
  line-height: 1.3;
}
.muc-item__price {
  font-size: 13px;
  font-weight: 700;
  color: #a87f2a;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}

/* Qty stepper — premium 32×32 with gold accent */
.muc-item__qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border-radius: 8px;
  background: #f6f7fa;
  border: 1px solid rgba(15, 17, 25, 0.06);
  overflow: hidden;
}
.muc-item__qty button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  color: #4b5563;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}
.muc-item__qty button:hover:not([disabled]) {
  background: rgba(195, 155, 58, 0.16);
  color: #a87f2a;
}
.muc-item__qty button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.muc-item__qty-value {
  min-width: 26px;
  padding: 0 4px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f1119;
}

/* Remove button — trash SVG, hover red */
.muc-item__remove {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.muc-item__remove::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M2 3.5h10M5.5 3.5V2.5a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v1M3.5 3.5l.5 8a1 1 0 0 0 1 .9h4a1 1 0 0 0 1-.9l.5-8M6 6.5v4M8 6.5v4'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M2 3.5h10M5.5 3.5V2.5a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v1M3.5 3.5l.5 8a1 1 0 0 0 1 .9h4a1 1 0 0 0 1-.9l.5-8M6 6.5v4M8 6.5v4'/></svg>") center/contain no-repeat;
}
.muc-item__remove:hover {
  background: rgba(220, 38, 38, 0.10);
  color: #dc2626;
}

/* Empty state — SVG illustration + CTA */
.muc-drawer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 24px 32px;
  gap: 16px;
}
.muc-drawer__empty-illu {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, rgba(195, 155, 58, 0.10) 0%, rgba(195, 155, 58, 0) 70%),
    linear-gradient(180deg, #fbf6ea 0%, #fdfbf6 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #c39b3a;
}
.muc-drawer__empty-illu::before {
  content: "";
  width: 48px;
  height: 48px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 14h32l-3 22a3 3 0 0 1-3 2.6H14a3 3 0 0 1-3-2.6L8 14z'/><path d='M17 14V9a7 7 0 0 1 14 0v5'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 14h32l-3 22a3 3 0 0 1-3 2.6H14a3 3 0 0 1-3-2.6L8 14z'/><path d='M17 14V9a7 7 0 0 1 14 0v5'/></svg>") center/contain no-repeat;
}
.muc-drawer__empty-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f1119;
  letter-spacing: -0.005em;
}
.muc-drawer__empty-desc {
  margin: 0;
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.5;
  max-width: 220px;
}
.muc-drawer__empty-cta {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #c39b3a 0%, #a87f2a 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.muc-drawer__empty-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(195, 155, 58, 0.32);
}

/* Sticky footer — premium summary + ÖDEMEYE GEÇ CTA */
.muc-drawer__footer {
  padding: 18px 22px 22px;
  border-top: 1px solid rgba(195, 155, 58, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #fdfbf6 100%);
  position: sticky;
  bottom: 0;
}
.muc-drawer__summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}
.muc-drawer__summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12.5px;
  color: #6b7280;
  letter-spacing: 0.005em;
}
.muc-drawer__summary-row strong {
  color: #0f1119;
  font-weight: 600;
}
.muc-drawer__summary-row--total {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed rgba(15, 17, 25, 0.10);
  font-size: 15px;
  color: #0f1119;
}
.muc-drawer__summary-row--total strong {
  font-size: 18px;
  font-weight: 800;
  color: #a87f2a;
  letter-spacing: -0.01em;
}
.muc-drawer__cta {
  height: 52px;
  padding: 0 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, #c39b3a 0%, #a87f2a 100%);
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(168, 127, 42, 0.22);
}
.muc-drawer__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(168, 127, 42, 0.38);
}
.muc-drawer__cta::after {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 7h8M7 3l4 4-4 4'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 7h8M7 3l4 4-4 4'/></svg>") center/contain no-repeat;
}

/* Trust badges row (sticky footer above CTA) */
.muc-drawer__trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
  font-size: 10.5px;
  color: #9ca3af;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.muc-drawer__trust span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.muc-drawer__trust span::before {
  content: "";
  width: 10px;
  height: 10px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'><path d='M5 1.2l3 1.4v3.2c0 1.6-1.3 2.7-3 3.4-1.7-.7-3-1.8-3-3.4V2.6L5 1.2z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'><path d='M5 1.2l3 1.4v3.2c0 1.6-1.3 2.7-3 3.4-1.7-.7-3-1.8-3-3.4V2.6L5 1.2z'/></svg>") center/contain no-repeat;
}

/* Mobile (≤480px) overrides — D40-B */
@media (max-width: 480px) {
  .muc-drawer__panel {
    width: 100vw;
  }
  .muc-drawer__items {
    padding: 14px 18px;
  }
  .muc-drawer__footer {
    padding: 16px 18px 20px;
  }
}

/* === D40-B-CART-CHECKOUT END === */

/* === D51-CHECKOUT-DRAWER START === */
/* D51 — Header count badge (next to "Sepetim" title), trust strip rendered always,
   premium row image fitting, sticky CTA gold gradient ensured.
   Mevcut .muc-* token'lar ile harmoni; D40-B premium altyapısı korunur. */

.muc-drawer__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.muc-drawer__count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: linear-gradient(135deg, #c39b3a 0%, #a87f2a 100%);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px rgba(168, 127, 42, 0.32);
}
.muc-drawer__count-badge[data-empty="1"] {
  background: rgba(15, 17, 25, 0.08);
  color: #6b7280;
  box-shadow: none;
}

/* Trust strip — always shown at footer bottom */
.muc-drawer__footer .muc-drawer__trust {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 17, 25, 0.04);
}

/* Item price subtle alignment fix (D51) */
.muc-item__variant {
  font-size: 11px;
  color: #6b7280;
  letter-spacing: 0.005em;
  line-height: 1.3;
}
.muc-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 9px;
}

/* Skeleton shimmer — quote/save loading */
.muc-drawer__cta[disabled],
.muc-drawer__cta.is-loading {
  position: relative;
  overflow: hidden;
  cursor: progress;
  opacity: 0.92;
}
.muc-drawer__cta.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.22) 50%, transparent 100%);
  animation: mucShimmer 1.2s linear infinite;
}
@keyframes mucShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .muc-drawer__cta.is-loading::before { animation: none; }
}

/* === D51-CHECKOUT-DRAWER END === */
