/* ==========================================================================
   ההדר הראשי: מרווחים בלי שבירת שורות + מגה-מניו (גזעים / קורסים) + אקורדיון מובייל
   נטען אחרי style.css / mobile.css, לכן גובר עליהם בלי !important.
   ========================================================================== */

/* ---------- 1. שורה אחת, ריווח נדיב ---------- */
.site-header .header-container { gap: clamp(14px, 1.6vw, 34px); }
.site-header .logo-container { flex: 0 0 auto; }
.site-header .main-nav { flex: 1 1 auto; min-width: 0; justify-content: center; margin: 0; }
.site-header .nav-links { flex-wrap: nowrap; align-items: center; gap: clamp(10px, 1.45vw, 32px); }
.site-header .nav-links > li { flex: 0 0 auto; white-space: nowrap; display: flex; align-items: center; height: 80px; position: relative; }
.site-header .nav-links a { white-space: nowrap; font-size: clamp(.9rem, .5vw + .62rem, 1.06rem); }
.site-header .header-actions { flex: 0 0 auto; gap: clamp(10px, 1vw, 18px); }
.site-header .header-buttons-wrapper { flex-wrap: nowrap; gap: 10px; }
.site-header .header-buttons-wrapper a { white-space: nowrap; }
.site-header .live-search-input { width: clamp(118px, 7.4vw, 150px); }
.site-header .live-search-input:focus { width: clamp(170px, 12vw, 230px); }

