/* الشبكة والحاويات والتجاوب */

.container {
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 768px) {
  .container {
    max-width: 720px;
    padding-inline: 24px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 960px;
  }
}

/* مساحة للهيدر والشريط السفلي */
.page {
  padding-top: var(--header-h);
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 16px);
  min-height: 100dvh;
}

/* شبكة البطاقات */
.grid-products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .grid-products {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .grid-products {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* أقسام الصفحة */
.section {
  padding-block: 24px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* فليكس مساعد */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* مخفي */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===== الهيدر ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}

.header-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.header-icon {
  color: var(--color-primary);
}

.header-title {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== الشريط السفلي ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  z-index: 100;
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.7rem;
  color: var(--text-muted);
  min-height: 44px;
  transition: color var(--transition-fast);
}

.bottom-nav__item.is-active {
  color: var(--color-primary);
  font-weight: 500;
}

.bottom-nav__icon {
  width: 22px;
  height: 22px;
}

/* ===== الفوتر ===== */
.site-footer {
  padding: 24px 0 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
