/* shop.bayramcantaskin.com
   Mobil öncelikli: temel kurallar telefon içindir, geniş ekranlar
   min-width sorgularıyla eklenir. */

:root {
  --bg: #f7f8f8;
  --surface: #ffffff;
  --surface-2: #eef1f1;
  --border: #dfe4e4;
  --text: #16211f;
  --text-muted: #5f6e6b;
  --accent: #0f766e;
  --accent-hover: #0c5f59;
  --accent-contrast: #ffffff;
  --whatsapp: #128c7e;
  --danger: #b42318;
  --warn-bg: #fef6e7;
  --warn-text: #7a4b05;
  --logo-from: #0f766e;
  --logo-to: #25d366;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(16 33 31 / 6%), 0 8px 24px rgb(16 33 31 / 6%);
  --wrap: 1120px;
  --gutter: 16px;
  /* Çentikli telefonlarda alt çubuğun ev tuşu çizgisine girmemesi için. */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1413;
    --surface: #161e1d;
    --surface-2: #1e2827;
    --border: #2a3634;
    --text: #e8edec;
    --text-muted: #9aa8a5;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-contrast: #06251f;
    --whatsapp: #1fb457;
    --danger: #f97066;
    --warn-bg: #2d2415;
    --warn-text: #fdd68a;
    --logo-from: #0f766e;
    --logo-to: #25d366;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow-wrap: break-word;
}

/* Alt çubuk varken içeriğin son satırı çubuğun altında kalmasın. */
body.has-sticky { padding-bottom: calc(76px + var(--safe-bottom)); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

h1 { font-size: 1.4rem; line-height: 1.25; margin: 0 0 .25em; }
h2 { font-size: 1.05rem; margin: 0 0 .5em; }
h3 { font-size: 1rem; margin: 0 0 .35em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main.wrap { flex: 1; padding-block: 20px 40px; }

.muted { color: var(--text-muted); }
.small { font-size: .875rem; }
.block { display: block; }
.right { text-align: left; }
.inline { display: inline; }

/* -------------------------------------------------------------- header */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
}

.brand { display: flex; align-items: center; gap: 10px; color: inherit; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-text { min-width: 0; }
.brand strong {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand em {
  display: none;
  font-style: normal;
  font-size: .8rem;
  color: var(--text-muted);
}

.logo-mark { flex: none; border-radius: 10px; }

/* Admin başlığında dört buton var; dar ekranda site adı yer kaplamasın. */
@media (max-width: 480px) {
  .admin-header .brand-text { display: none; }
}

.header-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: .9rem;
  white-space: nowrap;
}
.chip:hover { text-decoration: none; color: var(--text); }
.chip.is-active { background: var(--accent); color: var(--accent-contrast); }

/* ------------------------------------------------------------- butonlar */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  /* Dokunma hedefi en az 44px: parmakla ıskalanmasın. */
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: background-color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }

.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover { filter: brightness(1.07); }
/* WhatsApp logosu: metnin solunda küçük bir işaret. */
.btn-whatsapp .wa-label::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: -3px;
  background: currentColor;
  -webkit-mask: var(--wa-icon) center / contain no-repeat;
  mask: var(--wa-icon) center / contain no-repeat;
}

:root {
  --wa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2 22l5.25-1.38a9.9 9.9 0 0 0 4.79 1.22h.01c5.46 0 9.91-4.45 9.91-9.91C21.96 6.45 17.5 2 12.04 2Zm5.8 14.17c-.24.68-1.42 1.31-1.96 1.35-.5.05-.99.23-3.4-.71-2.86-1.13-4.68-4.05-4.82-4.24-.14-.19-1.15-1.53-1.15-2.92s.73-2.07 1-2.35c.26-.28.58-.35.77-.35s.38 0 .55.01c.18.01.41-.07.64.49.24.57.8 1.96.87 2.1.07.14.12.31.02.5-.09.19-.14.3-.28.47-.14.16-.3.36-.42.49-.14.14-.29.29-.12.57.16.28.73 1.2 1.56 1.94 1.07.95 1.98 1.25 2.26 1.39.28.14.44.12.61-.07.16-.19.7-.82.89-1.1.19-.28.37-.23.63-.14.26.09 1.65.78 1.93.92.28.14.47.21.54.33.07.11.07.66-.17 1.32Z'/%3E%3C/svg%3E");
}

.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

.btn-sm { min-height: 38px; padding: 7px 12px; font-size: .875rem; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------- arama */

.search { display: flex; gap: 8px; margin-bottom: 18px; }
.search input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  /* 16px altına inersek iOS Safari odaklanınca sayfayı yakınlaştırır. */
  font: inherit;
  font-size: 16px;
}

.listing-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

/* --------------------------------------------------------------- ızgara */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.card:hover { border-color: var(--accent); text-decoration: none; }
.card.is-dim .card-media img { filter: grayscale(.8); opacity: .65; }

