/* Ürün Vitrini — mobil öncelikli tasarım */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --bg: #f4f5fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #059669;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px rgba(16, 24, 40, 0.06);
  --topbar-h: 58px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'Noto Sans', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.app {
  padding: 16px 14px calc(28px + env(safe-area-inset-bottom));
  max-width: 1080px;
  margin: 0 auto;
}

/* ------------------------------------------------------------- üst çubuk */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.userchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  max-width: 190px;
}

.userchip .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}

.userchip .uname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 50;
}

.menu[hidden] {
  display: none;
}

.menu a,
.menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  background: none;
  border-radius: 10px;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
}

.menu a:hover,
.menu button:hover {
  background: var(--primary-soft);
}

.menu .danger {
  color: var(--danger);
}

.menu hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 6px 4px;
}

/* ------------------------------------------- uygulama kısayolu oluşturma */
.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.55);
}

.modal-card {
  position: relative;
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  padding: 22px 20px 20px;
}

.modal-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.modal-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.modal-steps {
  margin: 0 0 14px;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  font-size: 14.5px;
}

.modal-steps li::marker {
  color: var(--primary);
  font-weight: 700;
}

.modal-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.auth-card .install-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.auth-card .install-link:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

/* ------------------------------------------------------------ giriş sayfası */
.auth-wrap {
  min-height: calc(100dvh - 40px);
  display: grid;
  place-items: center;
  padding: 20px 0;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 28px 22px 24px;
}

.auth-logo {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  margin: 0 auto 14px;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.35);
}

.auth-card h1 {
  margin: 0 0 4px;
  font-size: 22px;
  text-align: center;
  letter-spacing: -0.02em;
}

.auth-card .sub {
  margin: 0 0 22px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

/* --------------------------------------------------------------- form */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.input,
select.input,
textarea.input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

textarea.input {
  min-height: 92px;
  resize: vertical;
}

/* parola alanı: sağda göster/gizle düğmesi */
.pw-wrap {
  position: relative;
}

.pw-wrap .input {
  padding-right: 46px;
}

.pw-eye {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.pw-eye:hover,
.pw-eye.visible {
  color: var(--primary);
}

.pw-eye:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* girişte “parolayı kaydet” seçeneği */
.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 16px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  user-select: none;
}

.remember input[type='checkbox'] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.06s, background 0.15s;
}

.btn:active {
  transform: scale(0.985);
}

.btn:hover {
  background: var(--primary-dark);
}

.btn.block {
  width: 100%;
}

.btn.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn.secondary:hover {
  background: #f9fafb;
}

.btn.danger {
  background: #fff;
  color: var(--danger);
  border-color: #fecaca;
}

.btn.danger:hover {
  background: var(--danger-soft);
}

.btn.small {
  padding: 7px 12px;
  font-size: 13.5px;
  border-radius: 10px;
}

.btn[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

.linkbtn {
  background: none;
  border: 0;
  color: var(--primary);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  padding: 4px;
}

.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 14px;
}

.hint {
  color: var(--muted);
  font-size: 12.5px;
  margin: 8px 0 0;
}

