/* =====================================================================
   base.css — Ortak tasarım sistemi (mağaza + yönetim paneli)
   Bileşenler: düğmeler, formlar, kartlar, uyarılar, rozetler, tablolar,
   sayfalama, sekmeler, modal, toast, boş durum, yardımcı sınıflar.
   ===================================================================== */

:root {
  --c-primary: #1e293b;
  --c-primary-700: #0f172a;
  --c-primary-100: #e2e8f0;
  --c-accent: #ea580c;
  --c-accent-700: #c2410c;
  --c-accent-100: #ffedd5;
  --c-accent-50: #fff7ed;
  --c-bg: #f4f5f7;
  --c-surface: #ffffff;
  --c-surface-2: #f8fafc;
  --c-border: #e2e8f0;
  --c-border-strong: #cbd5e1;
  --c-text: #1e293b;
  --c-muted: #64748b;
  --c-light: #94a3b8;
  --c-success: #16a34a;
  --c-success-50: #f0fdf4;
  --c-danger: #dc2626;
  --c-danger-50: #fef2f2;
  --c-warning: #b45309;
  --c-warning-50: #fffbeb;
  --c-info: #2563eb;
  --c-info-50: #eff6ff;
  --c-whatsapp: #25d366;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 14px rgba(15, 23, 42, .08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, .16);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --container: 1240px;
  --header-h: 72px;
  --t: .18s ease;
}

/* ---------- Sıfırlama ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--c-accent-700); text-decoration: none; }
a:hover { color: var(--c-accent); }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.25; color: var(--c-primary-700); font-weight: 700; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--c-border); margin: 1.5rem 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }

/* ---------- Düzen ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.section { padding-top: 40px; padding-bottom: 40px; }
.section-sm { padding-top: 24px; padding-bottom: 24px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; white-space: nowrap; }
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
}
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }

/* ---------- Düğmeler ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; min-height: 42px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--c-surface); color: var(--c-text);
  font-weight: 600; font-size: .95rem; line-height: 1.2; text-align: center;
  cursor: pointer; transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
  white-space: nowrap; user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--c-accent); color: #fff; }
.btn-primary:hover { background: var(--c-accent-700); color: #fff; }
.btn-dark { background: var(--c-primary); color: #fff; }
.btn-dark:hover { background: var(--c-primary-700); color: #fff; }
.btn-outline { background: transparent; border-color: var(--c-border-strong); color: var(--c-text); }
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary-700); background: var(--c-surface); }
.btn-light { background: var(--c-surface-2); border-color: var(--c-border); color: var(--c-text); }
.btn-light:hover { background: var(--c-primary-100); color: var(--c-text); }
.btn-ghost { background: transparent; color: var(--c-muted); }
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }
.btn-success { background: var(--c-success); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-outline-danger { background: transparent; border-color: #fca5a5; color: var(--c-danger); }
.btn-outline-danger:hover { background: var(--c-danger-50); color: var(--c-danger); }
.btn-whatsapp { background: var(--c-whatsapp); color: #fff; }
.btn-whatsapp:hover { background: #1ebe5b; color: #fff; }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: .85rem; }
.btn-xs { padding: 3px 8px; min-height: 28px; font-size: .8rem; gap: 4px; }
.btn-lg { padding: 13px 26px; min-height: 50px; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: 0; width: 38px; min-height: 38px; height: 38px; }
.btn-icon.btn-sm { width: 32px; height: 32px; min-height: 32px; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link-button { background: none; border: 0; padding: 0; color: var(--c-accent-700); font-weight: 600; cursor: pointer; }
.link-button:hover { color: var(--c-accent); text-decoration: underline; }

/* ---------- Formlar ---------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .9rem; color: var(--c-primary); }
.form-label .required, .required { color: var(--c-danger); margin-left: 2px; }
.form-control, .form-select {
  display: block; width: 100%; min-height: 42px;
  padding: 9px 12px;
  background: var(--c-surface); color: var(--c-text);
  border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm);
  transition: border-color var(--t), box-shadow var(--t);
  font-size: .95rem;
}
.form-control:focus, .form-select:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(234, 88, 12, .15); }
.form-control::placeholder { color: var(--c-light); }
.form-control[readonly], .form-control:disabled { background: var(--c-surface-2); color: var(--c-muted); }
textarea.form-control { min-height: 110px; resize: vertical; }
.form-select {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.form-control-sm { min-height: 34px; padding: 5px 10px; font-size: .85rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .form-row, .form-row.cols-3 { grid-template-columns: minmax(0, 1fr); } }
.form-help { display: block; margin-top: 5px; font-size: .82rem; color: var(--c-muted); }
.form-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; cursor: pointer; line-height: 1.4; }
.form-check input[type="checkbox"], .form-check input[type="radio"] { width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--c-accent); cursor: pointer; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 20px; }
.is-invalid, .form-control.is-invalid, .form-select.is-invalid { border-color: var(--c-danger) !important; }
.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .15) !important; }
.invalid-feedback { margin-top: 5px; font-size: .82rem; color: var(--c-danger); font-weight: 500; }
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: 0; flex: 1; min-width: 0; }
.input-group > :first-child { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
.input-group > :last-child { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
.input-group-text { display: flex; align-items: center; padding: 0 12px; background: var(--c-surface-2); border: 1px solid var(--c-border-strong); color: var(--c-muted); font-size: .9rem; white-space: nowrap; }
.input-group > .input-group-text:first-child { border-right: 0; }
.input-group > .input-group-text:last-child { border-left: 0; }
.input-group .btn { border-radius: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: 12px; }

/* Seçim kartları (radyo düğmeli büyük seçenekler: ödeme yöntemi vb.) */
.choice-list { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border: 1.5px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface);
  cursor: pointer; transition: border-color var(--t), background var(--t);
}
.choice:hover { border-color: var(--c-border-strong); }
.choice input { margin-top: 3px; accent-color: var(--c-accent); width: 18px; height: 18px; flex-shrink: 0; }
.choice:has(input:checked) { border-color: var(--c-accent); background: var(--c-accent-50); }
.choice-title { font-weight: 700; display: block; }
.choice-desc { font-size: .85rem; color: var(--c-muted); display: block; margin-top: 2px; }

