/* ============================================
   BOZORCHA — UMUMIY USLUB
   Palette: to'q zumrad fon, sintob oltin aksent,
   issiq oq kartochkalar — mahalliy bozor ruhi
   ============================================ */

:root {
  --emerald-deep: #0f3d2e;
  --emerald-mid: #1a5440;
  --gold: #d4a72c;
  --gold-bright: #f0c14b;
  --cream: #faf6ed;
  --ink: #1c2620;
  --ink-soft: #5a6b61;
  --line: #e3dcc9;
  --white: #ffffff;
  --danger: #c1432e;

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Inter", -apple-system, sans-serif;

  --radius: 14px;
  --shadow-card: 0 2px 8px rgba(15, 61, 46, 0.08), 0 1px 2px rgba(15, 61, 46, 0.06);
  --shadow-lift: 0 12px 28px rgba(15, 61, 46, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--emerald-deep);
  color: var(--cream);
  padding: 18px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold-bright);
  display: inline-block;
}

.header-link {
  font-size: 0.85rem;
  color: var(--cream);
  opacity: 0.75;
  border: 1px solid rgba(250, 246, 237, 0.3);
  padding: 7px 14px;
  border-radius: 999px;
  transition: opacity 0.2s, background 0.2s;
}

.header-link:hover {
  opacity: 1;
  background: rgba(250, 246, 237, 0.08);
}

/* ---------- Hero ---------- */

.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 20px 32px;
  text-align: center;
}

.hero-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 10px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  margin: 0 0 12px;
  color: var(--emerald-deep);
  font-weight: 600;
}

.hero p {
  color: var(--ink-soft);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

/* ---------- Product grid ---------- */

.catalog {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.product-image-wrap {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--line);
}

.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.product-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.product-desc {
  font-size: 0.85rem;
  color: var(--ink-soft);
  flex: 1;
}

.product-price {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--emerald-mid);
  margin-top: 4px;
}

.product-price::after {
  content: " so'm";
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--ink-soft);
}

.btn-order {
  margin-top: 10px;
  background: var(--gold);
  color: var(--emerald-deep);
  border: none;
  padding: 11px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.2s;
}

.btn-order:hover {
  background: var(--gold-bright);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 38, 30, 0.55);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 0;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 22px 28px;
  animation: slideUp 0.25s ease-out;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
  }
  .modal {
    border-radius: 20px;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--emerald-deep);
  margin: 0 0 4px;
}

.modal-product-name {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--cream);
  color: var(--ink);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--emerald-mid);
}

.payment-box {
  background: var(--emerald-deep);
  color: var(--cream);
  border-radius: 12px;
  padding: 16px;
  margin: 18px 0;
}

.payment-box-label {
  font-size: 0.78rem;
  opacity: 0.7;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.payment-card-number {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--gold-bright);
}

.payment-card-owner {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 4px;
}

.btn-submit {
  width: 100%;
  background: var(--gold);
  color: var(--emerald-deep);
  border: none;
  padding: 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 6px;
}

.btn-submit:hover {
  background: var(--gold-bright);
}

.btn-cancel {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  padding: 10px;
  font-size: 0.88rem;
  margin-top: 4px;
}

.success-box {
  text-align: center;
  padding: 20px 0;
}

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--emerald-mid);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px;
}

.success-box h3 {
  font-family: var(--font-display);
  color: var(--emerald-deep);
  margin: 0 0 8px;
}

.success-box p {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 24px 20px 40px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

/* ---------- Admin shared ---------- */

.admin-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.admin-login {
  max-width: 360px;
  margin: 80px auto;
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.admin-login h2 {
  font-family: var(--font-display);
  color: var(--emerald-deep);
}

.admin-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.admin-section h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--emerald-deep);
  margin-top: 0;
  margin-bottom: 16px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.admin-tab {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--white);
  border: 1.5px solid var(--line);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.admin-tab.active {
  background: var(--emerald-deep);
  color: var(--cream);
  border-color: var(--emerald-deep);
}

.admin-product-row {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.admin-product-row:last-child {
  border-bottom: none;
}

.admin-product-row img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.admin-product-info {
  flex: 1;
  min-width: 0;
}

.admin-product-info strong {
  display: block;
  font-size: 0.92rem;
}

.admin-product-info span {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.icon-btn {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}

.icon-btn.danger {
  color: var(--danger);
}

.order-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.order-status {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--emerald-deep);
  text-transform: uppercase;
}

.order-status.bajarildi {
  background: var(--emerald-mid);
  color: var(--cream);
}

.order-detail-line {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 2px 0;
}

.order-detail-line strong {
  color: var(--ink);
}

.empty-admin {
  text-align: center;
  padding: 30px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.field-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 10px;
  display: none;
}
