/* ============================================================
   MERKEZÎ BİLEŞENLER — buton, form, kart, tablo, modal, dropdown,
   toast, lightbox, rozet. Tek noktadan yönetim.
   Klişe YOK: sol şerit/gölge yok, sahte hover-sweep yok,
   satırı zıplatan transform yok, jenerik mor yok.
   ============================================================ */

/* ---------------- BUTON ---------------- */
.btn {
  --btn-bg: var(--grad-primary);
  --btn-fg: var(--on-primary);
  --btn-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--touch);
  padding: 0 var(--sp-5);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-bd); border-radius: var(--r-md);
  transition: background var(--t-base), border-color var(--t-base), color var(--t-base), opacity var(--t-base);
  white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--brand-primary-dark); color: var(--btn-fg); }
.btn:active { background: var(--brand-primary-darker); }
.btn:disabled, .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }

.btn--accent { --btn-bg: var(--grad-accent); --btn-fg: var(--on-accent); }
.btn--accent:hover { background: var(--brand-accent-dark); }
.btn--outline { --btn-bg: transparent; --btn-fg: var(--brand-primary); --btn-bd: var(--border-strong); }
.btn--outline:hover { background: var(--brand-primary-soft); color: var(--brand-primary-dark); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--text); }
.btn--ghost:hover { background: var(--bg-muted); color: var(--text-strong); }
.btn--danger { --btn-bg: var(--c-danger); --btn-fg: #fff; }
.btn--danger:hover { background: #b7291d; }
.btn--success { --btn-bg: var(--c-success); --btn-fg: #fff; }
.btn--muted { --btn-bg: var(--bg-muted); --btn-fg: var(--text-strong); }
.btn--muted:hover { background: var(--c-200); }

.btn--sm { min-height: 34px; padding: 0 var(--sp-3); font-size: var(--fs-xs); }
.btn--lg { min-height: 54px; padding: 0 var(--sp-8); font-size: var(--fs-md); border-radius: var(--r-lg); }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: var(--touch); }
.btn--pill { border-radius: var(--r-pill); }

/* ---------------- FORM ---------------- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field__label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.field__label .req { color: var(--c-danger); }
.field__hint { font-size: var(--fs-xs); color: var(--text-muted); }
.field__error { font-size: var(--fs-xs); color: var(--c-danger); }
.input, .textarea, .select {
  width: 100%; min-height: var(--touch);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm); color: var(--text-strong);
  background: var(--bg-surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { min-height: 120px; resize: vertical; line-height: var(--lh-base); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--brand-primary); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.field.has-error .input, .field.has-error .textarea, .field.has-error .select { border-color: var(--c-danger); }
.select { appearance: none; background-image:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' 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 var(--sp-3) center; padding-right: var(--sp-10); }
.checkbox, .radio { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; font-size: var(--fs-sm); }
.checkbox input, .radio input { width: 18px; height: 18px; accent-color: var(--brand-primary); }

/* ---------------- INPUT + İKON (paylaşımlı) ---------------- */
.input-group { position: relative; }
.input-group .input { padding-inline-start: var(--sp-10); }
.input-group__icon { position: absolute; inset-inline-start: var(--sp-3); top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--text-muted); pointer-events: none; }
.input-group__toggle { position: absolute; inset-inline-end: var(--sp-2); top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--text-muted); }
.input-group__toggle:hover { background: var(--bg-muted); }

/* ---------------- KART ---------------- */
.card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card__body { padding: var(--sp-6); }
.card__header { padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.card__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-strong); }
.card__footer { padding: var(--sp-5) var(--sp-6); border-top: 1px solid var(--border); }

/* ---------------- ROZET ---------------- */
.badge { display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: 2px var(--sp-2); font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  border-radius: var(--r-pill); background: var(--bg-muted); color: var(--text); }
.badge--success { background: var(--c-success-soft); color: var(--c-success); }
.badge--danger  { background: var(--c-danger-soft);  color: var(--c-danger); }
.badge--warning { background: var(--c-warning-soft); color: var(--c-warning); }
.badge--info    { background: var(--c-info-soft);    color: var(--c-info); }
.badge--primary { background: var(--brand-primary-soft); color: var(--brand-primary-dark); }