/* דסקטופ צר (1311-1559): החיפוש הופך לאייקון שנפתח בלחיצה, הכפתורים קומפקטיים - כדי שיהיה מקום לרווחים */
@media (min-width: 1311px) and (max-width: 1559px) {
    .site-header .header-container { padding-inline: 22px; gap: 16px; }
    .site-header .nav-links { gap: clamp(6px, 1.05vw, 18px); }
    .site-header .nav-links a { font-size: .9rem; }
    .site-header .header-actions .live-search-wrapper { width: 40px; height: 40px; flex: 0 0 40px; }
    .site-header .header-actions .live-search-input { position: absolute; top: 0; right: 0; width: 40px; height: 40px; padding: 0; cursor: pointer; transition: width .3s ease, box-shadow .3s; }
    .site-header .header-actions .live-search-input::placeholder { color: transparent; }
    .site-header .header-actions .live-search-input:focus { width: 230px; padding: 0 38px 0 14px; cursor: text; z-index: 5; }
    .site-header .header-actions .live-search-input:focus::placeholder { color: #999; }
    .site-header .header-actions .search-icon { right: 13px; z-index: 6; }
    .site-header .header-actions .search-results-dropdown { min-width: 280px; }
    .site-header .header-buttons-wrapper .btn-student, .site-header .header-buttons-wrapper .btn-primary { padding: 7px 13px; font-size: .88rem; }
}

/* ---------- 2. פריט עם מגה-מניו ---------- */
.nav-links .has-mega { gap: 2px; }
.nav-links .mega-toggle {
    border: 0; background: transparent; cursor: pointer; padding: 6px 4px; margin: 0;
    color: #6b7280; font-size: .7rem; line-height: 1; border-radius: 6px;
    display: inline-flex; align-items: center; transition: color .25s, background .25s;
}
.nav-links .mega-toggle i { transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.nav-links .has-mega:hover .mega-toggle, .nav-links .has-mega.open .mega-toggle { color: var(--primary-color, #0069a9); }
.nav-links .has-mega.open .mega-toggle i { transform: rotate(180deg); }
.nav-links .mega-toggle:focus-visible, .nav-links a:focus-visible { outline: 2px solid var(--primary-color, #0069a9); outline-offset: 3px; }
.nav-links .has-mega.open > a { color: var(--primary-color, #0069a9); }
.nav-links .has-mega.open > a::after { width: 100%; }

/* ---------- 3. הפאנל ורקע ההחשכה ---------- */
.mega-backdrop {
    position: fixed; inset: 80px 0 0 0; z-index: 998;
    background: rgba(18, 28, 44, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s;
}
.mega-backdrop.open { opacity: 1; visibility: visible; transition: opacity .3s ease, visibility 0s; }

.mega-panel {
    position: fixed; top: 80px; left: 0; right: 0; z-index: 999;
    display: flex; justify-content: center; padding: 0 24px;
    visibility: hidden; opacity: 0; pointer-events: none; transform: translateY(-16px) scale(.985); transform-origin: top center;
    transition: opacity .26s ease, transform .38s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .38s;
}
.mega-panel.open { visibility: visible; opacity: 1; pointer-events: auto; transform: none; transition: opacity .26s ease, transform .38s cubic-bezier(.2, .8, .2, 1), visibility 0s; }

.mega-inner {
    width: min(1180px, 100%); display: grid; grid-template-columns: 310px minmax(0, 1fr);
    background: #fff; border-radius: 0 0 24px 24px; overflow: hidden;
    box-shadow: 0 34px 70px rgba(15, 30, 55, .22), 0 2px 0 rgba(0, 105, 169, .08);
    max-height: calc(100vh - 110px);
}

/* עמודת הפרומו */
.mega-promo {
    position: relative; overflow: hidden; color: #fff; padding: 34px 30px;
    display: flex; flex-direction: column; gap: 14px; justify-content: center;
    background: linear-gradient(155deg, #0069a9 0%, #0089c7 55%, #00abda 100%);
}
.mega-promo--courses { background: linear-gradient(155deg, #0b3a66 0%, #0069a9 60%, #1a8fd0 100%); }
.mega-promo::before, .mega-promo::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .09); pointer-events: none; }
.mega-promo::before { width: 220px; height: 220px; left: -80px; bottom: -90px; }
.mega-promo::after { width: 120px; height: 120px; right: -40px; top: -40px; }
.mega-promo > * { position: relative; z-index: 1; }
.mega-eyebrow { font-size: .85rem; font-weight: 700; opacity: .92; display: inline-flex; gap: 8px; align-items: center; letter-spacing: .2px; }
.mega-promo h3 { margin: 0; font-size: 1.55rem; line-height: 1.25; font-weight: 800; color: #fff; }
.mega-promo p { margin: 0; font-size: .98rem; line-height: 1.6; opacity: .93; }
.mega-cta {
    margin-top: 6px; align-self: flex-start; display: inline-flex; align-items: center; gap: 10px;
    background: #fff; color: #0069a9; font-weight: 800; padding: 12px 22px; border-radius: 30px; font-size: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .16); transition: transform .25s, box-shadow .25s, gap .25s;
}
.mega-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0, 0, 0, .22); gap: 14px; color: #00558a; }
.mega-link { color: #fff; font-weight: 600; font-size: .95rem; opacity: .92; display: inline-flex; gap: 8px; align-items: center; width: fit-content; border-bottom: 1px dashed rgba(255, 255, 255, .5); padding-bottom: 2px; }
.mega-link:hover { opacity: 1; color: #fff; }

/* גוף */
.mega-body { padding: 28px 30px 30px; overflow: auto; background: #fbfcfe; }
.mega-title { font-size: .85rem; font-weight: 800; color: #6b7280; letter-spacing: .4px; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.mega-title::after { content: ''; flex: 1; height: 1px; background: #e8edf3; }

.mega-grid { display: grid; gap: 14px; }
.mega-grid--groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mega-grid--courses { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.mega-card {
    display: flex; background: #fff; border: 1px solid #e8edf3; border-radius: 16px; color: #1f2937;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), box-shadow .28s, border-color .28s;
}
.mega-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(15, 30, 55, .12); border-color: var(--c, #0069a9); color: #1f2937; }
.mega-panel.open .mega-card { animation: megaIn .5s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 60ms + 90ms); }
@keyframes megaIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }

/* כרטיס קטגוריית גזע */
.mega-group { align-items: center; gap: 14px; padding: 16px 16px; position: relative; }
.mega-group-icon {
    --tint: #eef5fb; --tint: color-mix(in srgb, var(--c, #0069a9) 13%, #fff); --cut: var(--tint);
    flex: 0 0 52px; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.3rem;
    color: var(--c, #0069a9); background: var(--tint);
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), background .25s, color .25s;
}
.mega-group-icon .dog-ico { width: 40px; height: 40px; display: block; overflow: visible; }
.dog-cut { fill: var(--cut, #fff); }
.mega-group:hover .mega-group-icon { background: var(--c, #0069a9); color: #fff; --cut: var(--c, #0069a9); transform: rotate(-8deg) scale(1.06); }
.mega-group-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.mega-group-text strong { font-size: 1.05rem; font-weight: 800; color: #111827; line-height: 1.25; }
.mega-group-text small { color: #6b7280; font-size: .85rem; line-height: 1.35; }
.mega-group-text em { font-style: normal; color: var(--c, #0069a9); font-size: .8rem; font-weight: 700; line-height: 1.35; }
.mega-arrow { color: #cbd5e1; font-size: .8rem; transition: transform .28s, color .28s; }
.mega-group:hover .mega-arrow { color: var(--c, #0069a9); transform: translateX(-4px); }

/* כרטיס קורס */
.mega-course { flex-direction: column; overflow: hidden; --c: #0069a9; }
.mega-course-img { display: block; height: 118px; background-size: cover; background-position: center; background-color: #e5edf5; position: relative; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.mega-course { position: relative; }
.mega-course:hover .mega-course-img { transform: scale(1.05); }
.mega-course > .mega-course-img { overflow: hidden; }
.mega-course-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 16px; background: #fff; position: relative; z-index: 1; flex: 1; }
.mega-course-body strong { font-size: .98rem; line-height: 1.35; font-weight: 800; color: #111827; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mega-course-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: #6b7280; font-size: .8rem; font-weight: 600; margin-top: auto; }
.mega-course-meta i { color: #0069a9; margin-inline-end: 4px; }
.mega-badge { position: absolute; top: 10px; right: 10px; font-size: .72rem; font-weight: 800; padding: 4px 11px; border-radius: 20px; color: #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .18); }
.mega-badge--open { background: #2f9e44; }
.mega-badge--closed { background: #dc3545; }
.mega-course.is-closed .mega-course-img { filter: grayscale(.65); }
.mega-course.is-closed { --c: #dc3545; }

@media (max-width: 1310px) {
    .mega-panel, .mega-backdrop { display: none; }
}
@media (min-width: 1311px) and (max-width: 1450px) {
    .mega-inner { grid-template-columns: 270px minmax(0, 1fr); }
    .mega-grid--groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    .mega-panel, .mega-backdrop, .mega-card, .mega-cta, .mega-group-icon, .mega-course-img, .nav-links .mega-toggle i { transition: none !important; animation: none !important; }
}