/* -------------------------------------------------------------- filtreler */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.page-head h1 {
  font-size: 20px;
  margin: 0;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.filters {
  position: sticky;
  top: calc(var(--topbar-h) + env(safe-area-inset-top));
  z-index: 30;
  background: var(--bg);
  padding: 6px 0 10px;
  margin: 0 -14px 12px;
  padding-left: 14px;
  padding-right: 14px;
}

.search {
  position: relative;
  margin-bottom: 10px;
}

.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.search input {
  width: 100%;
  padding: 12px 40px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  outline: none;
  -webkit-appearance: none;
}

.search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.search .clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: #f3f4f6;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  font-size: 16px;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

/* ---------------------------------------------------- yönetim liste araçları */

.adminbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.adminbar select.sortsel {
  width: auto;
  min-width: 170px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 13.5px;
  outline: none;
}

.row .rinfo p.rmeta {
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
}

.chip {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13.5px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.selects {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.selects select {
  flex: 1;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-size: 13.5px;
  font-weight: 600;
  color: #374151;
}

.resultbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

/* --------------------------------------------------------------- liste */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}

.card:active {
  transform: scale(0.985);
}

.card .thumb {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, #6366f1, #a855f7);
}

.card .thumb-fallback {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 42px;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #a855f7);
}

.card .body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.card h3 {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* yalnızca yöneticilere görünen kayıt no + eklenme tarihi */
.card .cardmeta {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

/* yalnızca yöneticilere görünen kapak resmi kimliği + yükleme tarihi */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11.5px;
  font-weight: 600;
}

.tag.grey {
  background: #f3f4f6;
  color: #4b5563;
}

.card .excerpt {
  font-size: 12.5px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty .big {
  font-size: 34px;
  margin-bottom: 8px;
}

.skeleton {
  background: linear-gradient(90deg, #e9eaf2 25%, #f4f5fb 50%, #e9eaf2 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3.7;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* --------------------------------------------------------------- detay */
.backbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px 10px 0;
}

.detail {
  display: grid;
  gap: 16px;
}

.gallery {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #e9eaf2;
}

.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-track > * {
  flex: 0 0 100%;
  scroll-snap-align: center;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

.dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transition: background 0.15s, transform 0.15s;
}

.dots span.on {
  background: #fff;
  transform: scale(1.25);
}

.detail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.detail-card h1 {
  margin: 0 0 6px;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.detail-card .summary {
  color: #374151;
  font-size: 14.5px;
  margin: 10px 0 0;
}

.feat {
  display: grid;
  grid-template-columns: minmax(96px, 38%) 1fr;
  gap: 4px 12px;
  font-size: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.feat:last-child {
  border-bottom: 0;
}

.feat dt {
  color: var(--muted);
  font-weight: 600;
}

.feat dd {
  margin: 0;
}

.section-title {
  font-size: 15px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------- yönetim */
.tabs {
  display: flex;
  gap: 6px;
  background: #e9eaf2;
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.tabs a {
  flex: 1;
  text-align: center;
  padding: 9px 10px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
}

.tabs a.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

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

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
}

.row .rthumb {
  width: 62px;
  height: 62px;
  border-radius: 12px;
  object-fit: cover;
  flex: none;
  background: linear-gradient(135deg, #6366f1, #a855f7);
}

.row .rthumb.fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 24px;
}

.row .rinfo {
  flex: 1;
  min-width: 0;
}

.row .rinfo h3 {
  margin: 0 0 2px;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row .rinfo p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row .ractions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: none;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.feat-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.feat-row .input {
  padding: 9px 11px;
}

.feat-row .feat-k {
  flex: 1.1;
}

.feat-row .feat-v {
  flex: 1.4;
}

.icon-btn {
  flex: none;
  width: 38px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--danger);
  border-color: #fecaca;
}

.imglist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.imgtile {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f3f4f6;
}

.imgtile img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

.imgtile .x {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.imgtile .cover {
  position: absolute;
  top: 5px;
  left: 5px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
}

.filebtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px dashed #c7cbd6;
  border-radius: 12px;
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}

.filebtn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.form-actions .btn {
  flex: 1;
}

.userrow-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge.admin {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.badge.user {
  background: #f3f4f6;
  color: #4b5563;
}

/* Dar ekranlarda kullanıcı satırı: ad ve rol tam görünsün, butonlar alt satıra insin */
@media (max-width: 619px) {
  .row.userrow {
    flex-wrap: wrap;
    align-items: center;
  }

  .row.userrow .rthumb {
    width: 46px;
    height: 46px;
  }

  .row.userrow .userrow-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
    order: 3;
  }

  .row.userrow .userrow-actions .btn {
    flex: 1 1 auto;
  }

  .row.userrow .rinfo h3 {
    white-space: normal;
    overflow: visible;
    word-break: break-word;
  }
}

/* --------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  z-index: 100;
  max-width: calc(100vw - 32px);
  animation: toast-in 0.18s ease;
}

.toast.error {
  background: #b91c1c;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ------------------------------------------------------- gizli ürün + yakınlaştırma */
.row.is-hidden {
  opacity: 0.72;
}

.row.is-hidden .rthumb {
  filter: grayscale(0.45);
}

.switchrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
}

.switchrow input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  flex: none;
}

img.zoomable {
  cursor: zoom-in;
}

.gallery-zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  background: rgba(17, 24, 39, 0.62);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

/* galeri + görüntüleyici önceki/sonraki düğmeleri */
.gal-nav,
.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.gal-nav {
  width: 36px;
  height: 36px;
  font-size: 24px;
  color: #fff;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(3px);
}

.gal-nav.prev {
  left: 8px;
}

.gal-nav.next {
  right: 8px;
}

.viewer-nav {
  width: 46px;
  height: 46px;
  font-size: 30px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.viewer-nav.prev {
  left: calc(10px + env(safe-area-inset-left));
}

.viewer-nav.next {
  right: calc(10px + env(safe-area-inset-right));
}

.gal-nav:hover,
.viewer-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.gal-nav:active,
.viewer-nav:active {
  transform: translateY(-50%) scale(0.92);
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 10, 18, 0.96);
  touch-action: none;
  overscroll-behavior: contain;
}

.viewer-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  touch-action: none;
  cursor: grab;
}

.viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.viewer-close {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.viewer-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
  pointer-events: none;
}

.viewer-count {
  font-weight: 700;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.16);
  padding: 4px 12px;
  border-radius: 999px;
}

.viewer-hint {
  font-size: 11.5px;
  opacity: 0.7;
}

.viewer-zoom {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.viewer-zoom button {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.viewer-zoom button:active {
  background: rgba(255, 255, 255, 0.34);
}

.viewer-zoom .zoom-val {
  min-width: 104px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------- yöneticiye özel meta bilgileri */

.hint.imgmeta {
  margin-top: 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.hint.adminmeta {
  margin: 3px 0 12px;
  color: var(--primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.imgtile .imgid {
  display: block;
  padding: 3px 5px;
  background: #fff;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------- kırılma noktaları */
@media (min-width: 620px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
  }

  .app {
    padding: 22px 22px 40px;
  }

  .filters {
    margin-left: -22px;
    margin-right: -22px;
    padding-left: 22px;
    padding-right: 22px;
  }

  .detail {
    grid-template-columns: 1.1fr 1fr;
    align-items: start;
  }

  .detail .gallery {
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
  }

  .row .rthumb {
    width: 78px;
    height: 78px;
  }
}

@media (min-width: 980px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}
