/* Parça Gönder — marka teması + açık/koyu mod (Bootstrap 5.3 data-bs-theme) */

:root {
  --pg-brand: #ea580c;        /* turuncu aksan */
  --pg-brand-hover: #c2410c;
  --pg-navy: #1e2a4a;         /* lacivert */
  --pg-sidebar-w: 260px;
}

[data-bs-theme="dark"] {
  --pg-brand: #f97316;
  --pg-brand-hover: #ea580c;
}

/* ---- Marka bileşenleri ---- */

.text-brand { color: var(--pg-brand) !important; }

.btn-brand {
  --bs-btn-bg: var(--pg-brand);
  --bs-btn-border-color: var(--pg-brand);
  --bs-btn-hover-bg: var(--pg-brand-hover);
  --bs-btn-hover-border-color: var(--pg-brand-hover);
  --bs-btn-active-bg: var(--pg-brand-hover);
  --bs-btn-active-border-color: var(--pg-brand-hover);
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
  --bs-btn-disabled-bg: var(--pg-brand);
  --bs-btn-disabled-border-color: var(--pg-brand);
  --bs-btn-disabled-color: #fff;
}

.btn-outline-brand {
  --bs-btn-color: var(--pg-brand);
  --bs-btn-border-color: var(--pg-brand);
  --bs-btn-hover-bg: var(--pg-brand);
  --bs-btn-hover-border-color: var(--pg-brand);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--pg-brand);
  --bs-btn-active-color: #fff;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--pg-brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.brand-icon-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 1.7rem; }

/* ---- Yumuşak renkli durum rozetleri (StatusInfo.Color ile eşleşir) ---- */

