/* صفحة المسموحات /allowed — بطاقات + فلاتر (فاتح/داكن) */

.allowed-page .page-hero--allowed {
  background: linear-gradient(135deg, rgba(27, 67, 50, 0.08) 0%, rgba(212, 163, 115, 0.12) 100%);
}

.allowed-hero__lead {
  max-width: 640px;
  line-height: 1.75;
}

.allowed-section {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

.allowed-toolbar {
  margin-bottom: 1.25rem;
}

.allowed-stat {
  font-size: 1.15rem;
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.allowed-stat__ico {
  font-size: 1.35rem;
}

.allowed-stat__filtered {
  font-size: 0.88rem;
  color: var(--clr-text-light, #64748b);
  font-weight: 400;
}

.allowed-reminder {
  margin-bottom: 1rem;
}

.allowed-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  padding: 0 14px;
  border: 1px solid rgba(27, 67, 50, 0.15);
  border-radius: 14px;
  background: var(--clr-surface, #fff);
  box-shadow: 0 2px 12px rgba(27, 67, 50, 0.05);
}

.allowed-search__ico {
  font-size: 1.1rem;
  opacity: 0.7;
}

.allowed-search {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 0;
  font-size: 1rem;
  color: var(--clr-text, #1e293b);
  outline: none;
}

.allowed-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.allowed-filter {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(27, 67, 50, 0.15);
  background: var(--clr-surface, #fff);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  color: var(--clr-text-md, #475569);
}

.allowed-filter:hover {
  border-color: var(--wp-green, #1b4332);
}

.allowed-filter.is-active {
  background: var(--wp-green, #1b4332);
  border-color: var(--wp-green, #1b4332);
  color: #fff;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}

@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
  }
}

.product-img-wrap {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: rgba(27, 67, 50, 0.04);
}

.product-img-wrap .product-img,
.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card__detail {
  margin-top: auto;
  align-self: flex-start;
  padding: 8px 12px;
  font-size: 0.82rem;
  text-decoration: none;
  border-radius: 999px;
}

.product-card__detail:hover,
.product-card__detail:focus-visible {
  transform: none;
}

.product-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
  padding: 12px 14px 14px;
}

.product-card--forbidden .product-card__detail {
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, 0.25);
}

html[data-theme="dark"] .product-card--forbidden .product-card__detail {
  color: #fca5a5;
}

.product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(27, 67, 50, 0.1);
  border-radius: 14px;
  overflow: hidden;
  background: var(--clr-surface, #fff);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(27, 67, 50, 0.06);
}

.product-card:hover,
.product-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(27, 67, 50, 0.12);
  outline: none;
}

.product-card.is-hidden {
  display: none !important;
}

.product-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--clr-bg-alt, #f1f5f9);
}

.product-img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  aspect-ratio: 4 / 3;
}

.product-name {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--wp-green, #1b4332);
  font-weight: 700;
}

.product-category {
  font-size: 0.72rem;
  color: var(--clr-text-light, #64748b);
  line-height: 1.3;
}

.freq-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.3;
}

.freq-essentials {
  background: rgba(45, 106, 79, 0.12);
  color: #1b4332;
}

.freq-daily {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}

.freq-weekly {
  background: rgba(234, 179, 8, 0.15);
  color: #854d0e;
}

.freq-sometimes {
  background: rgba(168, 85, 247, 0.12);
  color: #6b21a8;
}

.product-desc {
  margin: 0;
  font-size: 0.76rem;
  color: var(--clr-text-md, #475569);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.allowed-empty {
  text-align: center;
  padding: 2rem;
  color: var(--clr-text-light, #64748b);
}

.allowed-footer-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 2rem;
}

/* Modal */
.allowed-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.allowed-modal[hidden] {
  display: none !important;
}

.allowed-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 26, 20, 0.55);
  backdrop-filter: blur(4px);
}

.allowed-modal__card {
  position: relative;
  background: var(--clr-surface, #fff);
  border-radius: 18px;
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(27, 67, 50, 0.12);
}

.allowed-modal__close {
  position: absolute;
  top: 12px;
  left: 12px;
  border: none;
  background: var(--clr-bg-alt, #f1f5f9);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
}

.allowed-modal__img {
  width: 100%;
  border-radius: 12px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-bottom: 12px;
}

.allowed-modal__title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--wp-green, #1b4332);
}

.allowed-modal__meta {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--clr-text-light, #64748b);
}

.allowed-modal__desc {
  line-height: 1.65;
  margin: 0 0 16px;
  font-size: 0.92rem;
}

.allowed-modal__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.allowed-modal-open {
  overflow: hidden;
}

/* داكن */
html[data-theme="dark"] .allowed-page .page-hero--allowed {
  background: linear-gradient(135deg, rgba(82, 183, 136, 0.1) 0%, rgba(4, 12, 9, 0.5) 100%);
}

html[data-theme="dark"] .allowed-search-wrap {
  background: var(--clr-surface, #152820);
  border-color: rgba(82, 183, 136, 0.2);
}

html[data-theme="dark"] .allowed-search {
  color: #e2e8f0;
}

html[data-theme="dark"] .allowed-filter {
  background: var(--clr-surface, #152820);
  border-color: rgba(82, 183, 136, 0.2);
  color: #cbd5e1;
}

html[data-theme="dark"] .allowed-filter.is-active {
  background: #2d6a4f;
  border-color: #52b788;
  color: #f0fdf4;
}

html[data-theme="dark"] .product-card {
  background: var(--clr-surface, #152820);
  border-color: rgba(82, 183, 136, 0.15);
}

html[data-theme="dark"] .product-name {
  color: #95d5b2;
}

html[data-theme="dark"] .product-desc {
  color: #cbd5e1;
}

html[data-theme="dark"] .freq-essentials {
  background: rgba(45, 106, 79, 0.25);
  color: #d8f3dc;
}

html[data-theme="dark"] .freq-daily {
  background: rgba(34, 197, 94, 0.2);
  color: #bbf7d0;
}

html[data-theme="dark"] .freq-weekly {
  background: rgba(234, 179, 8, 0.18);
  color: #fef08a;
}

html[data-theme="dark"] .freq-sometimes {
  background: rgba(168, 85, 247, 0.2);
  color: #e9d5ff;
}

html[data-theme="dark"] .allowed-modal__card {
  background: var(--clr-surface-elevated, #1a2e26);
  border-color: rgba(82, 183, 136, 0.22);
  color: #e2e8f0;
}

html[data-theme="dark"] .allowed-modal__title {
  color: #95d5b2;
}

html[data-theme="dark"] .allowed-modal__close {
  background: var(--clr-surface, #152820);
  color: #e2e8f0;
}

/* ── ممنوعات + أسماء مشتركة ── */
.product-cards-page--forbidden .page-hero--forbidden {
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.08) 0%, rgba(127, 29, 29, 0.06) 100%);
}

.product-cards-hero__lead,
.allowed-hero__lead {
  max-width: 640px;
  line-height: 1.75;
}

.product-cards-section,
.allowed-section {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

.product-cards-toolbar,
.allowed-toolbar { margin-bottom: 1.25rem; }

.product-cards-stat,
.allowed-stat {
  font-size: 1.15rem;
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.product-cards-search-wrap,
.allowed-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  padding: 0 14px;
  border: 1px solid rgba(27, 67, 50, 0.15);
  border-radius: 14px;
  background: var(--clr-surface, #fff);
  box-shadow: 0 2px 12px rgba(27, 67, 50, 0.05);
}

.product-cards-page--forbidden .product-cards-search-wrap {
  border-color: rgba(185, 28, 28, 0.18);
}

.product-cards-search,
.allowed-search {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 0;
  font-size: 1rem;
  color: var(--clr-text, #1e293b);
  outline: none;
}

.product-cards-filters,
.allowed-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-cards-filter,
.allowed-filter {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(27, 67, 50, 0.15);
  background: var(--clr-surface, #fff);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--clr-text-md, #475569);
}

.product-cards-page--forbidden .product-cards-filter.is-active {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.product-card--forbidden .product-name {
  color: #b91c1c;
}

.freq-forbidden {
  background: rgba(239, 68, 68, 0.12);
  color: #991b1b;
}

html[data-theme="dark"] .freq-forbidden {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

html[data-theme="dark"] .product-cards-page--forbidden .page-hero--forbidden {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(4, 12, 9, 0.4) 100%);
}

html[data-theme="dark"] .product-card--forbidden .product-name {
  color: #fca5a5;
}

.product-cards-modal,
.allowed-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.product-cards-modal[hidden],
.allowed-modal[hidden] { display: none !important; }

body.product-cards-modal-open,
body.allowed-modal-open { overflow: hidden; }
