/* واجهة المتجر: الصفحة الرئيسية بأقسامها المرتبة، على طريقة المتاجر الإلكترونية */

.store { background: #fff; }
/* العناصر المخفية تبقى مخفية مهما كان تنسيقها */
[hidden] { display: none !important; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 820px; }

.announce { background: var(--accent); color: #fff; text-align: center; font-size: 14px; padding: 8px 16px; }

/* الأقسام التي يُنزل إليها لا تختفي تحت الرأس الثابت */
section[id], .preview-panel { scroll-margin-top: 84px; }

/* الرأس */
.store-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.store-header .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 26px; font-weight: 800; color: var(--accent); text-decoration: none; }
.logo-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 22px; }
.store-nav { display: flex; gap: 22px; flex: 1; }
.store-nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.store-nav a:hover { color: var(--accent); }
.header-cta { background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; padding: 10px 18px; border-radius: 10px; white-space: nowrap; }

.mine { background: #f3faf8; border-bottom: 1px solid var(--line); }
.mine .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-block: 10px; }
.mine a { color: var(--accent); font-weight: 700; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 5px 12px; font-size: 14px; }

/* الواجهة الرئيسية */
.hero { background: linear-gradient(180deg, #f3faf8, #fff); padding: 48px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.pill { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 6px 14px; font-size: 14px; color: var(--accent); font-weight: 700; }
.hero h1 { font-size: 42px; line-height: 1.35; margin: 16px 0 12px; }
.hero-text p { font-size: 18px; line-height: 1.9; color: var(--muted); margin: 0 0 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-points { list-style: none; padding: 0; margin: 18px 0 0; display: flex; gap: 22px; flex-wrap: wrap; color: var(--ink); font-weight: 500; }
.hero-art { position: relative; aspect-ratio: 1.25; }
.hero-art img { position: absolute; width: 82%; border-radius: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, .18); background: #eee; }
.art-back { top: 0; left: 0; transform: rotate(-5deg); }
.art-front { bottom: 0; right: 0; transform: rotate(3deg); }

.btn { display: inline-block; text-decoration: none; font-weight: 700; background: var(--accent); color: #fff; padding: 12px 22px; border-radius: 10px; border: 1px solid var(--accent); }
.btn-lg { font-size: 17px; padding: 14px 26px; }
.btn-ghost { background: #fff; color: var(--accent); }

/* المزايا */
.features { border-block: 1px solid var(--line); background: #fff; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.feature { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 20px 10px; }
.feature + .feature { border-inline-start: 1px solid var(--line); }
.feature span { font-size: 26px; }
.feature small { color: var(--muted); }

/* الأقسام */
.section { padding: 48px 0; }
.section-alt { background: var(--bg); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.section-head.center { display: block; text-align: center; }
.section-head h2 { font-size: 30px; margin: 0; }
.section-head p { color: var(--muted); font-size: 17px; margin: 8px 0 0; }
.section-head a { color: var(--accent); font-weight: 700; text-decoration: none; }

/* بطاقات المنتجات */
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.product { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.product:hover { box-shadow: 0 12px 28px rgba(0, 0, 0, .1); transform: translateY(-2px); }
.product-img { display: block; aspect-ratio: 297 / 210; background: #f1efe9; overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-body h3 { font-size: 16px; line-height: 1.5; margin: 0; }
.product-body h3 a { color: var(--ink); text-decoration: none; }
.product-meta { color: var(--muted); font-size: 13px; }
.product-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.price { font-weight: 800; font-size: 18px; color: var(--accent); }
.price small { font-size: 13px; font-weight: 500; }
.product-foot button { padding: 8px 14px; font-size: 14px; }

/* صانع المطوية */
.creator { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 22px; align-items: start; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 4px 18px rgba(0, 0, 0, .04); }
.creator .preview-bar h3 { margin: 0; font-size: 20px; }
.creator #submit { width: 100%; }
.empty { display: grid; justify-items: center; gap: 6px; padding: 48px 12px; color: var(--muted); text-align: center; border: 2px dashed var(--line); border-radius: 12px; }
.empty span { font-size: 40px; }
.empty p { margin: 0; }

/* كيف تعمل */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { text-align: center; padding: 22px 16px; border: 1px solid var(--line); border-radius: 14px; }
.step b { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 20px; }
.step p { color: var(--muted); margin: 6px 0 0; line-height: 1.8; }

/* لماذا مطوياتي */
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.why-card { background: #fff; border-radius: 14px; padding: 22px; border: 1px solid var(--line); }
.why-card span { font-size: 28px; }
.why-card strong { display: block; font-size: 18px; margin: 8px 0 4px; }
.why-card p { color: var(--muted); margin: 0; line-height: 1.8; }

/* صندوق «لم يعجبك المحتوى؟» */
.revise { margin-top: 14px; padding: 16px; border-radius: 14px; background: #f3faf8; border: 1px solid var(--line); display: grid; gap: 10px; }
.revise strong { font-size: 17px; }
.revise p { margin: 0; color: var(--muted); }
.revise .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.revise .chips button { background: #fff; color: var(--accent); border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 500; }
.revise textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.revise-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.revise-left { color: var(--muted); }
.revise-status { min-height: 1.2em; font-size: 14px; }

/* جدول المقارنة */
.compare-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.compare { width: 100%; border-collapse: collapse; min-width: 640px; }
.compare th, .compare td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: center; }
.compare tbody th { text-align: start; font-weight: 500; }
.compare thead th { font-size: 15px; color: var(--muted); }
.compare tr:last-child > * { border-bottom: 0; }
.compare .us { background: #f3faf8; color: var(--accent); font-weight: 700; }
.compare thead .us { color: #fff; background: var(--accent); font-size: 17px; }
.compare td:not(.us) { color: var(--muted); }

/* الأسئلة */
#faq details { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; background: #fff; }
#faq summary { font-weight: 700; cursor: pointer; }
#faq details p { color: var(--muted); line-height: 1.9; margin: 10px 0 0; }

/* البحث والمواد في الصفحة الرئيسية */
.home-search { display: flex; gap: 8px; margin-bottom: 16px; }
.home-search input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 26px; }
.subject-tile { display: grid; gap: 2px; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; transition: border-color .2s, box-shadow .2s; }
.subject-tile:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(0, 0, 0, .07); }
.subject-tile span { font-size: 24px; }
.subject-tile small { color: var(--muted); }
.featured-title { font-size: 20px; margin: 0 0 12px; }

/* البحث والتصنيف في صفحة المطويات */
.catalog-tools { display: grid; gap: 12px; }
.catalog-tools input[type="search"] { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.chips-row > span:first-child { font-weight: 700; margin-inline-end: 4px; }
.chip { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px; font-size: 14px; font-weight: 500; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chips-row select { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; }
.count { margin-inline-start: auto; color: var(--muted); font-weight: 700; }
.empty-result { text-align: center; color: var(--muted); }
@media (max-width: 560px) {
  /* على الجوال: كل صف أزرار سطر واحد يُسحب أفقيًّا */
  .chips-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .chip { flex: none; }
}

/* الأسعار والباقات */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 900px; margin: 0 auto; }
.plan { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px 20px; display: grid; gap: 10px; text-align: center; }
.plan strong { font-size: 20px; }
.plan p { margin: 0; color: var(--muted); }
.plan.featured { border: 2px solid var(--accent); box-shadow: 0 12px 28px rgba(0, 0, 0, .08); }
.plan-tag { position: absolute; top: -13px; inset-inline: 0; margin: 0 auto; width: max-content; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 20px; }
#pack-status { text-align: center; }
.use-wallet { width: 100%; margin-bottom: 12px; background: #f59e0b; color: #1f2933; font-size: 16px; }
.wallet-page { padding-block: 28px; display: grid; gap: 18px; }
.wallet-page h1 { margin: 12px 0 6px; font-size: 30px; }
.wallet-page p { line-height: 1.9; color: var(--muted); }
@media (max-width: 760px) { .plans { grid-template-columns: minmax(0, 1fr); } }

/* صفحة المنتج */
.product-page { padding-block: 22px 40px; display: grid; gap: 22px; }
.product-page h1 { font-size: 26px; line-height: 1.5; margin: 6px 0; }
.product-page .section-head p { color: var(--muted); margin: 6px 0 0; }
.crumbs { color: var(--muted); font-size: 14px; }
.crumbs a { color: var(--muted); }
.product-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.product-info { position: sticky; top: 84px; display: grid; gap: 12px; }
.product-info p { line-height: 1.9; margin: 0; }
.product-info h2 { font-size: 18px; margin: 6px 0 0; }
.price.big { font-size: 28px; }
.btn.block { display: block; text-align: center; }
.seo-facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.seo-outline { line-height: 2; margin: 0; }
.more { text-align: center; }
.more h2 { margin-top: 0; }

/* المزايا الأربع الكبرى */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.pillar { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 14px; padding: 22px; }
.pillar span { font-size: 30px; }
.pillar strong { display: block; font-size: 19px; margin: 8px 0 6px; }
.pillar p { color: var(--muted); margin: 0; line-height: 1.85; }
.pillar .price { font-size: 26px; }

.store-footer { background: #1f2933; color: #cbd2d9; padding: 28px 16px; margin-top: 0; }
.store-footer a { color: #fff; }

@media (max-width: 960px) {
  .store-nav { display: none; }
  .hero-grid, .creator { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 32px; }
  .products { grid-template-columns: repeat(2, 1fr); }
  .steps, .why, .pillars { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: minmax(0, 1fr); }
  .product-info { position: static; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .feature:nth-child(3) { border-inline-start: 0; }
  .feature:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .store-header .wrap { height: 60px; gap: 10px; }
  .logo { font-size: 22px; }
  .header-cta { padding: 8px 12px; font-size: 14px; }
  .hero { padding: 28px 0; }
  .hero h1 { font-size: 27px; }
  .hero-text p { font-size: 16px; }
  .products { gap: 10px; }
  .product-body { padding: 10px; }
  .product-body h3 { font-size: 14px; }
  .product-foot { flex-direction: column; align-items: stretch; gap: 6px; }
  .steps, .why, .pillars { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 34px 0; }
  .section-head h2 { font-size: 24px; }
  .card { padding: 16px; }
}

@media print {
  .store > *:not(.print-block) { display: none !important; }
}
