:root {
  --ink: #251f21;
  --ink2: #585254;
  --ink4: #c0bebf;
  --sand: #f4efec;
  --page: #ffffff;
  --hairline: #eae9ea;
  --teal: #73a89a;
  --teal-dark: #4f8272;
  --red: #ed313e;
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Tajawal', system-ui, sans-serif;
  background: var(--sand);
  color: var(--ink);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }

.ws-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--page);
  border-bottom: 1px solid var(--hairline);
}
.ws-header-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.ws-brand { display: flex; flex-direction: column; line-height: 1.2; text-decoration: none; color: var(--ink); }
.ws-brand-name { font-size: 22px; font-weight: 800; letter-spacing: .2px; }
.ws-brand-tag { font-size: 12px; color: var(--ink2); }
.ws-cart-btn {
  position: relative;
  border: 1px solid var(--hairline); background: var(--page);
  border-radius: 999px; padding: 8px 16px; font-size: 15px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.ws-cart-count {
  background: var(--teal-dark); color: #fff; border-radius: 999px;
  min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; padding: 0 6px;
}

.ws-hero {
  max-width: 1080px; margin: 20px auto 0; padding: 0 20px;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center;
  background: var(--page); border: 1px solid var(--hairline); border-radius: 24px; overflow: hidden;
}
.ws-hero-text { padding: 28px 28px 28px 0; }
.ws-hero-text h1 { font-size: 30px; font-weight: 800; line-height: 1.35; margin-bottom: 10px; }
.ws-hero-text p { color: var(--ink2); font-size: 16px; margin-bottom: 18px; }
.ws-hero img { width: 100%; height: 100%; object-fit: cover; }
.ws-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--teal-dark); color: #fff; border: none; border-radius: 12px;
  padding: 12px 22px; font-size: 16px; font-weight: 700; text-decoration: none;
}
.ws-btn:hover { background: var(--teal); }
.ws-btn.secondary { background: var(--page); color: var(--ink); border: 1px solid var(--hairline); }
.ws-btn.small { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.ws-btn.danger { background: var(--red); }
.ws-btn:disabled { opacity: .5; cursor: default; }

.ws-main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }

.ws-controls { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.ws-search {
  width: 100%; padding: 12px 16px; border: 1px solid var(--hairline); border-radius: 12px;
  background: var(--page); color: var(--ink);
}
.ws-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.ws-chip {
  border: 1px solid var(--hairline); background: var(--page); color: var(--ink2);
  border-radius: 999px; padding: 8px 18px; font-size: 14px; font-weight: 700;
}
.ws-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.ws-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
@media (min-width: 700px) { .ws-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.ws-card {
  background: var(--page); border: 1px solid var(--hairline); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.ws-card-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--sand); }
.ws-card-img-empty {
  width: 100%; aspect-ratio: 1; background: var(--sand);
  display: flex; align-items: center; justify-content: center; font-size: 44px; color: var(--ink4);
}
.ws-card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ws-card-name { font-weight: 800; font-size: 16px; line-height: 1.4; }
.ws-card-cat { font-size: 12px; color: var(--ink2); }
.ws-card-desc { font-size: 13px; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ws-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; }
.ws-price { font-weight: 800; color: var(--teal-dark); font-size: 17px; white-space: nowrap; }

.ws-empty {
  text-align: center; padding: 60px 20px; color: var(--ink2);
  background: var(--page); border: 1px dashed var(--hairline); border-radius: var(--radius);
}

.ws-footer {
  border-top: 1px solid var(--hairline); background: var(--page);
  padding: 24px 20px; text-align: center; color: var(--ink2); font-size: 13px;
}

dialog.ws-dialog {
  border: none; border-radius: 24px; padding: 0; width: min(520px, calc(100vw - 32px));
  background: var(--page); color: var(--ink); direction: rtl;
  max-height: calc(100vh - 60px);
}
dialog.ws-dialog::backdrop { background: rgba(37, 31, 33, .45); }
.ws-dialog-inner { padding: 24px; overflow-y: auto; max-height: calc(100vh - 60px); }
.ws-dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ws-dialog-title { font-size: 20px; font-weight: 800; }
.ws-close { background: none; border: none; font-size: 22px; color: var(--ink2); line-height: 1; padding: 6px; }

.ws-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.ws-line-info { flex: 1; min-width: 0; }
.ws-line-name { font-weight: 700; font-size: 14px; }
.ws-line-price { font-size: 13px; color: var(--ink2); }
.ws-qty { display: flex; align-items: center; gap: 6px; }
.ws-qty button {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--hairline);
  background: var(--page); font-size: 16px; font-weight: 700;
}
.ws-remove { background: none; border: none; color: var(--red); font-size: 13px; }
.ws-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 17px; padding: 14px 0; }

.ws-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.ws-field label { font-size: 13px; font-weight: 700; color: var(--ink2); }
.ws-field input, .ws-field textarea, .ws-field select {
  padding: 11px 14px; border: 1px solid var(--hairline); border-radius: 10px;
  background: var(--page); color: var(--ink); width: 100%;
}
.ws-field input:focus, .ws-field textarea:focus, .ws-field select:focus { outline: 2px solid var(--teal); border-color: var(--teal); }

.ws-note { font-size: 13px; color: var(--ink2); background: var(--sand); border-radius: 12px; padding: 12px 14px; }
.ws-error { color: var(--red); font-size: 13px; font-weight: 700; min-height: 18px; }
.ws-success { text-align: center; padding: 30px 10px; }
.ws-success .big { font-size: 46px; }
.ws-success h3 { font-size: 20px; margin: 10px 0 6px; }

/* Admin */
.ws-admin-wrap { max-width: 980px; margin: 0 auto; padding: 24px 20px 60px; }
.ws-login-card {
  max-width: 400px; margin: 60px auto; background: var(--page);
  border: 1px solid var(--hairline); border-radius: 24px; padding: 28px;
}
.ws-login-card h1 { font-size: 22px; margin-bottom: 4px; }
.ws-login-card p { color: var(--ink2); font-size: 14px; margin-bottom: 18px; }
.ws-tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.ws-table { width: 100%; border-collapse: collapse; background: var(--page); border-radius: var(--radius); overflow: hidden; }
.ws-table th, .ws-table td { padding: 10px 12px; text-align: right; font-size: 14px; border-bottom: 1px solid var(--hairline); }
.ws-table th { background: var(--sand); font-size: 13px; color: var(--ink2); }
.ws-table img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.ws-order {
  background: var(--page); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
}
.ws-order-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ws-order-items { font-size: 14px; color: var(--ink2); margin: 8px 0; white-space: pre-line; }
.ws-status { padding: 6px 10px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--page); }
.ws-badge { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 10px; }
.ws-badge.new { background: #e8f2ef; color: var(--teal-dark); }
.ws-badge.confirmed { background: #e8eefb; color: #3355aa; }
.ws-badge.shipped { background: #eef3e4; color: #557a1e; }
.ws-badge.cancelled { background: #fbe8ea; color: var(--red); }

@media (max-width: 700px) {
  .ws-hero { grid-template-columns: 1fr; }
  .ws-hero-text { padding: 20px; }
  .ws-hero img { max-height: 220px; }
}