/* ---------------- ALERT (bilgi bandı) ---------------- */
.alert { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); font-size: var(--fs-sm); }
.alert a { font-weight: var(--fw-semibold); text-decoration: underline; }
.alert--error   { background: var(--c-danger-soft);  color: var(--c-danger); }
.alert--error a { color: var(--c-danger); }
.alert--success { background: var(--c-success-soft); color: var(--c-success); }
.alert--warning { background: var(--c-warning-soft); color: var(--c-warning); }
.alert--warning a { color: var(--c-warning); }
.alert--info    { background: var(--c-info-soft);    color: var(--c-info); }

/* ---------------- TABLO (zebra + tıklanabilir satır) ---------------- */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border);
  border-radius: var(--r-lg); background: var(--bg-surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: var(--sp-3) var(--sp-4); text-align: start; vertical-align: middle; }
.table thead th { background: var(--bg-muted); color: var(--text-strong);
  font-weight: var(--fw-semibold); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tbody tr { border-bottom: 1px solid var(--border); }
.table tbody tr:last-child { border-bottom: none; }
/* zebra */
.table--zebra tbody tr:nth-child(even) { background: var(--c-50); }
/* tıklanabilir satır */
.table--clickable tbody tr { cursor: pointer; transition: background var(--t-fast); }
.table--clickable tbody tr:hover { background: var(--brand-primary-soft); }
.table td.is-actions { white-space: nowrap; text-align: end; }
.table .cell-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: var(--r-sm); cursor: zoom-in; }

/* mobilde tablo aksiyonları gizlenir, satır bottom-sheet açar (JS) */
@media (max-width: 640px) {
  .table td.is-actions { display: none; }
  .table--clickable thead .col-actions { display: none; }
}

/* ---------------- BACKDROP ---------------- */
.backdrop { position: fixed; inset: 0; background: rgba(10,15,26,.55);
  opacity: 0; visibility: hidden; transition: opacity var(--t-base), visibility var(--t-base);
  z-index: var(--z-backdrop); }
.backdrop.is-open { opacity: 1; visibility: visible; }

/* ---------------- MODAL (mobilde bottom-sheet) ---------------- */
.modal { position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: center; padding: var(--sp-4);
  opacity: 0; visibility: hidden; transition: opacity var(--t-base), visibility var(--t-base); }
.modal.is-open { opacity: 1; visibility: visible; }
.modal__dialog {
  width: 100%; max-width: 480px; max-height: 90vh; overflow: auto;
  background: var(--bg-surface); border-radius: var(--r-xl); box-shadow: var(--shadow-pop);
  transform: translateY(12px) scale(.98); transition: transform var(--t-slow);
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.modal__dialog::-webkit-scrollbar { width: 8px; }
.modal__dialog::-webkit-scrollbar-track { background: transparent; }
.modal__dialog::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-pill);
  border: 2px solid var(--bg-surface); }
.modal__dialog::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.modal.is-open .modal__dialog { transform: translateY(0) scale(1); }
.modal--lg .modal__dialog { max-width: 760px; }
.modal--sm .modal__dialog { max-width: 380px; }
.modal__header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--border); }
.modal__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-strong); }
.modal__close { width: 38px; height: 38px; border-radius: var(--r-md); display: grid; place-items: center;
  color: var(--text-muted); transition: background var(--t-fast); }
.modal__close:hover { background: var(--bg-muted); color: var(--text-strong); }
.modal__body { padding: var(--sp-6); }
.modal__footer { padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: var(--sp-3); }
.modal__icon { width: 52px; height: 52px; border-radius: var(--r-pill); display: grid; place-items: center;
  margin-bottom: var(--sp-4); }
.modal__icon svg { width: 26px; height: 26px; }
.modal__icon--danger  { background: var(--c-danger-soft);  color: var(--c-danger); }
.modal__icon--warning { background: var(--c-warning-soft); color: var(--c-warning); }
.modal__icon--success { background: var(--c-success-soft); color: var(--c-success); }
.modal__icon--info    { background: var(--c-info-soft);    color: var(--c-info); }

