:root {
    --m35-bg: #050812;
    --m35-surface: rgba(13, 20, 42, .58);
    --m35-surface-strong: rgba(9, 15, 33, .82);
    --m35-border: rgba(255, 255, 255, .13);
    --m35-text: #f8fbff;
    --m35-muted: #a7b2ca;
    --m35-accent: #6b8cff;
    --m35-accent-2: #52d9ff;
    --m35-shadow: 0 24px 70px rgba(0, 0, 0, .36);
    --m35-radius: 24px;
    color-scheme: dark;
}

:root[data-mego35-theme="light"] {
    --m35-bg: #edf3ff;
    --m35-surface: rgba(255, 255, 255, .67);
    --m35-surface-strong: rgba(255, 255, 255, .88);
    --m35-border: rgba(72, 91, 135, .16);
    --m35-text: #17213a;
    --m35-muted: #60708e;
    --m35-accent: #526fe8;
    --m35-accent-2: #11a9d8;
    --m35-shadow: 0 24px 70px rgba(67, 85, 128, .18);
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body.mego35-home-page {
    min-height: 100vh;
    margin: 0;
    padding: clamp(12px, 2vw, 26px);
    color: var(--m35-text);
    background-color: var(--m35-bg);
    background-image: linear-gradient(rgba(3, 7, 19, .14), rgba(3, 7, 19, .42)), url("img/dark.webp");
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: scroll;
    font-family: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
    line-height: 1.5;
    transition: color .25s ease, background-color .25s ease;
}

body.mego35-home-page.is-authenticated {
    padding: 0;
    transition: color .25s ease, background-color .25s ease, padding .28s ease;
}

body.mego35-home-page .mego35-account-sidebar {
    color: var(--m35-text);
    background: var(--m35-surface-strong);
    border-color: var(--m35-border);
    box-shadow: var(--m35-shadow);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

body.mego35-home-page .mego35-account-sidebar .customer-card,
body.mego35-home-page .mego35-account-sidebar .sidebar-nav {
    border-color: var(--m35-border);
}

body.mego35-home-page .mego35-account-sidebar .sidebar-footer {
    border-color: var(--m35-border);
}

@media (min-width: 992px) {
    body.mego35-home-page.is-authenticated { padding: 0; }
}

@media (max-width: 991px) {
    body.mego35-home-page.is-authenticated { padding: 0; }
    body.mego35-home-page .mego35-account-sidebar { background: var(--m35-surface-strong); }
}

:root[data-mego35-theme="light"] body.mego35-home-page {
    background-image: linear-gradient(rgba(245, 249, 255, .08), rgba(236, 243, 255, .22)), url("img/light.webp");
}

body.mego35-home-page::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    background: radial-gradient(circle at 50% 0, rgba(61, 123, 255, .12), transparent 48%), linear-gradient(to bottom, transparent 42%, rgba(2, 7, 20, .64));
    pointer-events: none;
}

:root[data-mego35-theme="light"] body.mego35-home-page::before {
    background: linear-gradient(to bottom, rgba(245, 248, 255, .06), rgba(230, 238, 253, .52));
}

.mego35-home-page a { color: inherit; text-decoration: none; }
.mego35-home-page button, .mego35-home-page input { font: inherit; }
.mego35-home-page button, .mego35-home-page summary { -webkit-tap-highlight-color: transparent; }
.mego35-home-page [hidden] { display: none !important; }
.mego35-page-shell { width: min(100%, 1220px); margin: 0 auto; }

.glass-panel {
    background: var(--m35-surface);
    border: 1px solid var(--m35-border);
    border-radius: var(--m35-radius);
    box-shadow: var(--m35-shadow);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.mego35-header {
    position: sticky;
    top: 14px;
    z-index: 1000;
    display: grid;
    grid-template-columns: auto minmax(260px, 1fr) auto;
    min-height: 84px;
    align-items: center;
    gap: 26px;
    padding: 12px 20px;
    margin-bottom: 28px;
}

.mego35-brand { display: flex; min-width: 0; align-items: center; gap: 11px; font-weight: 900; }
.mego35-brand img { display: block; width: auto; max-width: 180px; height: auto; max-height: 58px; object-fit: contain; }
.mego35-brand span { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.mego35-navigation { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 2.4vw, 34px); }
.mego35-navigation a { position: relative; padding: 11px 2px; color: var(--m35-muted); font-size: 14px; font-weight: 700; transition: color .2s ease; }
.mego35-navigation a::after { position: absolute; inset-inline: 50% auto; bottom: 4px; width: 0; height: 2px; content: ""; background: linear-gradient(90deg, var(--m35-accent), var(--m35-accent-2)); border-radius: 9px; transform: translateX(50%); transition: width .2s ease; }
[dir="ltr"] .mego35-navigation a::after { transform: translateX(-50%); }
.mego35-navigation a:hover, .mego35-navigation a.is-active { color: var(--m35-text); }
.mego35-navigation a:hover::after, .mego35-navigation a.is-active::after { width: 25px; }

.mego35-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.mego35-icon-button, .mego35-account-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    color: var(--m35-text);
    background: rgba(255, 255, 255, .07);
    border: 1px solid var(--m35-border);
    border-radius: 999px;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.mego35-icon-button { width: 42px; padding: 0; }
.mego35-icon-button:hover, .mego35-account-button:hover { background: rgba(107, 140, 255, .18); border-color: rgba(107, 140, 255, .5); transform: translateY(-1px); }
.mego35-account-button { color: var(--m35-text); font-size: 12px; font-weight: 800; }
.mego35-menu-toggle { display: none; }

.mego35-language { position: relative; }
.mego35-language > summary { list-style: none; }
.mego35-language > summary::-webkit-details-marker { display: none; }
.mego35-language-menu {
    position: absolute;
    inset-block-start: calc(100% + 12px);
    inset-inline-end: 0;
    z-index: 1100;
    width: 230px;
    padding: 9px;
    color: var(--m35-text);
    background: var(--m35-surface-strong);
    border: 1px solid var(--m35-border);
    border-radius: 17px;
    box-shadow: var(--m35-shadow);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.mego35-language-menu a { display: grid; grid-template-columns: 36px minmax(0, 1fr) 16px; align-items: center; gap: 9px; padding: 9px; border-radius: 11px; }
.mego35-language-menu a:hover, .mego35-language-menu a.is-active { background: rgba(107, 140, 255, .14); }
.mego35-language-menu a > span { display: grid; width: 34px; height: 34px; place-items: center; color: var(--m35-accent-2); background: rgba(82, 217, 255, .1); border-radius: 9px; font-size: 11px; font-weight: 900; }
.mego35-language-menu strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.mego35-main { display: grid; min-width: 0; gap: 24px; }
.mego35-hero { position: relative; width: 100%; max-width: 100%; min-width: 0; overflow: hidden; min-height: 260px; aspect-ratio: 1200 / 390; }
.mego35-slides, .mego35-slide { position: absolute; inset: 0; width: 100%; max-width: 100%; min-width: 0; overflow: hidden; }
.mego35-slide { visibility: hidden; opacity: 0; transform: scale(1.015); transition: opacity .65s ease, transform 1.2s ease, visibility .65s; }
.mego35-slide.is-active { visibility: visible; opacity: 1; transform: scale(1); }
.mego35-slide img { display: block; width: 100%; max-width: 100%; height: 100%; object-fit: cover; }
.mego35-slide-fallback { display: grid; place-items: center; padding: 30px; text-align: center; background: radial-gradient(circle at 50% 20%, rgba(82, 217, 255, .28), transparent 35%), linear-gradient(135deg, rgba(18, 30, 74, .82), rgba(56, 32, 100, .64)); }
.mego35-slide-fallback div { max-width: 670px; }
.mego35-slide-fallback span { color: #7be3ff; font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.mego35-slide-fallback h1 { margin: 8px 0; font-size: clamp(34px, 6vw, 70px); line-height: 1.1; }
.mego35-slide-fallback p { margin: 0 auto 23px; color: #d3daf0; }
.mego35-slide-fallback a { display: inline-flex; min-height: 45px; align-items: center; gap: 9px; padding: 0 19px; color: #fff; background: linear-gradient(135deg, var(--m35-accent), #6a4fe5); border-radius: 999px; font-size: 13px; font-weight: 800; }
.mego35-slide-arrow { position: absolute; top: 50%; z-index: 4; display: grid; width: 42px; height: 42px; place-items: center; padding: 0; color: #fff; background: rgba(4, 10, 26, .72); border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%; cursor: pointer; transform: translateY(-50%); }
.mego35-slide-arrow.is-next { inset-inline-end: 17px; }
.mego35-slide-arrow.is-prev { inset-inline-start: 17px; }
.mego35-slider-dots { position: absolute; bottom: 15px; left: 50%; z-index: 4; display: flex; gap: 7px; transform: translateX(-50%); }
.mego35-slider-dots button { width: 8px; height: 8px; padding: 0; background: rgba(255, 255, 255, .55); border: 0; border-radius: 99px; cursor: pointer; transition: width .2s ease, background .2s ease; }
.mego35-slider-dots button.is-active { width: 25px; background: #fff; }

.mego35-news { display: flex; min-height: 55px; align-items: center; gap: 14px; padding: 8px 17px; overflow: hidden; }
body.mego35-home-page .mego35-news {
    background: var(--m35-category-glass-bg);
    border-color: var(--m35-category-glass-border);
    box-shadow: 0 14px 36px var(--m35-category-glass-shadow);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.mego35-news-icon { display: grid; width: 37px; height: 37px; flex: 0 0 37px; place-items: center; color: var(--m35-accent-2); background: rgba(82, 217, 255, .11); border-radius: 12px; }
.mego35-news-viewport { position: relative; min-width: 0; height: 28px; overflow: hidden; flex: 1; direction: ltr; }
.mego35-news-track { position: absolute; top: 50%; left: 0; display: block; width: max-content; min-width: max-content; color: var(--m35-muted); direction: rtl; font-size: 13px; font-weight: 700; line-height: 28px; white-space: nowrap; animation: mego35-ticker 22s linear 0s infinite; will-change: transform; }
.mego35-news:hover .mego35-news-track { animation-play-state: paused; }
@keyframes mego35-ticker {
    from { transform: translate3d(-100%, -50%, 0); }
    to { transform: translate3d(100vw, -50%, 0); }
}
[dir="ltr"] .mego35-news-track { animation-name: mego35-ticker-ltr; }
@keyframes mego35-ticker-ltr {
    from { direction: ltr; transform: translate3d(100vw, -50%, 0); }
    to { direction: ltr; transform: translate3d(-100%, -50%, 0); }
}

.mego35-catalog { padding: 12px 0 24px; }
.mego35-section-heading { display: flex; justify-content: center; margin-bottom: 28px; }
.mego35-search { display: flex; width: min(100%, 500px); min-height: 51px; align-items: center; gap: 11px; padding: 0 17px; box-shadow: 0 13px 38px rgba(0, 0, 0, .15); }
body.mego35-home-page .mego35-search {
    background: var(--m35-category-glass-bg);
    border-color: var(--m35-category-glass-border);
    border-radius: 30px;
    box-shadow: 0 14px 36px var(--m35-category-glass-shadow);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.mego35-search > i { color: var(--m35-accent-2); }
body.mego35-home-page .mego35-search > input[type="search"] {
    min-width: 0;
    height: 49px;
    flex: 1;
    padding: 0;
    margin: 0;
    color: var(--m35-text) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    -webkit-appearance: none;
    appearance: none;
}
.mego35-search input::placeholder { color: var(--m35-muted); }
.mego35-search button { display: grid; width: 31px; height: 31px; place-items: center; padding: 0; color: var(--m35-muted); background: rgba(255, 255, 255, .07); border: 0; border-radius: 50%; cursor: pointer; }

.mego35-category-grid { display: grid; grid-template-columns: repeat(var(--mego35-columns, 4), minmax(0, 1fr)); gap: 18px; }
.mego35-category-item { display: flex; min-width: 0; content-visibility: auto; contain-intrinsic-size: auto 340px; }
.mego35-category-grid .category-card {
    position: relative;
    isolation: isolate;
    min-width: 0;
    width: 100%;
    height: 100%;
    padding: 14px 14px 0;
    overflow: hidden;
    color: var(--m35-text);
    background: var(--m35-category-glass-bg);
    border: 1px solid var(--m35-category-glass-border);
    border-radius: 20px;
    box-shadow: 0 14px 36px var(--m35-category-glass-shadow);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.mego35-category-grid .category-card:hover { background: var(--m35-category-glass-bg); border-color: var(--m35-category-glass-border); box-shadow: 0 20px 48px var(--m35-category-glass-shadow); transform: translateY(-5px); }
.mego35-category-grid .clin { position: relative; display: flex; min-width: 0; height: 100%; flex-direction: column; color: inherit; border-radius: calc(var(--m35-radius, 24px) - 8px); }
.mego35-category-grid .category-img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--mego35-image-ratio, 1 / 1);
    padding: 0;
    object-fit: cover;
    object-position: center;
    border: 0;
    border-radius: 7px;
    transition: transform .35s ease, filter .25s ease;
}
.mego35-category-grid .category-card:hover .category-img { transform: scale(1.025); }
.mego35-category-grid .category-title {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 17px 9px;
    margin: 0;
    overflow: hidden;
    color: var(--m35-text);
    background: transparent;
    border-radius: 0;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
    text-align: center;
    text-wrap: balance;
}
.mego35-category-grid .category-title > span { display: -webkit-box; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.mego35-category-grid .catalog-placeholder-label { position: absolute; top: 0; left: 0; z-index: 2; display: none; width: calc(100% - 22px); aspect-ratio: var(--mego35-image-ratio, 1 / 1); align-items: center; justify-content: center; padding: 18px; margin: 11px; color: #fff; text-align: center; border-radius: calc(var(--m35-radius, 24px) - 8px); font-size: clamp(14px, 2vw, 22px); font-weight: 800; line-height: 1.45; pointer-events: none; }
.mego35-category-grid .clin.is-placeholder .catalog-placeholder-label { display: flex; }

.mego35-empty-state { grid-column: 1 / -1; padding: 48px 20px; text-align: center; }
.mego35-empty-state > i { color: var(--m35-accent-2); font-size: 42px; }
.mego35-empty-state h2 { margin: 15px 0 6px; font-size: 20px; }
.mego35-empty-state p { margin: 0; color: var(--m35-muted); font-size: 13px; }

.mego35-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 14px; margin-bottom: 24px; }
.mego35-features article { display: flex; min-width: 0; align-items: center; gap: 13px; padding: 17px; border-inline-end: 1px solid var(--m35-border); }
.mego35-features article:last-child { border-inline-end: 0; }
.mego35-features article > i { display: grid; width: 45px; height: 45px; flex: 0 0 45px; place-items: center; color: var(--m35-accent-2); background: linear-gradient(145deg, rgba(107, 140, 255, .18), rgba(82, 217, 255, .08)); border: 1px solid rgba(107, 140, 255, .2); border-radius: 14px; font-size: 18px; }
.mego35-features strong, .mego35-features span { display: block; }
.mego35-features strong { font-size: 13px; }
.mego35-features span { margin-top: 3px; color: var(--m35-muted); font-size: 10px; line-height: 1.5; }

.mego35-footer { display: grid; grid-template-columns: 1.35fr .65fr; gap: 35px; padding: 32px; margin-top: 4px; }
.mego35-socials { display: flex; gap: 9px; }
.mego35-socials a { display: grid; width: 38px; height: 38px; place-items: center; color: var(--m35-muted); background: rgba(255, 255, 255, .06); border: 1px solid var(--m35-border); border-radius: 50%; transition: color .2s ease, background .2s ease, transform .2s ease; }
.mego35-socials a:hover { color: #fff; background: var(--m35-accent); transform: translateY(-2px); }
.mego35-footer-links { display: flex; align-items: flex-start; flex-direction: column; gap: 9px; }
.mego35-footer-links h2 { margin: 0 0 6px; font-size: 16px; }
.mego35-footer-links a { color: var(--m35-muted); font-size: 12px; }
.mego35-footer-links a:hover { color: var(--m35-accent-2); }
.mego35-footer-bottom { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 19px; color: var(--m35-muted); border-top: 1px solid var(--m35-border); font-size: 11px; }
.mego35-footer-bottom a { color: var(--m35-accent-2); font-weight: 800; }

@media (max-width: 980px) {
    .mego35-header { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; }
    .mego35-menu-toggle { display: inline-flex; }
    .mego35-navigation { position: absolute; inset-block-start: calc(100% + 10px); inset-inline: 0; display: none; align-items: stretch; padding: 12px; background: var(--m35-surface-strong); border: 1px solid var(--m35-border); border-radius: 18px; box-shadow: var(--m35-shadow); flex-direction: column; gap: 3px; }
    .mego35-navigation.is-open { display: flex; }
    .mego35-navigation a { padding: 12px 15px; border-radius: 11px; }
    .mego35-navigation a:hover, .mego35-navigation a.is-active { background: rgba(107, 140, 255, .12); }
    .mego35-navigation a::after { display: none; }
    .mego35-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mego35-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mego35-features article:nth-child(2) { border-inline-end: 0; }
    .mego35-features article:nth-child(-n+2) { border-bottom: 1px solid var(--m35-border); }
}

@media (max-width: 700px) {
    body.mego35-home-page { padding: 9px; background-attachment: scroll; }
    .mego35-page-shell { width: 100%; }
    .mego35-header { top: 7px; min-height: 66px; padding: 9px; margin-bottom: 15px; border-radius: 18px; }
    .mego35-brand { justify-content: center; }
    .mego35-brand img { max-width: 120px; max-height: 43px; }
    .mego35-brand > span { display: none; }
    .mego35-icon-button { width: 38px; min-height: 38px; }
    .mego35-account-button { width: 38px; min-height: 38px; padding: 0; }
    .mego35-account-button span { display: none; }
    .mego35-header-actions { gap: 5px; }
    .mego35-language-menu { position: fixed; top: 80px; inset-inline: 9px; width: auto; }
    .mego35-main { gap: 14px; }
    .mego35-hero {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 0;
        height: auto;
        aspect-ratio: 1280 / 400;
        contain: layout paint;
        border-radius: 18px;
    }
    .mego35-slides,
    .mego35-slide,
    .mego35-slide img { width: 100%; max-width: 100%; min-width: 0; }
    .mego35-slide-arrow { display: none; }
    .mego35-slider-dots { bottom: 8px; }
    .mego35-slide-fallback { padding: 18px; }
    .mego35-slide-fallback span { font-size: 8px; }
    .mego35-slide-fallback h1 { margin: 4px 0; font-size: 28px; }
    .mego35-slide-fallback p { display: none; }
    .mego35-slide-fallback a { min-height: 35px; padding: 0 13px; font-size: 10px; }
    .mego35-news { min-height: 49px; padding: 6px 10px; border-radius: 16px; }
    .mego35-news-icon { width: 34px; height: 34px; flex-basis: 34px; }
    .mego35-news-track { font-size: 11px; animation-duration: 16s; }
    .mego35-catalog { padding-top: 6px; }
    .mego35-section-heading { margin-bottom: 18px; }
    .mego35-search { width: 100%; min-height: 49px; border-radius: 18px; }
    .mego35-category-grid { grid-template-columns: repeat(var(--mego35-mobile-columns, 2), minmax(0, 1fr)); gap: 10px; }
    .mego35-category-grid .category-card { padding: 7px 7px 0; border-radius: 15px; }
    .mego35-category-grid .clin,
    .mego35-category-grid .category-img { border-radius: 12px; }
    .mego35-category-grid .category-img { padding: 0; border-radius: 6px; }
    .mego35-category-grid .category-title { min-height: 54px; padding: 12px 5px; margin: 0; border-radius: 0; font-size: 12px; line-height: 1.35; }
    .mego35-category-grid .catalog-placeholder-label { width: calc(100% - 14px); padding: 10px; margin: 7px; border-radius: 12px; }
    .mego35-features { grid-template-columns: 1fr; padding: 7px 13px; border-radius: 18px; }
    .mego35-features article { padding: 13px 5px; border-inline-end: 0; border-bottom: 1px solid var(--m35-border); }
    .mego35-features article:nth-child(-n+2) { border-bottom: 1px solid var(--m35-border); }
    .mego35-features article:last-child { border-bottom: 0; }
    .mego35-footer { grid-template-columns: 1fr; gap: 24px; padding: 24px 18px; border-radius: 18px; text-align: center; }
    .mego35-footer-brand .mego35-brand, .mego35-socials { justify-content: center; }
    .mego35-footer-links { align-items: center; }
    .mego35-footer-bottom { align-items: center; flex-direction: column; }
}

@media (max-width: 390px) {
    .mego35-header { grid-template-columns: 38px minmax(0, 1fr) auto; }
    .mego35-header-actions .mego35-language { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (hover: none), (pointer: coarse) {
    .mego35-category-grid .category-card,
    .mego35-category-grid .category-img { transition: none; }
    .mego35-category-grid .category-card:hover,
    .mego35-category-grid .category-card:hover .category-img { transform: none; }
}