.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: 10px 12px 12px; }
.card-body h3 {
  font-size: .925rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price { font-weight: 700; font-size: 1rem; margin: 0 0 2px; color: var(--accent); }
.meta { margin: 0; font-size: .8rem; color: var(--text-muted); }

/* --------------------------------------------------------------- rozet */

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.badge-sold { background: var(--danger); color: #fff; border-color: transparent; }
.badge-reserved { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.badge-available { background: var(--accent); color: var(--accent-contrast); border-color: transparent; }

.table .badge, .specs .badge { position: static; }

/* --------------------------------------------------------- ürün detayı */

.breadcrumb { font-size: .875rem; color: var(--text-muted); margin-bottom: 14px; }
.breadcrumb span { margin-inline: 6px; }

.detail { display: grid; gap: 20px; align-items: start; }

.detail-cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.thumbs::-webkit-scrollbar { display: none; }
.thumb {
  flex: none;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
  cursor: pointer;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-active { border-color: var(--accent); }

.detail-info h1 { font-size: 1.35rem; }

.detail-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  margin: 4px 0 16px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-price .small { font-weight: 400; }

.specs {
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.specs > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.specs > div:last-child { border-bottom: 0; }
.specs dt { color: var(--text-muted); font-size: .9rem; }
.specs dd { margin: 0; font-weight: 500; text-align: right; }

.contact-block { margin-bottom: 4px; }
.contact-label {
  margin: 0 0 8px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
}
.contact-row { display: grid; gap: 10px; }
.contact-row .btn { width: 100%; }

.description {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ------------------------------------------------- mobil alt eylem çubuğu */

.sticky-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--gutter) calc(10px + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgb(16 33 31 / 8%);
}
.sticky-price { font-weight: 700; font-size: 1.05rem; color: var(--accent); flex: none; }
.sticky-actions { display: flex; gap: 8px; flex: 1; justify-content: flex-end; min-width: 0; }
.sticky-actions .btn { flex: 1; min-width: 0; max-width: 160px; }
.sticky-actions .wa-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------- admin */

.stats { display: flex; gap: 10px; margin-bottom: 20px; }
.stat {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.stat strong { display: block; font-size: 1.4rem; line-height: 1.2; }
.stat span { color: var(--text-muted); font-size: .8rem; }

.storage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  --storage-fill: var(--accent);
}
.storage.is-warn { --storage-fill: #d97706; }
.storage.is-full { --storage-fill: var(--danger); border-color: var(--danger); }

.storage-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: .9rem;
  margin-bottom: 8px;
}
.storage-head span { color: var(--text-muted); }

.storage-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.storage-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--storage-fill);
  transition: width .3s;
}
.storage p { margin: 8px 0 0; }

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table th, .table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.table tbody tr:last-child td { border-bottom: 0; }
.thumb-cell img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

/* Telefonda tablo satırları kart olarak dizilir. */
.table, .table tbody, .table tr, .table td { display: block; width: 100%; }
.table thead { display: none; }
.table tr { border-bottom: 1px solid var(--border); padding: 12px 0; }
.table td { border: 0; padding: 2px 12px; }
.table tr:last-child { border-bottom: 0; }

/* Yalnızca görselli tabloda (ilanlar) küçük resme sütun ayrılır. */
.table-media tr {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 2px 12px;
  align-items: start;
}
.table-media td { grid-column: 2; }
.table-media .thumb-cell { grid-column: 1; grid-row: 1 / span 4; padding-right: 0; }

.form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form label { display: block; font-weight: 500; font-size: .925rem; }
.form label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; min-height: 44px; }
.form label.check input { width: auto; margin: 0; min-height: 0; width: 20px; height: 20px; }

.form input, .form select, .form textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.form textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.form small { display: block; margin-top: 6px; font-weight: 400; font-size: .8rem; }

.row { display: grid; gap: 14px; }

.form-actions { display: flex; gap: 10px; }
.form-actions .btn { flex: 1; }

.gallery-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.gallery-admin-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}
.gallery-admin-item img { width: 100%; height: 90px; object-fit: cover; }
.gallery-admin-item .btn { width: 100%; border-radius: 0; border-width: 1px 0 0; min-height: 38px; }

.danger-zone {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.danger-zone p { margin: 2px 0 0; font-size: .875rem; }

.login {
  max-width: 380px;
  margin: 32px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.login label { display: block; margin-bottom: 16px; font-size: .925rem; font-weight: 500; }
.login input {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

/* --------------------------------------------------------------- durum */

.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin: 0 0 16px; font-size: .925rem; }
.alert-error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.alert-warn { background: var(--warn-bg); color: var(--warn-text); }
.alert-ok { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

.empty {
  text-align: center;
  padding: 40px 18px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty h1 { font-size: 2.2rem; }
.empty p { margin: 0 0 10px; }

/* -------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: 22px;
  font-size: .875rem;
  color: var(--text-muted);
  scroll-margin-top: 70px;
}
.site-footer p { margin: 0; }
.footer-contacts { margin-bottom: 18px; }
.footer-contacts h2 { color: var(--text); font-size: 1rem; }
.site-footer .contact-row { grid-template-columns: 1fr; }

/* ============================ geniş ekranlar ============================ */

@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
  .contact-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .site-footer .contact-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); max-width: 520px; }
  .row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .form-actions .btn { flex: 0 0 auto; }
  .danger-zone { flex-direction: row; align-items: center; justify-content: space-between; }
  .brand em { display: block; }
  .form { padding: 22px; }
  h1 { font-size: 1.6rem; }
}

@media (min-width: 860px) {
  :root { --gutter: 20px; }
  main.wrap { padding-block: 28px 56px; }
  .detail { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; }
  .detail-info h1 { font-size: 1.5rem; }
  .detail-price { font-size: 1.75rem; }
  .thumb { width: 72px; height: 72px; }
  .stats { gap: 14px; }
  .stat { text-align: left; padding: 14px 18px; }
  .stat strong { font-size: 1.6rem; }

  /* Masaüstünde alt çubuk gereksiz: buton zaten ekranda. */
  .sticky-bar { display: none; }
  body.has-sticky { padding-bottom: 0; }

  /* Tablo gerçek tabloya döner. */
  .table { display: table; }
  .table thead { display: table-header-group; }
  .table tbody { display: table-row-group; }
  .table tr, .table-media tr { display: table-row; padding: 0; }
  .table td, .table-media td { display: table-cell; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .table .thumb-cell { width: 56px; }
  .table .right { text-align: right; white-space: nowrap; }
  .card:hover { transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
