/**
 * Ortak sepet sayfası — yalnızca siyah/beyaz tonları, tema bağımsız.
 * Tüm kurallar .myt-cart-page veya ortak bileşen sınıfları (header mini sepet) ile sınırlıdır.
 */

/* --- Sayfa gövdesi (tema link/h başlıklarını nötrle) --- */
body.myt-cart-page-body {
  background: #f5f5f5;
}

.myt-cart-page-root {
  margin: 0 auto;
  max-width: 100%;
  width: 100%;
}

.myt-cart-page.myt-cart-page--mono,
.myt-cart-page {
  --myt-fg: #0a0a0a;
  --myt-fg-soft: #404040;
  --myt-muted: #737373;
  --myt-border: #d4d4d4;
  --myt-bg: #ffffff;
  --myt-surface: #f5f5f5;
  --myt-cta: #0a0a0a;
  --myt-cta-hover: #262626;
  --myt-on-cta: #ffffff;
  --myt-cart-thumb: 72px;
  --myt-radius: 8px;
  --myt-gap: clamp(16px, 3vw, 28px);
  background: var(--myt-bg);
  box-sizing: border-box;
  color: var(--myt-fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  isolation: isolate;
  margin: 0 auto;
  max-width: 1120px;
  padding: clamp(14px, 2.5vw, 24px) clamp(12px, 2.5vw, 20px) clamp(24px, 4vw, 40px);
  width: 100%;
  -webkit-font-smoothing: antialiased;
}

.myt-cart-page *,
.myt-cart-page *::before,
.myt-cart-page *::after {
  box-sizing: border-box;
}

.myt-cart-page h1,
.myt-cart-page h2 {
  color: var(--myt-fg);
  font-family: inherit;
  font-weight: 700;
}

.myt-cart-page p {
  margin: 0;
}

.myt-cart-page__container {
  margin: 0 auto;
  max-width: 100%;
}

/* İki sütun: liste | özet */
.myt-cart-page__grid {
  align-items: start;
  display: grid;
  gap: var(--myt-gap);
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .myt-cart-page__grid {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  }
}

.myt-cart-page__col--list,
.myt-cart-page__col--summary {
  min-width: 0;
}

/* Başlık */
.myt-cart-page__head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (min-width: 520px) {
  .myt-cart-page__head {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }
}

.myt-cart-page__back {
  border: 1px solid var(--myt-border);
  border-radius: var(--myt-radius);
  color: var(--myt-fg-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  min-height: 38px;
  padding: 0.35rem 0.75rem;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.myt-cart-page__back:hover {
  background: var(--myt-surface);
  border-color: #a3a3a3;
  color: var(--myt-fg);
}

.myt-cart-page__title {
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}

.myt-cart-page__title-count {
  color: var(--myt-muted);
  font-weight: 600;
}

/* Satır listesi */
.myt-cart-page__lines {
  border-top: 1px solid var(--myt-border);
  display: flex;
  flex-direction: column;
}

.myt-cart-page .new_sepet_classer:not(.myt-cart-page__line) {
  border: 1px dashed var(--myt-border);
  border-radius: var(--myt-radius);
  color: var(--myt-muted);
  font-size: 14px;
  margin-top: 0.5rem;
  padding: 2rem 1.25rem;
  text-align: center;
}

.myt-cart-page__line.myt-cart-row {
  border-bottom: 1px solid var(--myt-border);
  margin: 0;
  padding: 0.55rem 0;
}

/* Sepet (global) kampanyası indirimi bu satıra yazıldı — özet ile satır hizası */
.myt-cart-page__line.myt-cart-row.myt-cart-page__line--sepet-kampanya {
  background: linear-gradient(90deg, rgba(22, 101, 52, 0.07) 0, transparent 12px);
  border-left: 3px solid #15803d;
  border-radius: var(--myt-radius);
  margin-left: -0.25rem;
  padding-left: 0.45rem;
}

#sepetIcerik1[data-myt-line-template] {
  border: 0;
  margin: 0;
  padding: 0;
}

/* Satır: 3 sütun grid */
.myt-cart-row__inner {
  align-items: start;
  column-gap: 1rem;
  display: grid;
  grid-template-columns: var(--myt-cart-thumb) minmax(0, 1fr) minmax(7.5rem, max-content);
  row-gap: 0.5rem;
  width: 100%;
}

.myt-cart-row__thumb {
  align-self: start;
  background: var(--myt-bg);
  border: 1px solid var(--myt-border);
  border-radius: var(--myt-radius);
  display: block;
  height: var(--myt-cart-thumb);
  overflow: hidden;
  width: var(--myt-cart-thumb);
}

.myt-cart-row__thumb img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.myt-cart-row__body {
  margin: 0;
  max-width: 100%;
  min-width: 0;
  text-align: left;
}

/* Başlık + seçenek + kod | adet — dikey yığılmayı kısaltır */
.myt-cart-row__top {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  justify-content: space-between;
}

.myt-cart-row__text {
  flex: 1 1 10rem;
  min-width: 0;
}

.myt-cart-row__title.myt-cart-page__name {
  -webkit-box-orient: vertical;
  color: var(--myt-fg);
  display: -webkit-box;
  font-size: 13px;
  font-weight: 600;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  line-height: 1.3;
  margin: 0 0 0.2rem;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-align: left;
  text-decoration: none;
  word-break: break-word;
}

.myt-cart-row__title.myt-cart-page__name:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.myt-cart-row__body .myt-line-opts {
  color: var(--myt-muted);
  font-size: 11px;
  line-height: 1.3;
  margin: 0 0 0.2rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.myt-cart-row__meta.myt-cart-page__sku {
  line-height: 1.25;
  margin: 0;
}

.myt-cart-page__price-line {
  color: var(--myt-muted);
  font-size: 12px;
}

.myt-cart-page__price-unit {
  color: var(--myt-fg);
  font-weight: 500;
}

.myt-cart-page__sku {
  color: var(--myt-muted);
  font-size: 10px;
}

.myt-cart-row__top .myt-cart-qty {
  flex: 0 0 auto;
  margin-top: 0;
}

.myt-cart-qty {
  align-items: center;
  border: 1px solid var(--myt-border);
  border-radius: 6px;
  display: inline-flex;
  margin-top: 0;
  overflow: hidden;
}

.myt-cart-qty__btn {
  background: var(--myt-bg);
  border: none;
  color: var(--myt-fg);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  min-height: 28px;
  min-width: 28px;
  padding: 0;
  transition: background 0.12s ease;
}

.myt-cart-qty__btn:hover {
  background: var(--myt-surface);
}

.myt-cart-qty__input {
  background: var(--myt-bg);
  border: none;
  border-left: 1px solid var(--myt-border);
  border-right: 1px solid var(--myt-border);
  color: var(--myt-fg);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-height: 28px;
  min-width: 2rem;
  padding: 0.2rem 0.3rem;
  text-align: center;
  width: 2.25rem;
}

.myt-cart-row__aside {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-self: end;
  min-width: 0;
  text-align: right;
}

.myt-cart-page__trash {
  align-items: center;
  align-self: flex-end;
  background: transparent;
  border: none;
  color: var(--myt-muted);
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  margin: 0 0 0 auto;
  min-height: 28px;
  min-width: 28px;
  padding: 0.15rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.myt-cart-page__trash:hover {
  color: var(--myt-fg);
}

.myt-cart-page__trash-ic {
  display: block;
  height: 16px;
  width: 16px;
}

.myt-cart-page__line-totals {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  width: 100%;
}

.myt-cart-page__price-was {
  color: #6b8f72;
  display: block;
  font-size: 12px;
  text-decoration: line-through;
  text-decoration-color: rgba(22, 101, 52, 0.35);
}

.myt-cart-page__line-totals:has(.myt-cart-page__price-was) .myt-cart-page__line-total.price-sell {
  color: #15803d;
  font-weight: 700;
}

.myt-cart-page__line-total {
  color: var(--myt-fg);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.myt-cart-page__line-unit {
  color: var(--myt-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .myt-cart-row__inner {
    grid-template-columns: var(--myt-cart-thumb) minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .myt-cart-row__thumb {
    grid-column: 1;
    grid-row: 1;
  }

  .myt-cart-row__body {
    grid-column: 2;
    grid-row: 1;
  }

  .myt-cart-row__aside {
    align-items: center;
    flex-direction: row;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
    justify-self: stretch;
    text-align: left;
  }

  .myt-cart-page__line-totals {
    align-items: flex-end;
    text-align: right;
    width: auto;
  }

  .myt-cart-page__trash {
    align-self: center;
    margin: 0;
  }
}

/* Özet */
.myt-cart-page__sticky {
  position: relative;
}

@media (min-width: 900px) {
  .cart-price-container-sticky.myt-cart-page__sticky {
    position: sticky;
    top: 1rem;
  }
}

.myt-cart-summary {
  width: 100%;
}

.myt-cart-summary__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.65rem;
}

.myt-cart-page__price-box {
  background: var(--myt-surface);
  border: 1px solid var(--myt-border);
  border-radius: var(--myt-radius);
  padding: 0.9rem 1rem;
}

.myt-cart-page__price-row {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 0.35rem 0.65rem;
  justify-content: space-between;
  margin: 0 0 0.45rem;
}

/* JS: mytSepetOzetSifirSatirlariUygula — 0₺ satırlarını gizle (flex display [hidden]'ı ezer) */
.myt-cart-page__price-row[hidden],
.myt-cart-page__price-row.myt-sepet-ozet-gizli {
  display: none !important;
}

.myt-cart-page__price-row:last-of-type {
  margin-bottom: 0;
}

.myt-cart-page__price-label {
  color: var(--myt-muted);
  flex: 1 1 auto;
  min-width: 0;
}

.myt-cart-page__price-val {
  color: var(--myt-fg);
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* İndirim: yeşil yok — koyu gri vurgu */
.myt-cart-summary__row--discount .myt-cart-summary__discount-val,
.myt-cart-summary__discount-val {
  color: var(--myt-fg-soft);
  font-weight: 600;
}

.myt-cart-page__price-row--total {
  border-top: 1px solid var(--myt-border);
  font-weight: 700;
  margin-top: 0.45rem;
  padding-top: 0.65rem;
}

.myt-cart-page__price-row--total .myt-cart-page__price-label {
  color: var(--myt-fg);
  font-size: 14px;
}

.myt-cart-page__price-row--total .myt-cart-page__price-val {
  font-size: 16px;
}

.myt-cart-summary__ship-note,
.myt-cart-page__price-note {
  color: var(--myt-muted);
  font-size: 12px;
  line-height: 1.4;
  margin: 0.65rem 0 0;
}

.myt-cart-page__price-sep {
  display: none;
}

/* CTA */
.myt-cart-page__cta {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

@media (max-width: 899px) {
  .myt-cart-page__cta {
    background: linear-gradient(to top, #f5f5f5 55%, transparent);
    margin-left: calc(-1 * clamp(12px, 2.5vw, 20px));
    margin-right: calc(-1 * clamp(12px, 2.5vw, 20px));
    padding: 10px clamp(12px, 2.5vw, 20px) max(0.5rem, env(safe-area-inset-bottom));
    position: sticky;
    bottom: 0;
    z-index: 5;
  }
}

.myt-cart-page__cta-mobile {
  align-items: center;
  border: 1px dashed var(--myt-border);
  border-radius: var(--myt-radius);
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
}

@media (min-width: 900px) {
  .myt-cart-page__cta-mobile {
    display: none;
  }
}

.myt-cart-page__checkout {
  align-items: center;
  background: var(--myt-cta);
  border: none;
  border-radius: var(--myt-radius);
  box-sizing: border-box;
  color: var(--myt-on-cta);
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  gap: 0.45rem;
  justify-content: center;
  letter-spacing: 0.04em;
  min-height: 48px;
  padding: 0.75rem 1rem;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s ease;
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .myt-cart-page__checkout {
    transition: none;
  }
}

.myt-cart-page__checkout:hover {
  background: var(--myt-cta-hover);
  color: var(--myt-on-cta);
}

.myt-cart-page__checkout:active {
  opacity: 0.92;
}

.myt-cart-page__checkout-ic {
  flex-shrink: 0;
  opacity: 0.95;
}

.myt-cart-page__trust {
  color: var(--myt-muted);
  display: flex;
  flex-direction: column;
  font-size: 11px;
  gap: 0.3rem;
  line-height: 1.35;
}

.myt-cart-page__trust-item {
  align-items: center;
  display: flex;
  gap: 0.35rem;
}

.myt-cart-page__trust-item svg {
  flex-shrink: 0;
  opacity: 0.8;
}

/* Kupon */
.myt-cart-page__coupon {
  margin-top: 0.75rem;
}

.myt-cart-page__coupon-btn {
  align-items: center;
  background: var(--myt-bg);
  border: 1px solid var(--myt-border);
  border-radius: var(--myt-radius);
  color: var(--myt-fg);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 13px;
  justify-content: space-between;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  text-align: left;
  transition: background 0.15s ease;
  width: 100%;
}

.myt-cart-page__coupon-btn:hover {
  background: var(--myt-surface);
}

.myt-cart-page__indirim-msg {
  font-size: 13px;
  margin: 0.45rem 0 0;
}

.myt-cart-page__applied {
  border-top: 1px solid var(--myt-border);
  margin-top: 0.85rem;
  padding-top: 0.75rem;
}

.myt-cart-page__applied-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 0.45rem;
}

.myt-cart-page__applied-row {
  align-items: flex-start;
  border-bottom: 1px solid var(--myt-border);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 0.45rem;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.myt-cart-page__applied-remove {
  color: var(--myt-muted);
  font-size: 13px;
  text-decoration: underline;
  white-space: nowrap;
}

.myt-cart-page__applied-remove:hover {
  color: var(--myt-fg);
}

/* Header mini sepet (AJAX fragment) — nötr gri ölçek */
.myt-header-cart {
  --myt-cart-border: #d4d4d4;
  --myt-cart-muted: #737373;
  --myt-cart-surface: #f5f5f5;
  font-size: 13px;
  max-width: 100%;
}

.myt-header-cart__items {
  margin-bottom: 0.6rem;
  max-height: min(52vh, 320px);
  overflow-y: auto;
}

.myt-header-cart__row {
  border-bottom: 1px solid var(--myt-cart-border);
  display: flex;
  gap: 0.6rem;
  padding: 0.45rem 0;
  position: relative;
}

.myt-header-cart__thumb {
  flex: 0 0 56px;
  min-width: 0;
  width: 56px;
}

.myt-header-cart__imgwrap {
  background: #fff;
  border: 1px solid var(--myt-cart-border);
  border-radius: 6px;
  height: 56px;
  overflow: hidden;
  width: 56px;
}

.myt-header-cart__imgwrap img {
  display: block;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: cover;
  width: 100%;
}

.myt-header-cart__body {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 1.35rem;
}

.myt-header-cart__remove {
  border-radius: 4px;
  color: var(--myt-cart-muted);
  height: 1.5rem;
  line-height: 1.5rem;
  position: absolute;
  right: 0;
  text-align: center;
  text-decoration: none;
  top: 0.3rem;
  width: 1.5rem;
}

.myt-header-cart__remove:hover {
  background: var(--myt-cart-surface);
  color: #0a0a0a;
}

.myt-header-cart__title {
  color: #0a0a0a;
  font-weight: 500;
  margin: 0.1rem 0;
  word-break: break-word;
}

.myt-header-cart__opts {
  color: var(--myt-cart-muted);
  font-size: 11px;
  line-height: 1.35;
  margin: 0.08rem 0 0;
}

.myt-header-cart__opts:empty {
  display: none;
}

.myt-header-cart__price {
  color: var(--myt-cart-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.myt-header-cart__footer {
  padding-top: 0.3rem;
}

.myt-header-cart__total {
  margin-bottom: 0.45rem;
  text-align: center;
}

.myt-header-cart__total-label {
  color: var(--myt-cart-muted);
  display: block;
  font-size: 12px;
  margin-bottom: 0.1rem;
}

.myt-header-cart__total-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.myt-header-cart__btn {
  border: 1px solid var(--myt-cart-border);
  border-radius: var(--myt-radius, 8px);
  box-sizing: border-box;
  color: inherit;
  display: block;
  font-weight: 600;
  padding: 0.5rem 0.65rem;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s ease;
  width: 100%;
}

.myt-header-cart__btn:hover {
  background: var(--myt-cart-surface);
}

.myt-header-cart__btn--outline {
  border-width: 1px;
}
