:root {
  --ink: #111111;
  --muted: #707072;
  --subtle: #9a9a9d;
  --line: #e5e5e5;
  --surface: #f5f5f5;
  --white: #ffffff;
  --danger: #b42318;
  --success: #137a3f;
  --nav-height: 74px;
  font-family: "Montserrat", Arial, sans-serif;
  color: var(--ink);
  background: #ededed;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { overflow-y: scroll; background: #ededed; }
body { margin: 0; color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { display: block; }

#app {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 20px);
  overflow-x: hidden;
  background: var(--white);
}

.topbar {
  display: grid;
  place-items: center;
  padding: 25px 20px 20px;
}
.brand { font-size: 23px; font-weight: 700; line-height: 1; letter-spacing: -.8px; text-align: center; }

.search {
  height: 48px;
  margin: 0 20px 16px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 24px;
  background: var(--surface);
}
.search svg { width: 19px; flex: 0 0 auto; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search input::placeholder { color: var(--muted); }

.categories {
  display: flex;
  gap: 8px;
  padding: 0 20px 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }
.category {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.category.active { border-color: var(--ink); background: var(--ink); color: var(--white); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 20px 14px;
}
.section-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.6px; }
.section-head span { color: var(--muted); font-size: 11px; }

.products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px 10px;
  padding: 0 10px 24px;
}
.product { min-width: 0; position: relative; }
.product-photo {
  width: 100%;
  aspect-ratio: .88;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--surface);
}
.product-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.product-photo:active img { transform: scale(.985); }
.like {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  color: var(--ink);
}
.like svg { width: 19px; height: 19px; transition: fill .15s ease, transform .15s ease; }
.like.active svg { fill: currentColor; transform: scale(1.07); }
.product-info { padding: 11px 5px 0; }
.product-info small { display: block; margin-bottom: 5px; color: var(--danger); font-size: 11px; font-weight: 600; }
.product-info h3 { margin: 0 0 6px; font-size: 13px; font-weight: 500; line-height: 1.35; }
.product-info p { margin: 0; font-size: 14px; font-weight: 600; }
.sold-out img { opacity: .45; }

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  width: min(100%, 520px);
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 6px env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(14px);
}
.nav-item {
  min-width: 0;
  height: var(--nav-height);
  padding: 7px 2px 5px;
  display: grid;
  grid-template-rows: 26px 14px;
  place-items: center;
  align-content: center;
  gap: 2px;
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--ink); font-weight: 700; }
.count {
  position: absolute;
  top: 9px;
  left: calc(50% + 8px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 2px solid var(--white);
  border-radius: 10px;
  background: var(--ink);
  color: var(--white);
  font-size: 8px;
  line-height: 1;
}

.page { padding: 24px 20px 36px; }
.page-head { min-height: 44px; display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 27px; font-weight: 650; line-height: 1.1; letter-spacing: -1px; }
.icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
}
.icon-btn svg { width: 20px; height: 20px; }

.detail-page { padding-bottom: 30px; }
.detail-media {
  height: min(62dvh, 520px);
  min-height: 390px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: var(--surface);
}
.detail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: translateY(-5%) scale(1.13);
  transform-origin: center;
}
.detail-back { position: absolute; z-index: 3; top: 16px; left: 16px; }
.detail-like { position: absolute; top: 16px; right: 16px; }
.detail-content { padding: 24px 20px 12px; }
.detail-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 18px; }
.detail-heading h1 { margin: 4px 0 0; font-size: 24px; font-weight: 650; line-height: 1.15; letter-spacing: -.8px; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.price {
  padding: 9px 12px;
  border-radius: 5px;
  background: var(--ink);
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}
.detail-description { margin: 18px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; white-space: pre-line; }
.label { margin: 24px 0 10px; font-size: 14px; font-weight: 600; }
.sizes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.size {
  min-height: 52px;
  padding: 6px 3px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}
.size small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 500; }
.size.active { border-color: var(--ink); background: var(--ink); color: var(--white); }
.size.active small { color: #d7d7d7; }
.size:disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; }

.primary, .secondary, .danger {
  width: 100%;
  min-height: 54px;
  margin-top: 20px;
  border-radius: 27px;
  font-size: 14px;
  font-weight: 600;
}
.primary { border: 1px solid var(--ink); background: var(--ink); color: var(--white); }
.primary:disabled { border-color: #b6b6b6; background: #b6b6b6; cursor: not-allowed; }
.secondary { margin-top: 9px; border: 1px solid var(--line); background: var(--white); color: var(--ink); }
.danger { border: 1px solid #f1b8b4; background: #fff4f3; color: var(--danger); }

.cart-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 28px;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.cart-row img { width: 104px; height: 122px; object-fit: cover; background: var(--surface); }
.cart-row h3 { margin: 2px 0 6px; font-size: 13px; font-weight: 600; }
.cart-row p { margin: 0 0 10px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.cart-row strong { font-size: 13px; }
.qty { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 12px; font-weight: 600; }
.qty button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); }
.qty button:disabled { opacity: .3; }
.remove { align-self: start; padding: 3px; border: 0; background: transparent; color: var(--muted); font-size: 20px; }
.total { display: flex; justify-content: space-between; gap: 20px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--ink); font-size: 16px; font-weight: 700; }