.badge-soft-green  { background: #dcfce7; color: #15803d; }
.badge-soft-red    { background: #fee2e2; color: #b91c1c; }
.badge-soft-amber  { background: #fef3c7; color: #b45309; }
.badge-soft-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-soft-indigo { background: #e0e7ff; color: #4338ca; }
.badge-soft-violet { background: #ede9fe; color: #6d28d9; }
.badge-soft-orange { background: #ffedd5; color: #c2410c; }
.badge-soft-gray   { background: #f3f4f6; color: #4b5563; }

[data-bs-theme="dark"] .badge-soft-green  { background: rgba(34,197,94,.15);  color: #4ade80; }
[data-bs-theme="dark"] .badge-soft-red    { background: rgba(239,68,68,.15);  color: #f87171; }
[data-bs-theme="dark"] .badge-soft-amber  { background: rgba(245,158,11,.15); color: #fbbf24; }
[data-bs-theme="dark"] .badge-soft-blue   { background: rgba(59,130,246,.15); color: #60a5fa; }
[data-bs-theme="dark"] .badge-soft-indigo { background: rgba(99,102,241,.15); color: #a5b4fc; }
[data-bs-theme="dark"] .badge-soft-violet { background: rgba(139,92,246,.15); color: #c4b5fd; }
[data-bs-theme="dark"] .badge-soft-orange { background: rgba(249,115,22,.15); color: #fb923c; }
[data-bs-theme="dark"] .badge-soft-gray   { background: rgba(156,163,175,.15);color: #d1d5db; }

.badge-soft-green, .badge-soft-red, .badge-soft-amber, .badge-soft-blue,
.badge-soft-indigo, .badge-soft-violet, .badge-soft-orange, .badge-soft-gray {
  display: inline-block;
  padding: .3em .65em;
  font-size: .78em;
  font-weight: 600;
  border-radius: 50rem;
  white-space: nowrap;
}

/* ---- Tema düğmesi ---- */

[data-bs-theme="light"] .theme-icon-light { display: none; }
[data-bs-theme="dark"] .theme-icon-dark { display: none; }

/* ---- Admin yerleşimi ---- */

.admin-topbar { height: 60px; background: var(--bs-body-bg); position: sticky; top: 0; z-index: 1020; }

.admin-sidebar {
  width: var(--pg-sidebar-w);
  background: var(--bs-body-bg);
  border-right: 1px solid var(--bs-border-color);
}

@media (min-width: 992px) {
  .admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex !important;
    flex-direction: column;
    flex-shrink: 0;
  }
  .admin-sidebar .sidebar-nav { overflow-y: auto; flex-grow: 1; }
  .admin-main { min-width: 0; }
}

.sidebar-brand { height: 60px; }

.side-section {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--bs-secondary-color);
  padding: .85rem .75rem .25rem;
}

.side-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .75rem;
  border-radius: .5rem;
  font-size: .9rem;
  color: var(--bs-body-color);
  text-decoration: none;
  margin-bottom: 1px;
}

.side-link i { font-size: 1rem; width: 1.1rem; text-align: center; color: var(--bs-secondary-color); }
.side-link:hover { background: var(--bs-tertiary-bg); }
.side-link.active { background: rgba(234, 88, 12, .12); color: var(--pg-brand); font-weight: 600; }
.side-link.active i { color: var(--pg-brand); }

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(234, 88, 12, .15);
  color: var(--pg-brand);
  font-size: .8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* KPI kartları */
.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--bs-tertiary-bg);
  color: var(--pg-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* ---- Vitrin ---- */

.top-strip { background: var(--pg-navy); color: #e3e8f2; }
.top-strip a { color: #e3e8f2; }

.nav-link-main {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem .8rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--bs-body-color);
  text-decoration: none;
}
.nav-link-main:hover { color: var(--pg-brand); }

.footer-link { color: var(--bs-secondary-color); text-decoration: none; }
.footer-link:hover { color: var(--pg-brand); }

.trust-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(234, 88, 12, .12);
  color: var(--pg-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* Ürün kartı */
.product-card { position: relative; transition: box-shadow .15s ease; }
.product-card:hover { box-shadow: 0 .5rem 1rem rgba(0,0,0,.09); }

.product-img-wrap {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bs-tertiary-bg);
  border-radius: var(--bs-card-border-radius) var(--bs-card-border-radius) 0 0;
}
.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; }

.product-title {
  color: var(--bs-body-color);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3em;
}
.product-title:hover { color: var(--pg-brand); }

.discount-badge { position: absolute; top: .5rem; left: .5rem; z-index: 2; }

/* Araç seçici kutusu */
.vehicle-selector {
  background: var(--pg-navy);
  border-radius: 1rem;
  color: #fff;
}
[data-bs-theme="dark"] .vehicle-selector { background: #253358; }

/* ---- Modal kapatma X'i: hover'da dönme efekti ---- */

.modal .btn-close,
.offcanvas .btn-close {
  transition: transform .35s ease;
}
.modal .btn-close:hover,
.offcanvas .btn-close:hover {
  transform: rotate(180deg);
}

/* Başlıksız modallarda sağ üst köşeye konumlanan X */
.pg-modal-x {
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 5;
}

/* ---- Büyük ekran kayıt modalı (detay/düzenleme/yeni) ---- */
.pg-record-modal .modal-dialog {
  max-width: min(1160px, 96vw);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.pg-record-modal .modal-content {
  max-height: 94vh;
}
.pg-record-modal .modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bs-body-bg);
}
.pg-record-modal .modal-body {
  padding: 1rem 1.25rem 1.5rem;
}
/* Modal içinde sayfa başlığı (h1/h2) modal header'a taşındığı için gizlenir;
   içerikteki geniş kart kenar boşluklarını modalde sıfırla */
.pg-record-modal .modal-body > .container,
.pg-record-modal .modal-body > .container-fluid,
.pg-record-modal .modal-body > .container-xl {
  padding-left: 0;
  padding-right: 0;
  max-width: 100%;
}

/* ---- Kayıt ekranı: "Esc ile geri dön" ipucu ---- */
.pg-esc-hint {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1050;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .7rem;
  font-size: .8rem;
  color: var(--bs-secondary-color);
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 50rem;
  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .1);
  cursor: pointer;
  opacity: .85;
  transition: opacity .15s ease;
}
.pg-esc-hint:hover { opacity: 1; }
.pg-esc-hint kbd {
  font-size: .72rem;
  padding: .1rem .4rem;
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: .3rem;
  color: var(--bs-body-color);
}
@media print { .pg-esc-hint { display: none !important; } }

/* ---- Klavye ile liste gezinme: aktif satır ---- */

tr.kb-active > td {
  background: rgba(234, 88, 12, .10) !important;
}
tr.kb-active {
  outline: 2px solid var(--pg-brand);
  outline-offset: -2px;
}

/* ---- Yazdırma (fatura) ---- */
@media print {
  .no-print, .admin-sidebar, .admin-topbar, .storefront-header, .storefront-footer { display: none !important; }
  main { padding: 0 !important; }
  body { background: #fff !important; }
}
