:root {
  --ink: #5f5146;
  --muted: #9b8c7f;
  --line: #ddd5cc;
  --soft: #f7f4ef;
  --accent: #c5aa84;
  --accent-dark: #a58a67;
  --green: #80c8bc;
  --white: #fff;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #e9e8e5;
  font-family: Arial, Helvetica, sans-serif;
}
body.is-loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
img { display: block; max-width: 100%; }

.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  background: #fff;
  color: #9b795b;
  transition: opacity .45s ease, visibility .45s ease;
}
.loader-mark {
  position: relative;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
}
.loader-mark::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #eadfce;
  border-top-color: var(--green);
  border-radius: 999px;
  animation: spin .9s linear infinite;
}
.loader-mark img { width: 58px; height: 58px; object-fit: contain; }
.loader strong { font-size: 18px; letter-spacing: 0; }
body:not(.is-loading) .loader { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 120px 1fr auto;
  grid-template-rows: 128px 68px;
  align-items: center;
  column-gap: 34px;
  width: 100%;
  padding: 0 max(72px, calc((100% - 1110px) / 2));
  background: #fff;
  border-bottom: 1px solid #d9d4cc;
}
.brand {
  align-self: stretch;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  font-size: 0;
  font-weight: 800;
  letter-spacing: 0;
  color: #8f7255;
}
.brand::after {
  content: "EGE MUTFAĞI";
  display: block;
  max-width: 110px;
  font-size: 16px;
  line-height: 1.05;
  text-align: center;
  color: #9b795b;
}
.brand img { width: 72px; height: 72px; object-fit: contain; }
.brand span { display: none; }
.topbar::before {
  content: "Tek merkezden dağıtım - Hoş geldiniz!";
  grid-column: 2;
  grid-row: 1;
  color: #9a8879;
  font-size: 15px;
}
.topbar nav {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-self: stretch;
  border-top: 1px solid #eee9e2;
  font-weight: 700;
  font-size: 12px;
  color: #9a8879;
}
.topbar nav a {
  display: inline-flex;
  align-items: center;
  min-width: 112px;
  padding: 0 20px;
  border-right: 1px solid #eee9e2;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
.topbar nav a:first-child { border-left: 1px solid #eee9e2; }
.topbar nav a:hover { color: var(--accent-dark); background: #faf8f5; }
.authbar { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.authbar form { margin: 0; }
.authbar button {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 22px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
  transition: transform .18s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(128, 103, 74, .16);
}
.btn.join { background: var(--green); border-color: var(--green); }
.btn.login { background: #dec7aa; border-color: #dec7aa; }
.btn.ghost { background: #fff; color: var(--accent-dark); }
.btn.ghost:hover { color: #fff; background: var(--accent); }
.btn.danger { background: #7f1d1d; border-color: #7f1d1d; }
.btn.danger:hover { background: #5f1515; border-color: #5f1515; }
.flash {
  max-width: 1180px;
  margin: 18px auto 0;
  padding: 14px 18px;
  border: 1px solid #f4b8b0;
  border-radius: 6px;
  background: #fff3f1;
  color: #7f1d1d;
}

.shop {
  display: grid;
  grid-template-columns: 262px minmax(0, 545px) 264px;
  gap: 20px;
  width: min(1110px, calc(100% - 32px));
  margin: 20px auto 42px;
  align-items: start;
}
.categories, .basket, .panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}
.categories, .basket {
  position: sticky;
  top: 20px;
  padding: 10px;
}
.categories h2, .basket h2 {
  margin: 8px 8px 12px;
  font-size: 16px;
  color: var(--muted);
  letter-spacing: 0;
}
.search-box { position: relative; margin-bottom: 16px; }
.search-box input {
  min-height: 38px;
  padding-right: 42px;
  border-color: #d7cfc5;
  color: #8d7d70;
}
.search-box button {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 32px;
  height: 30px;
  border: 0;
  background: transparent;
  color: #c7b68f;
  font-size: 24px;
  cursor: pointer;
}
.categories a {
  display: block;
  padding: 10px 18px;
  border-top: 1px solid #eee9e2;
  border-radius: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  transition: transform .18s ease, background .18s ease, color .18s ease, padding-left .18s ease;
}
.categories a.active, .categories a:hover { background: #d8c29f; color: #fff; padding-left: 24px; }
.categories a:hover { transform: translateX(4px); }
.products { min-width: 0; }
.hero-strip {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 230px;
  height: 170px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid #ebe4dc;
}
.hero-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.94), rgba(255,255,255,.66) 55%, rgba(255,255,255,.18)),
    repeating-linear-gradient(-18deg, rgba(197,170,132,.08) 0 2px, transparent 2px 18px);
}
.hero-strip div {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  padding-left: 64px;
  color: #d4b472;
}
.hero-strip strong {
  width: 230px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.18;
}
.hero-strip span { margin-top: 8px; font-size: 13px; color: #b9aa99; }
.hero-strip img { width: 100%; height: 100%; object-fit: cover; opacity: .86; }
.shop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 12px;
  margin-bottom: 0;
  background: #fff;
  border: 1px solid #ebe4dc;
  border-bottom: 4px solid #d4b986;
}
h1 { margin: 0 0 18px; font-size: 30px; letter-spacing: 0; }
.shop-head h1 { margin: 0; font-size: 16px; font-weight: 500; color: #8d7d70; letter-spacing: 0; }
h2 { margin: 0 0 12px; font-size: 20px; letter-spacing: 0; }
.list-toggle { color: #9f9589; font-size: 24px; line-height: 1; }
.dealer-callout {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 0;
  border: 1px solid #c8e6df;
  border-top: 0;
  border-radius: 0;
  background: #f4fbf9;
  color: #164e49;
  font-size: 13px;
}
.dealer-callout span { color: #27615c; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 28px 8px 18px;
  background: #fff;
  border: 1px solid #ebe4dc;
  border-top: 0;
}
.product-card {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 260px;
  overflow: hidden;
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0 10px 22px;
  text-align: center;
  transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
}
.product-card:hover {
  transform: translateY(-6px);
  background: #fffdf8;
  box-shadow: 0 16px 28px rgba(130, 110, 88, .13);
}
.product-card img {
  width: 112px;
  height: 112px;
  min-height: 112px;
  margin: 0 auto 18px;
  border: 8px solid #efefed;
  border-radius: 999px;
  object-fit: cover;
  filter: saturate(.75);
  transition: transform .25s ease, filter .25s ease, border-color .25s ease;
}
.product-card:hover img {
  transform: scale(1.06) rotate(-1deg);
  filter: saturate(1);
  border-color: #e6dac8;
}
.product-card > div { width: 100%; padding: 0; }
.product-card h3 { min-height: 38px; margin: 0 0 8px; font-size: 15px; font-weight: 500; color: #74675c; letter-spacing: 0; }
.product-card p {
  min-height: 38px;
  max-height: 38px;
  overflow: hidden;
  margin: 0 0 16px;
  color: #a5988e;
  font-size: 12px;
  line-height: 1.55;
}
.buy-row {
  display: grid;
  grid-template-columns: 1fr 46px;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.buy-row strong {
  color: #d5bc94;
  font-size: 15px;
}
.plus-btn, .locked a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 42px;
  border: 1px solid #d7c5aa;
  border-radius: 4px;
  background: #fff;
  color: #d4b88d;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}
.plus-btn:hover, .locked a:hover {
  transform: scale(1.08);
  background: #d4b88d;
  border-color: #d4b88d;
  color: #fff;
}
.plus-btn.is-added {
  animation: pop .32s ease;
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.locked {
  display: grid;
  grid-template-columns: 1fr 46px;
  align-items: center;
  gap: 12px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #c7ae86;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}
.basket p { color: var(--muted); line-height: 1.5; }
.service-box {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  margin-bottom: 14px;
  border: 1px solid #d8c7b0;
  color: #d4b88d;
  font-size: 12px;
  font-weight: 700;
}
.delivery-note {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid #eee4d8;
  background: #fbf8f3;
  color: #9a8879;
  font-size: 13px;
  line-height: 1.5;
}
.cart-summary {
  padding: 14px;
  border-top: 1px solid #eee4d8;
  border-bottom: 1px solid #eee4d8;
  font-weight: 800;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  max-width: min(360px, calc(100% - 48px));
  padding: 13px 16px;
  background: #5f5146;
  color: #fff;
  border-radius: 4px;
  box-shadow: 0 16px 32px rgba(44, 35, 28, .22);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.page, .auth-layout, .dashboard {
  width: min(1180px, calc(100% - 40px));
  margin: 30px auto;
}
.narrow { max-width: 820px; }
.auth-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.panel { padding: 22px; border-radius: 6px; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; color: var(--muted); font-weight: 700; font-size: 14px; }
input, textarea, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}
textarea { min-height: 96px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.muted { color: var(--muted); }
.cart-row {
  display: grid;
  grid-template-columns: 1fr auto 90px;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cart-row input { min-width: 0; height: 42px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; }
.total-box { margin: 16px 0; }
.total-box p { display: flex; justify-content: space-between; color: var(--muted); }
.dashboard {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 22px;
}
.side {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 8px;
  align-self: start;
}
.side a {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}
.side a.active, .side a:hover { border-color: var(--accent); color: var(--accent-dark); }
.notice {
  padding: 15px;
  margin: 0 0 16px;
  border-radius: 8px;
  background: #f0f8ff;
  border: 1px solid #cbe3fa;
  color: #16405f;
  line-height: 1.55;
}
.list-item {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.list-item strong, .list-item span { display: block; }
.list-item span, .list-item p { color: var(--muted); }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.table {
  display: grid;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.tr {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.tr:last-child { border-bottom: 0; }
.tr.head { background: var(--soft); font-weight: 800; color: var(--muted); }
.tr small { display: block; color: var(--muted); margin-top: 4px; }
.admin-form { margin-bottom: 16px; }
.category-form { margin: 18px 0; }
.danger-form { margin: -4px 0 18px; }
.check { align-content: end; grid-template-columns: auto 1fr; color: var(--ink); }
.check input { width: 18px; min-height: 18px; }
.ticket-head { margin-bottom: 16px; }
.ticket-head a { color: var(--accent-dark); font-weight: 800; }
.chat { display: grid; gap: 10px; margin: 12px 0 18px; }
.bubble {
  max-width: 72%;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--soft);
}
.bubble.admin { margin-left: auto; background: #effaf7; }
.bubble p { margin: 6px 0; line-height: 1.45; }
.bubble small { color: var(--muted); }
footer {
  margin-top: 40px;
  padding: 26px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
@media (max-width: 1100px) {
  .topbar { padding: 0 24px; }
  .shop { grid-template-columns: 230px minmax(0, 1fr); }
  .basket { position: static; grid-column: 1 / -1; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 12px;
    padding: 14px;
  }
  .brand { justify-items: start; grid-template-columns: auto 1fr; font-size: 0; }
  .brand::after { text-align: left; }
  .topbar::before { grid-column: 1; grid-row: 2; }
  .topbar nav { grid-row: 3; justify-content: start; overflow-x: auto; }
  .topbar nav a { min-width: max-content; padding: 14px 16px; }
  .authbar { justify-content: space-between; }
  .shop, .dashboard, .auth-layout { grid-template-columns: 1fr; width: min(100% - 24px, 1180px); }
  .categories, .basket, .side { position: static; }
  .hero-strip { grid-template-columns: 1fr; height: 150px; }
  .hero-strip div { padding-left: 22px; }
  .hero-strip img { display: none; }
  .shop-head, .dealer-callout { display: grid; align-items: center; }
  .product-grid { grid-template-columns: 1fr; }
  .buy-row, .cart-row, .grid2, .grid3, .tr { grid-template-columns: 1fr; }
  .bubble { max-width: 100%; }
}
