/* Hesap, sepet, ödeme ve yönetim sayfaları + sepet paneli eklemeleri. */

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Sepet paneli ---------- */
.cart__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.cart__secondary {
  display: block;
  padding: 15px;
  border: 1px solid #000;
  border-radius: 1000px;
  color: #000;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .6px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.cart__secondary:hover { background: #f5f5f5; }
.cart-item__qty button:disabled { opacity: .35; cursor: default; }

/* ---------- Header: profil resmi ---------- */
.header__action--avatar { padding: 6px; }
.header__avatar { display: block; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* ---------- Bildirim ---------- */
.toast-box {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 14px 18px;
  border-radius: 10px;
  background: #1e1e1e;
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
  animation: toast-in .25s ease;
  transition: opacity .4s, transform .4s;
}

.toast--error { background: #8b2f27; }
.toast--ok { background: #2f6b45; }
.toast.is-out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Ortak parçalar ---------- */
.muted { color: #767676; }
.field-error { margin: 2px 0 0; color: #b3261e; font-size: 13px; }
.form label.has-error input, .form label.has-error select, .form label.has-error textarea { border-color: #b3261e; }

.box {
  padding: 24px;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  background: #fff;
}

.box + .box { margin-top: 16px; }
.box__title { margin: 0 0 16px; font-size: 18px; font-weight: 500; }
.box__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.box__head .box__title { margin: 0; }

.btn-text {
  padding: 0;
  border: 0;
  background: none;
  color: #000;
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}

.btn-text--danger { color: #b3261e; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 1000px;
  background: #f1f1f1;
  color: #1e1e1e;
  font-size: 12px;
  white-space: nowrap;
}

.badge--odeme_bekleniyor, .badge--acik { background: #fff4e0; color: #8a5a00; }
.badge--odendi, .badge--hazirlaniyor, .badge--yanitlandi { background: #e8f1ec; color: #2f6b45; }
.badge--kargoda { background: #e7eef8; color: #24518a; }
.badge--teslim_edildi { background: #e8f1ec; color: #1f4d31; }
.badge--iptal, .badge--kapandi { background: #f1f1f1; color: #767676; }

.empty-state { padding: 40px 20px; border: 1px dashed #d9d9d9; border-radius: 8px; color: #767676; text-align: center; }
.empty-state .pill { margin-top: 16px; }

.loading { padding: 40px 0; color: #767676; text-align: center; }

/* ---------- Giriş ---------- */
.auth { max-width: 480px; margin: 0 auto; }

.tabs { display: flex; gap: 28px; margin-bottom: 28px; border-bottom: 1px solid #e6e6e6; }

.tabs button {
  position: relative;
  padding: 12px 0;
  border: 0;
  background: none;
  color: #767676;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.tabs button.active { color: #000; }
.tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: #000; }
.auth .form { grid-template-columns: 1fr; }
.auth .pill--solid { width: 100%; }

/* ---------- Hesap paneli ---------- */
.account { display: grid; grid-template-columns: 240px 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }

.account__nav {
  position: sticky;
  top: calc(var(--announce-h) + 24px);
  display: grid;
  gap: 2px;
}

.account__user { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.account__user strong { display: block; font-size: 15px; font-weight: 500; }
.account__user span { font-size: 13px; }

.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 50%;
  background: #e8f1ec;
  color: #587364;
  font-size: 18px;
  font-weight: 500;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 96px; height: 96px; font-size: 34px; }

.account__nav a, .account__nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #1e1e1e;
  font: inherit;
  font-size: 15px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account__nav a:hover, .account__nav button:hover { background: #f5f5f5; }
.account__nav a.active { background: #f1f1f1; font-weight: 500; }
.account__nav .count { min-width: 20px; padding: 1px 6px; border-radius: 10px; background: #587364; color: #fff; font-size: 11px; text-align: center; }

.account__title { margin: 0 0 24px; font-size: clamp(24px, 2.4vw, 32px); font-weight: 400; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-cards .box strong { display: block; font-size: 30px; font-weight: 300; }
.stat-cards .box span { color: #767676; font-size: 13px; }

/* Liste satırları (sipariş, talep, mesaj) */
.rows { border-top: 1px solid #e6e6e6; }

.row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px 4px;
  border-bottom: 1px solid #e6e6e6;
  color: #000;
  font-size: 14px;
  text-decoration: none;
}

a.row:hover { background: #fafafa; }
.row strong { font-weight: 500; }
.row__sub { display: block; margin-top: 2px; color: #767676; font-size: 13px; }
.row--unread strong::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: #587364; vertical-align: middle; }

/* Sipariş detayı */
.order-items { display: grid; gap: 0; border-top: 1px solid #e6e6e6; }

.order-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #e6e6e6;
  font-size: 14px;
}

.order-item img { width: 72px; height: 72px; object-fit: contain; border: 1px solid #eee; border-radius: 6px; background: #fff; }

.totals { display: grid; gap: 8px; margin-top: 16px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals .grand { padding-top: 10px; border-top: 1px solid #e6e6e6; font-size: 17px; font-weight: 500; }

.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; padding: 0 0 18px 24px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: #587364; }
.timeline li::after { content: ""; position: absolute; left: 4px; top: 16px; bottom: 0; width: 1px; background: #e6e6e6; }
.timeline li:last-child::after { display: none; }
.timeline small { display: block; color: #767676; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bank { display: grid; gap: 6px; font-size: 14px; }
.bank code { font-family: inherit; font-weight: 500; letter-spacing: .04em; }

/* Mesajlaşma */
.thread { display: grid; gap: 12px; margin-bottom: 20px; }
.msg { max-width: 82%; padding: 14px 16px; border-radius: 12px; background: #f5f5f5; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.msg--user { justify-self: end; background: #1e1e1e; color: #fff; }
.msg--staff { justify-self: start; background: #e8f1ec; }
.msg small { display: block; margin-top: 6px; opacity: .65; font-size: 12px; }

/* Adres kartları */
.addr { position: relative; display: grid; gap: 4px; font-size: 14px; line-height: 1.5; }
.addr strong { font-size: 15px; font-weight: 500; }
.addr__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.addr--default { border-color: #587364; }

/* Profil resmi */
.avatar-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-bottom: 24px; }

/* ---------- Sepet sayfası ---------- */
.cartpage { display: grid; grid-template-columns: 1fr 360px; gap: clamp(24px, 4vw, 56px); align-items: start; }

.cartline {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid #e6e6e6;
}

.cartline img { width: 110px; height: 110px; object-fit: contain; border: 1px solid #eee; border-radius: 6px; background: #fff; }
.cartline__name { color: #000; font-size: 16px; text-decoration: none; }
.cartline__opt { margin: 4px 0 0; color: #767676; font-size: 13px; }
.cartline__unit { margin: 6px 0 0; font-size: 14px; }
.cartline__side { display: grid; justify-items: end; gap: 10px; }
.cartline__total { font-size: 16px; font-weight: 500; }

.summary { position: sticky; top: calc(var(--announce-h) + 24px); }
.summary .pill--solid { width: 100%; margin-top: 18px; padding: 16px; }

/* ---------- Ödeme ---------- */
.checkout { display: grid; grid-template-columns: 1fr 380px; gap: clamp(24px, 4vw, 56px); align-items: start; }
.step-box { padding: 24px; border: 1px solid #e6e6e6; border-radius: 8px; }
.step-box + .step-box { margin-top: 16px; }
.step-box h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font-size: 18px; font-weight: 500; }
.step-box h2 span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #1e1e1e; color: #fff; font-size: 13px; }

.choices { display: grid; gap: 10px; }

.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.choice:has(input:checked) { border-color: #000; box-shadow: 0 0 0 1px #000; }
.choice input { margin-top: 3px; accent-color: #000; }
.choice strong { display: block; font-weight: 500; }

.segmented { display: inline-flex; padding: 4px; border: 1px solid #e6e6e6; border-radius: 1000px; margin-bottom: 16px; }
.segmented label { padding: 8px 18px; border-radius: 1000px; font-size: 14px; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented label:has(input:checked) { background: #1e1e1e; color: #fff; }

.agree { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 13px; line-height: 1.5; }
.agree input { margin-top: 2px; accent-color: #000; }
.agree a { color: #000; }

.mini-lines { display: grid; gap: 12px; max-height: 320px; overflow-y: auto; margin-bottom: 8px; }
.mini-line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; font-size: 13px; }
.mini-line img { width: 56px; height: 56px; object-fit: contain; border: 1px solid #eee; border-radius: 6px; }

.warn { margin: 12px 0 0; padding: 12px 14px; border-radius: 8px; background: #fff4e0; color: #6b4600; font-size: 13px; line-height: 1.5; }

/* ---------- Sonuç ---------- */
.result { max-width: 640px; margin: 0 auto; text-align: center; }
.result__icon { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%; background: #e8f1ec; color: #2f6b45; font-size: 34px; }
.result__icon--bad { background: #fbe9e7; color: #b3261e; }
.result .box { margin-top: 28px; text-align: left; }
.result__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }

/* ---------- Yönetim ---------- */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

.admin-tabs a {
  padding: 9px 18px;
  border: 1px solid #e6e6e6;
  border-radius: 1000px;
  color: #000;
  font-size: 14px;
  text-decoration: none;
}

.admin-tabs a.active { border-color: #1e1e1e; background: #1e1e1e; color: #fff; }
.filters-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters-inline select { padding: 9px 14px; border: 1px solid #d9d9d9; border-radius: 8px; font: inherit; font-size: 14px; }
.row--admin { grid-template-columns: 1fr 1.2fr 1fr .8fr auto; }
.row--msg { grid-template-columns: 1fr 2fr auto; align-items: start; }
.row--done { opacity: .5; }

/* ---------- Duyarlı ---------- */
@media (max-width: 991.98px) {
  .account { grid-template-columns: 1fr; }

  .account__nav {
    position: static;
    display: flex;
    gap: 6px;
    margin: 0 -16px;
    padding: 0 16px 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .account__nav::-webkit-scrollbar { display: none; }
  .account__user { display: none; }
  .account__nav a, .account__nav button { flex: 0 0 auto; padding: 9px 14px; border: 1px solid #e6e6e6; border-radius: 1000px; font-size: 14px; }
  .account__nav a.active { border-color: #1e1e1e; background: #1e1e1e; color: #fff; }
  .cartpage, .checkout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .row, .row--admin { grid-template-columns: 1fr auto; }
  .row > :nth-child(2), .row > :nth-child(3) { display: none; }
  .row--admin > :nth-child(4) { display: none; }
  .row--msg { grid-template-columns: 1fr; }
  .row--msg > * { display: block !important; }
  .detail-grid { grid-template-columns: 1fr; }
  .cartline { grid-template-columns: 80px 1fr; }
  .cartline img { width: 80px; height: 80px; }
  .cartline__side { grid-column: 1 / -1; grid-template-columns: auto 1fr auto; justify-items: start; align-items: center; }
  .cartline__total { justify-self: end; }
  .msg { max-width: 92%; }
  .box, .step-box { padding: 18px; }
  .order-item { grid-template-columns: 56px 1fr; }
  .order-item img { width: 56px; height: 56px; }
  .order-item > :last-child { grid-column: 2; }
  .cart__actions { grid-template-columns: 1fr; }
}

/* Izgara içindeki kutularda üst boşluk olmasın; uzun içerik ızgarayı taşırmasın. */
.stat-cards > .box, .cards > .box, .detail-grid > .box, .detail-grid > form.box { margin-top: 0; }
.account > *, .cartpage > *, .checkout > *, .detail-grid > * { min-width: 0; }
.page-hero .account__title { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; }
.bank code { overflow-wrap: anywhere; }
.order-item > div, .mini-line > span { min-width: 0; overflow-wrap: anywhere; }
