/* ============================================
   نظام التصميم الموحّد - اليوسف شوب (الواجهة العامة)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=El+Messiri:wght@500;600;700&family=Tajawal:wght@400;500;700;900&display=swap');

:root {
  /* الألوان */
  --bg-page: #FAF6F0;
  --bg-card: #FFFFFF;
  --ink: #2E2A24;
  --ink-soft: #6B655A;
  --accent: #C68A3E;
  --accent-dark: #A96F2B;
  --sage: #6E7F63;
  --line: #E6DFD2;
  --danger: #C1553D;

  /* الخطوط */
  --font-display: 'El Messiri', serif;
  --font-body: 'Tajawal', sans-serif;

  /* المسافات */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --shadow-card: 0 2px 12px rgba(46, 42, 36, 0.06);
  --shadow-card-hover: 0 8px 24px rgba(46, 42, 36, 0.10);
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
}
body.theme-body {
  background: var(--bg-page);
  color: var(--ink);
  font-family: var(--font-body);
  margin: 0;
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
}

.theme-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ===== الهيدر ===== */
.theme-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.theme-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.theme-logo img {
  height: 40px;
  display: block;
}
.theme-nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.theme-nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
  font-size: 0.92rem;
  white-space: nowrap;
}
.theme-nav-links a:hover,
.theme-nav-links a.active {
  background: var(--accent);
  color: #fff;
}
.theme-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.theme-icon-btn {
  position: relative;
  color: var(--ink);
  font-size: 1.3rem;
  text-decoration: none;
  display: flex;
  align-items: center;
}
.theme-cart-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-logout {
  color: var(--danger);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.theme-logout-link {
  display: none;
}

/* ===== أزرار ===== */
.btn-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-theme-primary {
  background: var(--accent);
  color: #fff;
}
.btn-theme-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}
.btn-theme-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-theme-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== بطاقات المنتجات ===== */
.theme-product-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  height: 100%;
}
.theme-product-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}
.theme-product-card .img-wrap {
  aspect-ratio: 1 / 1;
  background: #F2EDE3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.theme-product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.theme-product-card .body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.theme-product-card .name {
  font-weight: 700;
  font-size: 0.98rem;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.theme-product-card .price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent-dark);
  margin-top: auto;
}
.theme-badge {
  display: inline-block;
  background: rgba(110, 127, 99, 0.12);
  color: var(--sage);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  width: fit-content;
}

/* ===== فئات دائرية ===== */
.theme-category-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  text-align: center;
}
.theme-category-pill .circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--accent);
  transition: all 0.2s ease;
}
.theme-category-pill:hover .circle {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(1.05);
}
.theme-category-pill span {
  font-size: 0.85rem;
  font-weight: 500;
}

/* ===== فوتر ===== */
.theme-footer {
  background: var(--ink);
  color: #E6DFD2;
  padding: 2.5rem 0 1.25rem;
  margin-top: 4rem;
}
.theme-footer a {
  color: #E6DFD2;
  text-decoration: none;
}
.theme-footer .bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: #A69C8A;
}

/* ===== عام ===== */
.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 1.5rem;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .theme-nav-links { display: none; }
  .theme-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1.3rem;
    color: var(--ink);
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    order: -1;
  }
  .theme-nav-links {
    position: absolute;
    top: 100%;
    right: 1.25rem;
    left: 1.25rem;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-card-hover);
    padding: 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    z-index: 60;
  }
  .theme-nav-links.active {
    display: flex;
  }
  .theme-nav-links a {
    width: 100%;
  }
  .theme-nav {
    position: relative;
  }
  .theme-nav-actions {
    order: 2;
  }
  .theme-nav-actions .theme-logout {
    display: none;
  }
  .theme-logout-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--danger);
  }
  .theme-grid { grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
  .section-title { font-size: 1.3rem; }
  .theme-nav {
    padding: 0.7rem 0.9rem;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }
  .theme-logo img { height: 32px; }
  .theme-nav-actions { gap: 0.5rem; }
  .theme-logout span,
  .theme-logout {
    font-size: 0.8rem;
  }
}
