:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --brand: #b8521b;
  --brand-dark: #8f3d12;
  --accent: #2a6f6b;
  --line: #e6e1d8;
  --shadow: 0 6px 20px rgba(31, 41, 51, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden atributi har doim ishlasin (modal/drawer ochilib qolmasligi uchun) */
[hidden] { display: none !important; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.container {
  width: min(1180px, 92%);
  margin: 0 auto;
}

/* HEADER */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  white-space: nowrap;
}
.logo__icon { font-size: 26px; }
.logo__img { height: 34px; display: block; }
.logo__text { color: #16a34a; }
.logo__text strong { color: #e11d2a; }

.search {
  flex: 1;
  display: flex;
  gap: 8px;
  max-width: 620px;
}
.search__input {
  flex: 1;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search__input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(184, 82, 27, .15);
}
.search__btn {
  padding: 11px 18px;
  border: none;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.search__btn:hover { background: var(--brand-dark); }

.cart-btn {
  position: relative;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.cart-btn:hover { border-color: var(--brand); }
.admin-link { text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; }
.cart-count {
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 13px;
  margin-left: 4px;
}

/* HERO */
.hero {
  background: linear-gradient(120deg, #2a6f6b 0%, #1f4f4c 100%);
  color: #fff;
  padding: 60px 0;
}
.hero__text h1 { font-size: 38px; margin-bottom: 12px; }
.hero__text p { font-size: 18px; opacity: .9; margin-bottom: 22px; max-width: 540px; }

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--block { width: 100%; text-align: center; }

/* CATEGORIES */
.categories {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 26px 0 6px;
}
.cat-chip {
  padding: 9px 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all .2s;
}
.cat-chip:hover { border-color: var(--brand); }
.cat-chip.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* CATALOG */
.section-title {
  font-size: 24px;
  margin: 24px 0 18px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 22px;
  padding-bottom: 40px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s, box-shadow .18s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.card__cover {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  position: relative;
}
.card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  z-index: 1;
}
.card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card__body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.card__title { font-size: 16px; font-weight: 700; }
.card__author { font-size: 14px; color: var(--muted); }
.card__bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
}
.card__price { font-size: 17px; font-weight: 700; color: var(--brand); }
.card__add {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.card__add:hover { background: #1f4f4c; }

.empty {
  text-align: center;
  font-size: 18px;
  color: var(--muted);
  padding: 60px 0;
}

/* FOOTER */
.footer {
  background: var(--ink);
  color: #cbd2d9;
  padding: 26px 0;
  text-align: center;
  font-size: 14px;
  margin-top: 20px;
}

/* CART DRAWER */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer__overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
}
.drawer__panel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: min(380px, 90%);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px; border-bottom: 1px solid var(--line);
}
.drawer__close {
  border: none; background: none; font-size: 20px; cursor: pointer; color: var(--muted);
}
.drawer__items { flex: 1; overflow-y: auto; padding: 12px 18px; }
.cart-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.cart-item__emoji { font-size: 30px; width: 38px; height: 48px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cart-item__emoji img { width: 38px; height: 48px; object-fit: cover; border-radius: 6px; }
.cart-item__info { flex: 1; }
.cart-item__title { font-weight: 600; font-size: 14px; }
.cart-item__price { color: var(--muted); font-size: 13px; }
.cart-item__remove {
  border: none; background: none; color: #c0392b; cursor: pointer; font-size: 18px;
}
.drawer__foot { padding: 18px; border-top: 1px solid var(--line); }
.drawer__total { font-size: 16px; margin-bottom: 12px; }
.cart-empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* MENING BUYURTMALARIM */
.ord-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}
.ord-card__top { display: flex; align-items: center; justify-content: space-between; }
.ord-no { font-weight: 700; }
.ord-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.ord-badge--new { background: #e6f4ea; color: #1f8a4c; }
.ord-badge--cancel { background: #fdecec; color: #c0392b; }
.ord-date { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.ord-items { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.ord-item { font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.ord-item span { color: var(--muted); white-space: nowrap; }
.ord-meta { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.ord-total { font-size: 15px; margin-bottom: 10px; }
.ord-total strong { color: var(--brand); }
.ord-actions { display: flex; gap: 8px; }
.ord-btn { flex: 1; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.ord-btn--edit:hover { border-color: var(--accent); color: var(--accent); }
.ord-btn--cancel { color: #c0392b; }
.ord-btn--cancel:hover { background: #fdecec; border-color: #c0392b; }

/* CHECKOUT MODAL */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal__box {
  position: relative;
  background: var(--surface);
  width: min(440px, 92%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: pop .2s ease;
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px; border-bottom: 1px solid var(--line);
}
.order-form { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.order-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.order-form input {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 400;
  outline: none;
}
.order-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(184,82,27,.15); }
.order-msg { text-align: center; font-size: 14px; font-weight: 600; margin: 0; }
.order-msg--ok { color: #1f8a4c; }
.order-msg--err { color: #c0392b; }

/* RESPONSIVE */
@media (max-width: 720px) {
  .header__inner { flex-wrap: wrap; }
  .search { order: 3; max-width: 100%; flex-basis: 100%; }
  .hero__text h1 { font-size: 28px; }
}