@media (max-width: 560px) {
  .modal { place-items: end center; padding: 0; }
  .modal__dialog { max-width: 100%; max-height: 88vh; border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(100%); }
  .modal.is-open .modal__dialog { transform: translateY(0); }
  .modal__dialog::before { content: ""; display: block; width: 44px; height: 5px; border-radius: var(--r-pill);
    background: var(--border-strong); margin: var(--sp-3) auto 0; }
}

/* ---------------- CONFIRM / ALERT (merkezî tasarım) ---------------- */
.confirm { text-align: center; padding: var(--sp-2) var(--sp-2) 0; }
.confirm__icon { width: 60px; height: 60px; margin: 0 auto var(--sp-4); border-radius: var(--r-pill);
  display: grid; place-items: center; }
.confirm__icon svg { width: 30px; height: 30px; }
.confirm__icon--warning { background: var(--c-warning-soft); color: var(--c-warning); }
.confirm__icon--danger  { background: var(--c-danger-soft);  color: var(--c-danger); }
.confirm__icon--success { background: var(--c-success-soft); color: var(--c-success); }
.confirm__icon--info    { background: var(--c-info-soft);    color: var(--c-info); }
.confirm__title { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--text-strong); margin-bottom: var(--sp-2); }
.confirm__msg { color: var(--text-muted); font-size: var(--fs-sm); line-height: var(--lh-base); }
/* Confirm modalında footer butonları eşit genişlik */
.modal--sm .modal__footer { gap: var(--sp-3); }
.modal--sm .modal__footer .btn { flex: 1; }

/* ---------------- DROPDOWN ---------------- */
.dropdown { position: relative; display: inline-block; }
.dropdown__menu { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; min-width: 200px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop); padding: var(--sp-2); z-index: var(--z-dropdown);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast); }
.dropdown__menu--end { inset-inline-start: auto; inset-inline-end: 0; }
.dropdown.is-open .dropdown__menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown__item { display: flex; align-items: center; gap: var(--sp-3); width: 100%;
  padding: var(--sp-3) var(--sp-3); border-radius: var(--r-sm); font-size: var(--fs-sm);
  color: var(--text); text-align: start; transition: background var(--t-fast); }
.dropdown__item:hover { background: var(--bg-muted); color: var(--text-strong); }
.dropdown__item.is-danger { color: var(--c-danger); }
.dropdown__item.is-danger:hover { background: var(--c-danger-soft); }
.dropdown__sep { height: 1px; background: var(--border); margin: var(--sp-2) 0; }
.dropdown__item svg { width: 18px; height: 18px; }

/* ---------------- TOAST / BİLDİRİM ---------------- */
.toast-region { position: fixed; z-index: var(--z-toast); bottom: var(--sp-5); inset-inline-end: var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-3); width: min(360px, calc(100vw - 2rem)); }
.toast { display: flex; align-items: flex-start; gap: var(--sp-3);
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop); padding: var(--sp-4);
  transform: translateX(120%); transition: transform var(--t-slow); }
.toast.is-open { transform: translateX(0); }
.toast__icon { flex-shrink: 0; width: 22px; height: 22px; }
.toast__body { flex: 1; font-size: var(--fs-sm); }
.toast__title { font-weight: var(--fw-semibold); color: var(--text-strong); }
.toast__close { color: var(--text-muted); }
.toast--success .toast__icon { color: var(--c-success); }
.toast--danger  .toast__icon { color: var(--c-danger); }
.toast--warning .toast__icon { color: var(--c-warning); }
.toast--info    .toast__icon { color: var(--c-info); }
@media (max-width: 560px) {
  .toast-region { bottom: calc(var(--bottomnav-h) + var(--sp-4)); inset-inline: var(--sp-4); width: auto; }
}

