:root {
  --primary: #6f4e37;
  --secondary: #f5e6d3;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(0,0,0,0.08);
}
* { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0; font-family: "Tajawal","Segoe UI",sans-serif; color:#1a1a1a;
  background: linear-gradient(0deg, color-mix(in srgb, var(--secondary) 55%, transparent) 0%, rgba(255,255,255,0) 45%), #fafafa;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
[dir="ltr"] body { font-family: "Segoe UI", "Tajawal", sans-serif; }

.status-page { min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:20px; }
.status-page h1 { color: var(--primary); }

.project-header { position:relative; }
.cover-image { width:100%; aspect-ratio:16/9; object-fit:cover; background:var(--secondary); display:block; }
.cover-wave { position:relative; margin-bottom:-1px; }
.cover-wave svg { display:block; width:100%; height:28px; }
.logo-wrap { display:flex; justify-content:center; margin-top:-40px; }
.logo-wrap.no-cover { margin-top:16px; }
.logo { width:100px; height:100px; border-radius:50%; border:4px solid #fff; object-fit:cover; background:#fff; box-shadow:var(--shadow); }
.project-name { text-align:center; font-size:1.4rem; font-weight:700; margin:10px 0 2px; color:var(--primary); }
.project-desc { text-align:center; color:#666; font-size:0.9rem; padding:0 20px; margin-bottom:10px; white-space:pre-line; }
.lang-toggle {
  position:absolute; top:10px; inset-inline-start:10px; z-index:3;
  background:#fff; color:#333; border:1px solid rgba(0,0,0,0.12);
  border-radius:20px; padding:7px 14px; font-size:0.75rem; font-weight:600; cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,0.15);
  display:flex; align-items:center; gap:6px;
}

.categories-bar {
  display:flex; gap:8px; overflow-x:auto; padding:14px 16px; -webkit-overflow-scrolling:touch;
  position:sticky; top:env(safe-area-inset-top, 0px); z-index:5;
  background:rgba(250,250,250,0.75); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
  border-bottom:0.5px solid rgba(0,0,0,0.06);
}
.category-pill {
  flex:0 0 auto; padding:8px 16px; border-radius:20px; background:#fff; border:1px solid #e0e0e0;
  font-size:0.85rem; cursor:pointer; white-space:nowrap; transition:background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.category-pill.active { background:var(--primary); color:#fff; border-color:var(--primary); }

.view-toggle-bar { display:flex; justify-content:flex-end; padding:0 16px 8px; gap:6px; }
.view-btn { width:34px; height:34px; border-radius:8px; border:1px solid #e0e0e0; background:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.view-btn.active { background:var(--primary); border-color:var(--primary); }
.view-btn.active svg { stroke:#fff; }

.products-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; padding:0 16px 24px; }
@media (min-width:380px){ .products-grid{ grid-template-columns:repeat(3,1fr);} }
@media (min-width:768px){ .products-grid{ grid-template-columns:repeat(4,1fr); max-width:1100px; margin:0 auto; } }

.product-card { background:#fff; border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); cursor:pointer; position:relative; transition:transform 0.25s ease, box-shadow 0.25s ease; }
.product-card:active, .product-card:hover { transform:translateY(-4px); box-shadow:0 10px 24px rgba(0,0,0,0.12); }
.product-card .img-wrap img { transition:transform 0.3s ease; }
.product-card:active .img-wrap img, .product-card:hover .img-wrap img { transform:scale(1.08); }
.product-card.unavailable { filter:grayscale(0.85); opacity:0.7; }
.img-wrap { width:100%; aspect-ratio:3/4; overflow:hidden; background:var(--secondary); }
.product-card img, .list-card img { width:100%; height:100%; object-fit:cover; }
.badges-stack { position:absolute; top:8px; inset-inline-start:8px; z-index:2; display:flex; flex-direction:column; gap:4px; }
.badge { position:static; background:#d64545; color:#fff; font-size:0.7rem; padding:3px 8px; border-radius:10px; }
.badge.unavailable-badge { background:#555; }
.product-info { padding:8px 10px 10px; }
.product-name { font-size:0.9rem; font-weight:600; margin:0 0 4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.price-row { unicode-bidi:isolate; direction:ltr; display:flex; align-items:baseline; gap:6px; justify-content:flex-end; color:var(--primary); font-weight:700; }
[dir="ltr"] .price-row { justify-content:flex-start; }
.price-old { text-decoration:line-through; color:#999; font-size:0.75rem; font-weight:400; }

.products-list { display:flex; flex-direction:column; gap:10px; padding:0 16px 24px; }
.list-card { display:flex; align-items:center; gap:12px; background:#fff; border-radius:var(--radius); box-shadow:var(--shadow); padding:8px; cursor:pointer; position:relative; }
.list-card.unavailable { filter:grayscale(0.85); opacity:0.7; }
.list-card .img-wrap { width:70px; height:93px; flex:0 0 auto; border-radius:10px; aspect-ratio:unset; position:relative; }
.list-card .info { flex:1; min-width:0; }

.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.5); display:flex; align-items:center; justify-content:center; padding:16px; z-index:50; }
.modal-box {
  background:#fff; width:100%; max-width:420px; height:75vh; max-height:75vh;
  border-radius:20px; overflow:hidden;
  display:flex; flex-direction:column;
}
.modal-box .img-wrap { position:relative; width:100%; flex:1; overflow:hidden; background:var(--secondary); min-height:0; }
.modal-box .img-wrap img { width:100%; height:100%; object-fit:contain; display:block; }
.badges-row { position:absolute; top:10px; inset-inline-start:10px; display:flex; gap:4px; z-index:2; }
.modal-body { flex:0 0 auto; display:flex; flex-direction:column; padding:8px 16px 16px; }
.modal-name { flex:0 0 auto; font-size:1.05rem; font-weight:700; margin:0 0 6px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.modal-desc {
  flex:0 0 auto; color:#555; font-size:0.85rem; line-height:1.4; white-space:pre-line;
  overflow:hidden; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; margin:0 0 8px;
}
.price-row.modal-price { flex:0 0 auto; margin-bottom:10px; }
.order-btn { flex:0 0 auto; min-height:44px; width:100%; border:none; border-radius:12px; background:var(--primary); color:#fff; font-size:1rem; font-weight:700; cursor:pointer; display:flex; align-items:center; justify-content:center; text-decoration:none; }
.order-btn.disabled { background:#bbb; pointer-events:none; }
.icon-btn { position:absolute; top:12px; background:rgba(255,255,255,0.9); border:none; border-radius:50%; width:36px; height:36px; display:flex; align-items:center; justify-content:center; cursor:pointer; box-shadow:var(--shadow); }
.badge-inline { font-size:0.7rem; padding:3px 9px; border-radius:9px; color:#fff; background:#d64545; }
.badge-inline.unavailable-badge { background:#555; }

.social-footer { display:flex; justify-content:center; gap:14px; padding:22px 16px 30px; flex-wrap:wrap; }
.social-footer a {
  color: var(--primary); background:var(--secondary); text-decoration:none;
  width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center;
}