.empty { min-height: 55dvh; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.empty strong { margin-bottom: 7px; color: var(--ink); font-size: 18px; }
.empty span { font-size: 12px; }
.empty .primary { min-width: 240px; }

.field { display: grid; gap: 8px; margin: 16px 0; color: var(--ink); font-size: 12px; font-weight: 600; }
.optional { color: var(--muted); font-size: 10px; font-weight: 400; }
.field input, .field textarea, .admin-search, .admin-page select {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: var(--white);
  color: var(--ink);
  resize: vertical;
}
.field input:focus, .field textarea:focus, .admin-search:focus, .admin-page select:focus { border-color: var(--ink); }
.upload-field input[type="file"] { padding: 8px; color: var(--muted); }
.upload-field input[type="file"]::file-selector-button { margin-right: 10px; padding: 10px 12px; border: 0; border-radius: 20px; background: var(--ink); color: var(--white); font: inherit; }
.delivery-note { padding: 12px 14px; border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 10px; line-height: 1.5; }
.iban { margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.iban span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; }
.iban strong { display: block; overflow-wrap: anywhere; font-size: 15px; }
.iban button { margin-top: 12px; padding: 9px 13px; border: 1px solid var(--ink); border-radius: 20px; background: transparent; font-size: 10px; font-weight: 600; }
.suggestions { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-top: 0; }
.suggestions:empty { display: none; }
.suggestions button { width: 100%; padding: 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--white); color: var(--ink); text-align: left; font-size: 10px; }
.suggestions p { margin: 0; padding: 12px; color: var(--muted); font-size: 10px; }

.order { padding: 18px 0; border-bottom: 1px solid var(--line); }
.order-top, .admin-order-top, .admin-order-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.order h3 { margin: 0; font-size: 14px; }
.order p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.status { font-size: 9px; font-weight: 700; text-transform: uppercase; }
.status-pending { color: #8a5a00; }
.status-paid, .status-fulfilled { color: var(--success); }
.status-cancelled { color: var(--danger); }
.admin-entry { margin-top: 24px; }

.success { padding-top: 60px; text-align: center; }
.success-mark { width: 68px; height: 68px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--white); font-size: 28px; }
.success h1 { margin-bottom: 8px; }
.success p { color: var(--muted); font-size: 13px; line-height: 1.6; }

.admin-page { padding-bottom: 50px; }
.admin-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.admin-stats div { min-height: 84px; padding: 14px; display: grid; align-content: space-between; border-radius: 8px; background: var(--surface); }
.admin-stats strong { font-size: 20px; }
.admin-stats span { color: var(--muted); font-size: 9px; font-weight: 600; text-transform: uppercase; }
.admin-tabs { position: sticky; z-index: 4; top: 0; display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 18px; padding: 5px; border-radius: 24px; background: var(--surface); }
.admin-tabs button, .admin-section-head button, .admin-filters button { padding: 10px; border: 0; border-radius: 20px; background: transparent; color: var(--ink); font-size: 10px; font-weight: 700; }
.admin-block { margin-bottom: 24px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
.admin-block summary { cursor: pointer; font-size: 16px; font-weight: 700; }
.admin-section { scroll-margin-top: 60px; margin-top: 30px; }
.admin-section-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.admin-section-head h2 { margin: 0; font-size: 20px; }
.admin-search { margin: 14px 0 6px; }
.admin-products, .admin-orders { display: grid; gap: 10px; margin-top: 12px; }
.admin-product, .admin-order { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.admin-product.low-stock { border-color: #e0b868; }
.admin-product-main { width: 100%; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; border: 0; background: transparent; color: var(--ink); text-align: left; }
.admin-product img { width: 64px; height: 72px; object-fit: cover; background: var(--surface); }
.admin-product span { min-width: 0; display: grid; gap: 6px; }
.admin-product b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.admin-product small { color: var(--muted); font-size: 9px; }
.admin-filters { display: flex; gap: 6px; padding: 12px 0; overflow-x: auto; }
.admin-filters button { flex: 0 0 auto; border: 1px solid var(--line); }
.admin-filters button.active { border-color: var(--ink); background: var(--ink); color: var(--white); }
.admin-order { padding: 14px; }
.admin-order-top div { display: grid; gap: 4px; }
.admin-order-top span, .admin-order-lines span { color: var(--muted); font-size: 9px; }
.admin-order p { margin: 10px 0 0; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.admin-order a { color: var(--ink); }
.admin-order-lines { display: grid; gap: 5px; margin: 12px 0; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.admin-order-foot select { min-width: 130px; padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); font-size: 10px; }
.admin-empty { padding: 30px 0; color: var(--muted); text-align: center; }
.admin-preview { width: 100%; max-height: 380px; object-fit: contain; border-radius: 8px; background: var(--surface); }
.favorites-grid { padding: 0; }
.switch { display: flex; align-items: center; gap: 8px; margin: 16px 0; font-size: 12px; }

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 14px);
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  transform: translate(-50%, 15px);
  border-radius: 22px;
  background: var(--ink);
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: .18s ease;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.access-denied { min-height: 100dvh; padding: 30px; display: grid; place-items: center; text-align: center; }
.access-denied div { max-width: 340px; }
.access-denied span { display: block; margin-bottom: 28px; font-size: 15px; font-weight: 800; }
.access-denied h1 { margin: 0 0 12px; font-size: 28px; line-height: 1.08; letter-spacing: -1px; }
.access-denied p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

@media (min-width: 521px) {
  #app { box-shadow: 0 0 50px rgba(0,0,0,.08); }
}
