/* Start Your Path: "FX" layer (light 3D + dynamic UI).
   Loaded only when FANCY_UI is not 0 in .env. Delete this file + fx.js, or set FANCY_UI=0, to switch it all off. */

/* ---------- 3D tilt + reveal (one transform, driven by CSS variables) ---------- */
.mk-card, .mk-cat, .mk-plat, .course-card {
    --rx: 0deg; --ry: 0deg; --ty: 0px;
    position: relative;
    transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--ty));
    transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .3s ease, opacity .5s ease, border-color .2s ease;
    will-change: transform;
}
.mk-card:hover, .mk-cat:hover, .mk-plat:hover, .course-card:hover {
    box-shadow: 0 14px 34px rgba(26,26,46,.16), 0 3px 8px rgba(26,26,46,.08);
    border-color: rgba(196,18,48,.35);
}
.mk-card.fx-hot, .mk-cat.fx-hot, .mk-plat.fx-hot, .course-card.fx-hot { transition: transform .08s linear, box-shadow .3s ease, opacity .5s ease; }
/* soft light that follows the pointer */
.mk-card::after, .mk-cat::after, .mk-plat::after, .course-card::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(245,166,35,.18), transparent 60%);
    transition: opacity .25s ease;
}
.mk-card.fx-hot::after, .mk-cat.fx-hot::after, .mk-plat.fx-hot::after, .course-card.fx-hot::after { opacity: 1; }
.mk-thumb { overflow: hidden; }
.mk-thumb img, .mk-thumb-ph { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.mk-card:hover .mk-thumb img, .mk-card:hover .mk-thumb-ph { transform: scale(1.07); }

/* scroll reveal (class only added by JS, so nothing is hidden without JS) */
.fx-rv { opacity: 0; --ty: 22px; }
.fx-rv.fx-in { opacity: 1; --ty: 0px; }
.mk-news.fx-rv { transform: translateY(var(--ty)); transition: transform .6s ease, opacity .6s ease; }

/* ---------- Hero with 3D canvas ---------- */
.fx-hero {
    position: relative; overflow: hidden; isolation: isolate;
    background-size: 220% 220%; animation: fxShift 16s ease-in-out infinite;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 340px;
}
.fx-hero > * { position: relative; z-index: 1; }
.fx-hero > .fx-hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .9; }
.fx-hero h1 { text-shadow: 0 2px 18px rgba(26,26,46,.35); }
.fx-hero-stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0 0; padding: 0; list-style: none; }
.fx-hero-stats li, .fx-hero-try a {
    padding: 5px 12px; border-radius: 99px; font-size: .82rem; color: #fff; text-decoration: none;
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.fx-hero-try { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 12px; font-size: .82rem; color: rgba(255,255,255,.9); }
.fx-hero-try a:hover { background: rgba(255,255,255,.3); text-decoration: none; }
.fx-hero .mk-hero-search { width: 100%; }
.fx-hero .mk-hero-search input { box-shadow: 0 8px 24px rgba(26,26,46,.25); }
@keyframes fxShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ---------- Live search dropdown ---------- */
.fx-sg {
    position: absolute; z-index: 1000; background: #fff; color: #1A1A2E; border: 1px solid #e5e5ea; border-radius: 12px;
    box-shadow: 0 18px 40px rgba(26,26,46,.22); overflow: hidden; text-align: left;
}
.fx-sg[hidden] { display: none; }
.fx-sg a { display: block; padding: 10px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid #f0f0f4; }
.fx-sg a strong { display: block; font-size: .92rem; line-height: 1.3; }
.fx-sg a span { display: block; font-size: .76rem; color: #666; margin-top: 1px; }
.fx-sg a:hover, .fx-sg a.on { background: #fff4e0; text-decoration: none; }
.fx-sg a.fx-sg-all { font-size: .85rem; font-weight: 600; color: var(--gdw-red, #C41230); border-bottom: 0; background: #faf9fc; }

/* ---------- Filters: loading state ---------- */
.fx-loading .mk-grid { opacity: .4; pointer-events: none; transition: opacity .15s ease; }
.fx-loading .mk-count::after { content: " …"; }

/* ---------- Compare button + tray ---------- */
.mk-cmp {
    font: inherit; font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; cursor: pointer;
    background: #fff; color: #1A1A2E; border: 1px solid #c9c9d6; transition: background .15s, border-color .15s, color .15s;
}
.mk-cmp:hover { border-color: var(--gdw-red, #C41230); }
.mk-cmp[aria-pressed="true"] { background: var(--gdw-dark, #1A1A2E); color: #fff; border-color: var(--gdw-dark, #1A1A2E); }
.mk-cmp[hidden] { display: none; }
.fx-tray {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(26,26,46,.96); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 -10px 30px rgba(0,0,0,.25); transform: translateY(0); transition: transform .3s ease;
}
.fx-tray[hidden] { display: none; }
.fx-tray-in { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fx-tray-t { font-weight: 700; font-size: .9rem; }
.fx-tray-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 200px; min-width: 0; }
.fx-chip { display: inline-flex; gap: 6px; align-items: center; max-width: 240px; padding: 4px 6px 4px 10px; border-radius: 99px; background: rgba(255,255,255,.14); font-size: .8rem; }
.fx-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-chip button { border: 0; background: transparent; color: #fff; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px; }
.fx-tray-note { flex-basis: 100%; font-size: .78rem; color: #ffd98a; margin: 0; }
.fx-tray .btn { padding: 8px 16px; font-size: .9rem; }
.fx-tray .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.fx-tray-clear { border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; border-radius: 8px; padding: 7px 12px; cursor: pointer; font: inherit; font-size: .85rem; }
body.fx-tray-on { padding-bottom: 96px; }

/* ---------- Small polish ---------- */
.fx .mk-section-head h2 { position: relative; padding-bottom: 6px; }
.fx .mk-section-head h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 42px; height: 3px; border-radius: 3px; background: var(--gdw-gradient, linear-gradient(135deg,#F5A623,#C41230)); }
.fx .btn-primary { transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease; }
.fx .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(196,18,48,.3); }
.fx .mk-price-now { font-variant-numeric: tabular-nums; }

/* ---------- Accessibility: calm everything down when asked ---------- */
@media (prefers-reduced-motion: reduce) {
    .fx-hero { animation: none; }
    .mk-card, .mk-cat, .mk-plat, .course-card { transform: none !important; transition: box-shadow .2s ease; }
    .fx-rv { opacity: 1 !important; }
    .mk-thumb img, .mk-thumb-ph { transition: none; }
    .mk-card:hover .mk-thumb img, .mk-card:hover .mk-thumb-ph { transform: none; }
    .fx-tray { transition: none; }
}
@media (hover: none) {
    .mk-card:hover, .mk-cat:hover, .mk-plat:hover, .course-card:hover { box-shadow: none; }
    .mk-card:hover .mk-thumb img, .mk-card:hover .mk-thumb-ph { transform: none; }
}
@media (max-width: 720px) {
    .fx-hero { min-height: 0; }
    .fx-tray-in { gap: 6px; }
}