/* ---------------- GÖRSEL IZGARALARI (paylaşımlı — galeri/instagram) ---------------- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }
.gallery-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-md); cursor: zoom-in; transition: opacity var(--t-fast); }
.gallery-grid img:hover { opacity: .9; }
@media (max-width: 800px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 500px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }

.insta-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--sp-2); }
.insta-grid a { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-md); }
.insta-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-base); }
.insta-grid a:hover img { transform: scale(1.06); }
@media (max-width: 800px) { .insta-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------------- BOTTOM-SHEET (mobil menü — paylaşımlı) ---------------- */
.sheet { position: fixed; inset-inline: 0; bottom: 0; z-index: var(--z-modal);
  background: var(--bg-surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-pop);
  transform: translateY(100%); transition: transform var(--t-slow); max-height: 86vh; overflow: auto;
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--sp-4)); }
.sheet.is-open { transform: translateY(0); }
.sheet__handle { width: 44px; height: 5px; border-radius: var(--r-pill); background: var(--border-strong);
  margin: var(--sp-3) auto var(--sp-2); }
.sheet__header { display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-2) var(--sp-5) var(--sp-4); border-bottom: 1px solid var(--border); }
.sheet__title { font-weight: var(--fw-semibold); color: var(--text-strong); }
.sheet__body { padding: var(--sp-3) var(--sp-4); }
.sheet-nav__link { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4); border-radius: var(--r-md); color: var(--text-strong); font-weight: var(--fw-medium);
  min-height: var(--touch); }
.sheet-nav__link:hover, .sheet-nav__link.is-active { background: var(--brand-primary-soft); color: var(--brand-primary-dark); }
.sheet-nav__sub { padding-inline-start: var(--sp-4); }
.sheet-nav__link .chev { width: 18px; height: 18px; transition: transform var(--t-fast); }
.sheet-nav__group.is-open > .sheet-nav__link .chev { transform: rotate(180deg); }
.sheet-nav__group .sheet-nav__sub { display: none; }
.sheet-nav__group.is-open .sheet-nav__sub { display: block; }

/* ---------------- LIGHTBOX ---------------- */
.lightbox { position: fixed; inset: 0; z-index: var(--z-lightbox); background: rgba(6,10,18,.92);
  display: grid; place-items: center; padding: var(--sp-6);
  opacity: 0; visibility: hidden; transition: opacity var(--t-base), visibility var(--t-base); }
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__img { max-width: 92vw; max-height: 82vh; border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  transform: scale(.96); transition: transform var(--t-slow); object-fit: contain; }
.lightbox.is-open .lightbox__img { transform: scale(1); }
.lightbox__caption { position: absolute; bottom: var(--sp-6); left: 0; right: 0; text-align: center;
  color: #e6ecf5; font-size: var(--fs-sm); padding-inline: var(--sp-6); }
.lightbox__btn { position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: var(--r-pill); background: rgba(255,255,255,.12);
  color: #fff; display: grid; place-items: center; transition: background var(--t-fast); }
.lightbox__btn:hover { background: rgba(255,255,255,.24); }
.lightbox__prev { inset-inline-start: var(--sp-5); }
.lightbox__next { inset-inline-end: var(--sp-5); }
.lightbox__close { position: absolute; top: var(--sp-5); inset-inline-end: var(--sp-5);
  width: 46px; height: 46px; border-radius: var(--r-pill); background: rgba(255,255,255,.12); color: #fff;
  display: grid; place-items: center; }
.lightbox__close:hover { background: rgba(255,255,255,.24); }
.lightbox__count { position: absolute; top: var(--sp-6); inset-inline-start: var(--sp-6); color: #cbd5e1; font-size: var(--fs-sm); }
@media (max-width: 560px) { .lightbox__prev, .lightbox__next { width: 42px; height: 42px; } }

/* zoom işaretleyici */
[data-lightbox] { cursor: zoom-in; }

/* ---------------- SAYFA GEÇİŞ PROGRESS BAR ---------------- */
#page-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--brand-accent); z-index: var(--z-progress);
  box-shadow: 0 0 8px color-mix(in srgb, var(--brand-accent) 60%, transparent);
  opacity: 0; transition: width .2s ease, opacity .3s ease; }
#page-progress.is-active { opacity: 1; }

/* ---------------- YÜKLENİYOR (spinner) ---------------- */
.spinner { width: 20px; height: 20px; border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- BOŞ DURUM ---------------- */
.empty-state { text-align: center; padding: var(--sp-16) var(--sp-6); color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto var(--sp-4); opacity: .5; }
