/* ════════════════════════════════════════════
   custom.css — إضافات كار ماستر فوق أنماط التصميم
   (شريط الإعلانات، الأزرار العائمة، التوست، قائمة الجوال…)
════════════════════════════════════════════ */

/* ── شريط الإعلانات المتحرك ── */
.cm-ticker { position: relative; }
.cm-ticker-track {
    display: inline-flex; gap: 2.5rem; white-space: nowrap;
    animation: cm-marquee 40s linear infinite; will-change: transform;
}
.cm-ticker:hover .cm-ticker-track { animation-play-state: paused; }
@keyframes cm-marquee { from { transform: translateX(0); } to { transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) { .cm-ticker-track { animation: none; } }

/* ── القوائم المنسدلة في الهيدر (Desktop) ── */
.cm-dropdown { position: relative; }
.cm-dropdown-btn {
    display: inline-flex; align-items: center; gap: .3rem;
    background: none; border: 0; cursor: pointer; font-family: inherit;
}
.cm-dropdown-btn svg { transition: transform .2s ease; }
.cm-dropdown.open .cm-dropdown-btn svg { transform: rotate(180deg); }
.cm-dropdown-panel {
    position: absolute; inset-inline-start: 0; top: calc(100% + .5rem);
    min-width: 220px; background: var(--card, #fff);
    border: 1px solid var(--border, rgba(0,0,0,.08)); border-radius: 1rem;
    box-shadow: 0 16px 40px rgba(0,0,0,.12);
    padding: .5rem; display: none; flex-direction: column; gap: .15rem;
    z-index: 50;
}
.cm-dropdown.open .cm-dropdown-panel { display: flex; }
.cm-dropdown-panel a {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding: .65rem .8rem; border-radius: .65rem; font-size: .875rem; font-weight: 600;
    color: inherit; transition: background .15s ease, color .15s ease;
}
.cm-dropdown-panel a:hover,
.cm-dropdown-panel a.active { background: var(--accent, rgba(201,162,39,.1)); color: var(--gold, #b8860b); }
.cm-dropdown-panel a svg { opacity: .5; flex-shrink: 0; }
.cm-dropdown-empty { display: block; padding: .65rem .8rem; font-size: .8rem; color: var(--muted-foreground, #888); }

/* ── قائمة الجوال (قائمة مسطّحة كالأصل) ── */
.cm-mobile-menu {
    display: none; flex-direction: column; padding: .5rem 1rem 1rem;
    border-top: 1px solid hsl(var(--border, 0 0% 90%));
    background: inherit;
}
.cm-mobile-menu.open { display: flex; }
.cm-mobile-menu > a {
    padding: .7rem .5rem; font-weight: 600; font-size: .95rem;
    border-bottom: 1px dashed rgba(0,0,0,.06); color: inherit;
}
.cm-mobile-menu > a:last-child { border-bottom: 0; }
.cm-mobile-menu > a.active { color: var(--gold, #b8860b); }
.cm-mobile-cta { color: #b8860b; font-weight: 800; }

/* عنصر "الأقسام" — أكورديون داخل قائمة الجوال */
.cm-accordion { border-bottom: 1px dashed rgba(0,0,0,.06); }
.cm-accordion-btn {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: .7rem .5rem; font-weight: 600; font-size: .95rem;
    background: none; border: 0; color: inherit; font-family: inherit; cursor: pointer;
}
.cm-accordion-btn.active,
.cm-accordion-btn[aria-expanded="true"] { color: var(--gold, #b8860b); }
.cm-accordion-btn svg { transition: transform .2s ease; flex-shrink: 0; }
.cm-accordion.open .cm-accordion-btn svg { transform: rotate(180deg); }
.cm-accordion-panel {
    display: none; flex-direction: column; padding: 0 .5rem .5rem 1.25rem;
    gap: .1rem;
}
.cm-accordion.open .cm-accordion-panel { display: flex; }
.cm-accordion-panel a {
    padding: .55rem .5rem; font-size: .875rem; font-weight: 600;
    color: var(--muted-foreground, #666); border-bottom: 0 !important;
}
.cm-accordion-panel a.active { color: var(--gold, #b8860b); }
.cm-accordion-empty { padding: .55rem .5rem; font-size: .8rem; color: var(--muted-foreground, #888); }

/* ── الأزرار العائمة ── */
.cm-floats {
    position: fixed; bottom: 1.25rem; inset-inline-start: 1.25rem; z-index: 60;
    display: flex; flex-direction: column; gap: .75rem;
}
.cm-float {
    width: 52px; height: 52px; border-radius: 9999px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.25);
    transition: transform .2s ease;
}
.cm-float:hover { transform: scale(1.08); }
.cm-float-wa   { background: #25d366; }
.cm-float-call { background: linear-gradient(135deg,#c9a227,#e6c964); color: #1a1a1a; }

/* ── التوست ── */
.cm-toast {
    position: fixed; bottom: 1.5rem; inset-inline-end: 1.5rem; z-index: 80;
    max-width: 320px; padding: .85rem 1.25rem; border-radius: .9rem;
    font-weight: 700; font-size: .9rem; color: #fff;
    opacity: 0; transform: translateY(12px); pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    box-shadow: 0 12px 32px rgba(0,0,0,.25);
}
.cm-toast.show { opacity: 1; transform: translateY(0); }
.cm-toast.ok  { background: #1a7f4b; }
.cm-toast.err { background: #b3261e; }

/* ── شارة عدد المفضلة ── */
.fav-badge {
    position: absolute; top: -4px; inset-inline-end: -4px;
    min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 9999px; background: #c9a227; color: #1a1a1a;
    font-size: 11px; font-weight: 800;
    align-items: center; justify-content: center;
}

/* ── زر المفضلة عند التفعيل ── */
[data-fav].is-fav { color: #c9a227 !important; border-color: #c9a227 !important; }
[data-fav].is-fav svg { fill: #c9a227; }

/* ── نموذج النشرة البريدية ── */
.cm-newsletter { display: flex; gap: .5rem; }
.cm-newsletter input {
    flex: 1; min-width: 0; padding: .6rem .9rem; border-radius: .75rem;
    border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08);
    color: #fff; font-size: .85rem;
}
.cm-newsletter input::placeholder { color: rgba(255,255,255,.5); }
.cm-newsletter button { padding: .6rem 1rem; border-radius: .75rem; font-size: .85rem; white-space: nowrap; }

/* ── أكورديون الأسئلة الشائعة (AEO) ── */
.cm-faq-item summary {
    cursor: pointer; list-style: none; display: flex; align-items: center;
    justify-content: space-between; gap: 1rem; font-weight: 800;
}
.cm-faq-item summary::-webkit-details-marker { display: none; }
.cm-faq-item summary::after { content: '+'; font-size: 1.4rem; line-height: 1; color: #c9a227; transition: transform .2s; }
.cm-faq-item[open] summary::after { transform: rotate(45deg); }

/* ── محتوى المقالات ── */
.cm-prose { line-height: 1.9; }
.cm-prose h2 { font-size: 1.5rem; font-weight: 800; margin: 1.75rem 0 .75rem; }
.cm-prose h3 { font-size: 1.2rem; font-weight: 800; margin: 1.4rem 0 .6rem; }
.cm-prose p  { margin-bottom: 1rem; }
.cm-prose ul { padding-inline-start: 1.25rem; margin-bottom: 1rem; list-style: disc; }
.cm-prose img { border-radius: 1rem; margin: 1.25rem 0; }

/* ── ترقيم الصفحات ── */
.cm-pagination { display: flex; justify-content: center; margin-top: 2.5rem; }
.cm-pagination nav { display: flex; gap: .4rem; }
