:root {
  --ink: #1f2b24;
  --muted: #66736b;
  --line: #e4dfd6;
  --paper: #fffdf8;
  --soft: #f4efe6;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --gold: #b38b59;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, "Tahoma", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(255,253,248,.96);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 24px; color: var(--accent-dark); }
.topbar nav { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; color: var(--muted); }
.topbar nav a:hover { color: var(--ink); }

.hero {
  min-height: 430px;
  display: grid;
  align-items: center;
  padding: 54px clamp(18px, 4vw, 56px);
  background:
    linear-gradient(110deg, rgba(15,118,110,.92), rgba(31,43,36,.72)),
    url("placeholder.svg") center/cover;
  color: white;
}
.hero__content { max-width: 880px; }
.eyebrow { color: #f7d58c; font-weight: 700; }
h1 { font-size: clamp(34px, 5vw, 68px); line-height: 1.05; margin: 12px 0; }
h2 { font-size: 28px; margin: 0; }
.hero p { font-size: 20px; max-width: 620px; }
.searchbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 240px) auto;
  gap: 10px;
  margin-top: 28px;
  max-width: 860px;
}
.searchbar input, .searchbar select, .panel-form input, .panel-form textarea, .panel-form select, .admin-form input, .admin-form textarea, .admin-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: white; }

.section { padding: 44px clamp(18px, 4vw, 56px); }
.section__head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 22px;
}
.section__head a, .section__head span { color: var(--muted); }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.product-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.product-card__image {
  aspect-ratio: 4 / 3;
  background: var(--soft);
  overflow: hidden;
}
.product-card__image img { width: 100%; height: 100%; object-fit: cover; }
.product-card__body { padding: 16px; }
.product-card__body span { color: var(--muted); font-size: 14px; }
.product-card__body h3 { margin: 6px 0 8px; min-height: 52px; }
.product-card__body p, .price { font-size: 20px; font-weight: 800; color: var(--accent-dark); }
.product-card__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.product-card__actions form { display: contents; }

.product-view, .checkout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 520px);
  gap: 34px;
  padding: 44px clamp(18px, 4vw, 56px);
}
.product-view__image {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 8px;
  overflow: hidden;
}
.product-view__image img { width: 100%; height: 100%; object-fit: cover; }
.product-view__info { align-self: center; }
.backlink { color: var(--muted); }
.qty { max-width: 120px; margin: 8px 12px 16px 0; }
.stock { color: var(--muted); }

.cart-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.cart-row {
  display: grid;
  grid-template-columns: 76px 1fr 90px 120px 80px;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.cart-row:last-child { border-bottom: 0; }
.cart-row img { width: 76px; height: 62px; object-fit: cover; border-radius: 6px; background: var(--soft); }
.cart-row span { display: block; color: var(--muted); }
.cart-row input { width: 86px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
.cart-total, .actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}
.cart-total strong { font-size: 24px; }

.checkout { grid-template-columns: minmax(300px, 640px) minmax(260px, 400px); align-items: start; }
.panel-form, .summary {
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.panel-form label { display: grid; gap: 6px; font-weight: 700; }
textarea { min-height: 96px; resize: vertical; }
.summary div, .summary footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.summary footer { border-bottom: 0; font-size: 20px; }
.success-page { max-width: 760px; }
.empty { color: var(--muted); background: var(--soft); padding: 18px; border-radius: 8px; }
.flash { padding: 12px 14px; border-radius: 8px; margin: 12px 0; background: #e9f7ef; border: 1px solid #bbe3c7; }
.flash-error { background: #fff0ed; border-color: #ffcdc5; color: var(--danger); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 26px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.rtl { font-family: "Tahoma", Arial, sans-serif; }
.rtl .qty { margin: 8px 0 16px 12px; }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .searchbar, .product-view, .checkout { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 60px 1fr; }
  .cart-row input, .cart-row strong, .cart-row a { margin-inline-start: 74px; }
  .product-card__actions { grid-template-columns: 1fr; }
}