/* Adet seçici */
.qty-input { display: inline-flex; align-items: stretch; border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm); background: var(--c-surface); overflow: hidden; }
.qty-input button { width: 38px; border: 0; background: var(--c-surface-2); color: var(--c-text); display: flex; align-items: center; justify-content: center; }
.qty-input button:hover { background: var(--c-primary-100); }
.qty-input input { width: 64px; border: 0; text-align: center; font-weight: 600; -moz-appearance: textfield; appearance: textfield; background: transparent; padding: 6px 4px; }
.qty-input input::-webkit-outer-spin-button, .qty-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input.qty-sm button { width: 30px; }
.qty-input.qty-sm input { width: 50px; padding: 3px; font-size: .9rem; }

/* ---------- Kartlar ---------- */
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--c-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title { margin: 0; font-size: 1.02rem; font-weight: 700; color: var(--c-primary-700); }
.card-body { padding: 18px; }
.card-footer { padding: 14px 18px; border-top: 1px solid var(--c-border); background: var(--c-surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card + .card { margin-top: 20px; }

/* ---------- Uyarılar ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 16px; font-size: .93rem; }
.alert .icon { margin-top: 1px; }
.alert > div { flex: 1; min-width: 0; }
.alert p:last-child { margin-bottom: 0; }
.alert-success { background: var(--c-success-50); border-color: #bbf7d0; color: #166534; }
.alert-error, .alert-danger { background: var(--c-danger-50); border-color: #fecaca; color: #991b1b; }
.alert-warning { background: var(--c-warning-50); border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--c-info-50); border-color: #bfdbfe; color: #1e40af; }
.alert-close { background: none; border: 0; color: inherit; opacity: .6; padding: 0 2px; line-height: 1; font-size: 1.2rem; }
.alert-close:hover { opacity: 1; }
.flash-stack { padding-top: 16px; }
.flash-stack:empty { display: none; }

/* ---------- Rozetler ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; line-height: 1.4; white-space: nowrap; background: var(--c-primary-100); color: var(--c-primary); }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-accent { background: var(--c-accent-100); color: var(--c-accent-700); }
.badge-muted { background: #f1f5f9; color: var(--c-muted); }
.badge-dark { background: var(--c-primary); color: #fff; }

/* ---------- Tablolar ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; font-size: .92rem; }
.table th, .table td { padding: 11px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--c-border); }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--c-muted); font-weight: 700; background: var(--c-surface-2); white-space: nowrap; }
.table tbody tr:hover { background: #fafbfc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num, .table .text-right { text-align: right; white-space: nowrap; }
.table .nowrap { white-space: nowrap; }
.table-sm th, .table-sm td { padding: 7px 10px; }
.table tfoot td { font-weight: 600; background: var(--c-surface-2); }

/* Tanım listesi */
.dl { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 16px; margin: 0; font-size: .93rem; }
.dl dt { color: var(--c-muted); }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }

/* ---------- Sayfalama ---------- */
.pagination { display: flex; justify-content: center; margin: 28px 0 8px; }
.pagination ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pagination a, .pagination span { display: flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text); font-weight: 600; }
.pagination a:hover { border-color: var(--c-accent); color: var(--c-accent-700); }
.pagination .active span { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.pagination .disabled span { color: var(--c-light); background: var(--c-surface-2); }

/* ---------- Sekmeler ---------- */
.tabs-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--c-border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs-nav::-webkit-scrollbar { display: none; }
.tabs-nav button, .tabs-nav a { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 16px; font-weight: 600; color: var(--c-muted); white-space: nowrap; margin-bottom: -1px; }
.tabs-nav button:hover, .tabs-nav a:hover { color: var(--c-text); }
.tabs-nav .active { color: var(--c-accent-700); border-bottom-color: var(--c-accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, .55); }
.modal.open { display: flex; }
.modal-dialog { background: var(--c-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-lg .modal-dialog, .modal-dialog.modal-lg { max-width: 860px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--c-border); }
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--c-border); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { background: none; border: 0; color: var(--c-muted); padding: 4px; border-radius: var(--radius-sm); display: flex; }
.modal-close:hover { background: var(--c-surface-2); color: var(--c-text); }
body.modal-open { overflow: hidden; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; z-index: 1100; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 32px); width: 360px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--c-primary-700); color: #fff; box-shadow: var(--shadow-lg); font-size: .92rem; animation: toast-in .25s ease; }
.toast-success { background: #166534; }
.toast-error { background: #991b1b; }
.toast-warning { background: #92400e; }
.toast a { color: #fff; text-decoration: underline; font-weight: 700; }
.toast.hide { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Boş durum ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--c-muted); }
.empty-state .icon { color: var(--c-light); margin: 0 auto 14px; display: block; }
.empty-state h3 { color: var(--c-primary); margin-bottom: 6px; }
.empty-state p { max-width: 420px; margin: 0 auto 18px; }

/* ---------- Spinner ---------- */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.is-loading { position: relative; pointer-events: none; opacity: .7; }

/* ---------- Yardımcılar ---------- */
.text-muted { color: var(--c-muted) !important; }
.text-light { color: var(--c-light) !important; }
.text-success { color: var(--c-success) !important; }
.text-danger { color: var(--c-danger) !important; }
.text-warning { color: var(--c-warning) !important; }
.text-accent { color: var(--c-accent-700) !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.text-nowrap { white-space: nowrap; }
.text-break { word-break: break-word; }
.fw-normal { font-weight: 400 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.small, small { font-size: .85rem; }
.xsmall { font-size: .78rem; }
.lead { font-size: 1.08rem; color: var(--c-muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px !important; } .mt-2 { margin-top: 16px !important; } .mt-3 { margin-top: 24px !important; } .mt-4 { margin-top: 32px !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px !important; } .mb-2 { margin-bottom: 16px !important; } .mb-3 { margin-bottom: 24px !important; } .mb-4 { margin-bottom: 32px !important; }
.ml-auto { margin-left: auto !important; }
.p-0 { padding: 0 !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.d-block { display: block !important; }
.d-inline-flex { display: inline-flex !important; }
.flex-1 { flex: 1; min-width: 0; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.w-100 { width: 100%; }
.hidden, [hidden] { display: none !important; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 2000; padding: 10px 16px; border-radius: var(--radius-sm); background: var(--c-primary-700); color: #fff; font-weight: 700; }
.skip-link:focus { top: 12px; color: #fff; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.divider { height: 1px; background: var(--c-border); margin: 16px 0; }
.rounded { border-radius: var(--radius); }
.price { font-weight: 800; color: var(--c-primary-700); white-space: nowrap; }
.price-old { color: var(--c-light); text-decoration: line-through; font-weight: 500; white-space: nowrap; }
.price-from { font-size: .8em; font-weight: 500; color: var(--c-muted); }

@media (max-width: 640px) {
  .hide-sm { display: none !important; }
}
@media (min-width: 641px) {
  .show-sm { display: none !important; }
}

/* ---------- Zengin metin içeriği ---------- */
.cms-content { font-size: 1rem; line-height: 1.7; color: #334155; overflow-wrap: break-word; }
.cms-content h2 { font-size: 1.35rem; margin: 1.6em 0 .6em; }
.cms-content h3 { font-size: 1.15rem; margin: 1.4em 0 .5em; }
.cms-content h4 { font-size: 1rem; margin: 1.2em 0 .4em; }
.cms-content > :first-child { margin-top: 0; }
.cms-content ul, .cms-content ol { padding-left: 1.4em; margin: 0 0 1em; }
.cms-content li { margin-bottom: .35em; }
.cms-content table { margin: 1em 0; font-size: .95rem; }
.cms-content th, .cms-content td { border: 1px solid var(--c-border); padding: 8px 10px; text-align: left; }
.cms-content th { background: var(--c-surface-2); }
.cms-content blockquote { margin: 1em 0; padding: 10px 16px; border-left: 4px solid var(--c-accent); background: var(--c-accent-50); }
.cms-content img { border-radius: var(--radius-sm); margin: 1em 0; }
.cms-content a { text-decoration: underline; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}
