.page-buy {
    --buy-bg: #ffffff;
    --buy-text: #17131f;
    --buy-muted: #6f6878;
    --buy-line: rgba(23, 19, 31, .13);
    --buy-surface: #f8f7fb;
    --buy-good: #23896f;
    --buy-warning: #9a6a10;
}

/* Reset shared main spacing before laying out the directory. */

.page-buy main {
    margin-left: 0 !important;
    padding: 0 !important;
}

.page-buy #platforms {
    background: var(--buy-bg);
}

.page-buy .directory {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 170px clamp(24px, 7vw, 110px) 105px;
    background: var(--buy-bg);
    color: var(--buy-text);
}

/* Place the page title and introductory text alongside search. */

.page-buy .directory-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 34px;
}

.page-buy .directory-copy {
    min-width: 0;
}

.page-buy .directory-head h1 {
    margin: 0;
    color: var(--support-text);
    font-family: Syne, sans-serif;
    font-size: clamp(3rem, 6vw, 6rem) !important;
    font-weight: 700;
    line-height: .88;
    letter-spacing: -.06em;
    text-transform: uppercase;
    overflow-wrap: break-word;
    text-wrap: balance;
}

.directory-head h1.text-platform {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: min(100%, 760px);
    max-width: 760px;
    margin: 0;
    color: #121111;
    font: 700 clamp(3.2rem, 7vw, 6.8rem) / .88 Syne, sans-serif;
    letter-spacing: -.065em;
    text-transform: uppercase;
}

.page-buy .directory-head p {
    max-width: 760px;
    margin: 0;
    color: var(--buy-muted);
    line-height: 1.65;
}

/* Search field beside the page heading. */

.page-buy .search {
    position: relative;
    width: clamp(260px, 28vw, 420px);
    flex: 0 1 420px;
    min-width: 0;
}

.page-buy .search input {
    width: 100%;
    height: 50px;
    padding: 0 18px 0 45px;
    border: 1px solid var(--buy-line);
    border-radius: 999px;
    outline: none;
    color: var(--buy-text);
    transition: border-color .2s, background .2s, box-shadow .2s;
    min-width: 0;
    box-sizing: border-box;
}

.page-buy .search input::placeholder {
    color: #928b9a;
}

.page-buy .search input:focus {
    border-color: var(--violet);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(124, 77, 255, .10);
}

.page-buy .search svg {
    position: absolute;
    left: 17px;
    top: 16px;
    width: 18px;
    fill: none;
    stroke: #756e7e;
    stroke-width: 2;
    pointer-events: none;
}

/* Show which platform category the visitor has selected. */

.page-buy .filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 54px;
}

.page-buy .filter {
    border: 1px solid var(--buy-line);
    border-radius: 999px;
    background: #fff;
    padding: 10px 17px;
    color: var(--buy-muted);
    cursor: pointer;
    transition: .2s;
}

.page-buy .filter:hover,
.page-buy .filter:focus-visible {
    color: var(--buy-text);
    border-color: rgba(124, 77, 255, .32);
    background: rgba(124, 77, 255, .045);
}

.page-buy .filter.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(90deg, var(--acid), var(--violet));
}

/* Spacing between platform groups. */

.page-buy .group {
    margin-top: 48px;
    scroll-margin-top: 125px;
}

.page-buy .group+.group {
    margin-top: 64px;
}

/* Cards keep their status badges and official links together. */

.page-buy .group[hidden],
.page-buy .platform-card[hidden] {
    display: none !important;
}

.page-buy .platform-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    align-items: stretch;
}

.page-buy .platform-card {
    position: relative;
    min-height: 292px;
    display: flex;
    flex-direction: column;
    padding: 23px;
    border: 1px solid rgba(23, 19, 31, .11);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(34, 20, 55, .055);
    transition: transform .25s, border-color .25s, background .25s, box-shadow .25s;
}

.page-buy .platform-card:hover {
    transform: translateY(-5px);
    border-color: rgba(221, 21, 138, .35);
    box-shadow: 0 20px 48px rgba(34, 20, 55, .10);
}

.page-buy .platform-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.page-buy .platform-logo {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: #7c4dff;
}

.page-buy .platform-logo img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.page-buy .badge {
    padding: 6px 9px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.page-buy .badge.compatible {
    color: var(--buy-bg);
    background: #7c4dff;
    border: 1px solid rgba(35, 137, 111, .20);
}

.page-buy .badge.planned {
    color: var(--buy-bg);
    background: #dd158a;
    border: 1px solid rgba(154, 106, 16, .20);
}

.page-buy .badge.pending {
    color: #6e6875;
    background: #f3f1f5;
    border: 1px solid rgba(23, 19, 31, .11);
}

.page-buy .platform-card h3 {
    margin: 22px 0 7px;
    color: var(--buy-text);
    font: 700 1.18rem Syne, sans-serif;
}

.page-buy .platform-card p {
    margin: 0 0 22px;
    color: var(--buy-muted);
    font-size: .86rem;
    line-height: 1.55;
}

.page-buy .platform-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: auto;
    width: fit-content;
    border: 0;
    background: transparent;
    color: var(--acid);
    font: 700 1rem "DM Sans", sans-serif;
    cursor: pointer;
}

.page-buy .platform-link::after {
    content: "";
    transition: transform .2s;
}

.page-buy .platform-link:hover::after,
.page-buy .platform-link:focus-visible::after {
    transform: translate(3px, -3px);
}

/* Message shown when no platforms match the search. */

.page-buy .empty-state {
    display: none;
    margin-top: 32px;
    padding: 45px 20px;
    border: 1px dashed rgba(23, 19, 31, .18);
    border-radius: 20px;
    color: var(--buy-muted);
    background: var(--buy-surface);
    text-align: center;
}

/* Read Arabic naturally while keeping the navigation in its usual order. */

.page-buy .site-header,
.page-buy footer {
    direction: ltr;
}

html[dir="rtl"] .page-buy .directory,
html[dir="rtl"] .page-buy .directory-head,
html[dir="rtl"] .page-buy .filters,
html[dir="rtl"] .page-buy .platform-grid,
html[dir="rtl"] .page-buy .platform-card,
html[dir="rtl"] .page-buy .platform-top {
    direction: ltr;
}

html[dir="rtl"] .page-buy :is(h1, h2, h3, p, a, button, span, input) {
    unicode-bidi: plaintext;
}

html[dir="rtl"] .page-buy .search input {
    direction: rtl;
    text-align: right;
    padding-right: 45px;
    padding-left: 18px;
}

html[dir="rtl"] .page-buy .search svg {
    left: auto;
    right: 17px;
}

html[dir="rtl"] body {
    direction: ltr;
}

html[dir="rtl"] :is(h1, h2, h3, h4, h5, h6, p, a, button, label, small, strong, em, time, input, textarea) {
    unicode-bidi: plaintext;
}

html[dir="rtl"] :is(.site-header,
    .brand-horizontal,
    .top-navigation,
    .header-actions,
    .language-selector,
    .language-menu,
    .language-option,
    .nav-dropdown,
    .nav-submenu,
    .fine,
    .social-links,
    .modal,
    .dialog) {
    direction: ltr;
}

html[dir="rtl"] input,
html[dir="rtl"] textarea {
    direction: rtl;
}

/* Responsive adjustments are grouped here, from wider to narrower screens. */

/* Tablet layout. */
@media (max-width: 900px) {
    .page-buy .directory {
        padding-top: 125px;
    }

    .page-buy .directory-head h1 {
        margin: 24px 0 28px;
        font-size: clamp(3.8rem, 14vw, 7rem);
    }

    .page-buy .platform-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-buy .platform-card {
        min-height: 260px;
    }

    .page-buy .directory-head h1.text-platform {
        font-size: clamp(3rem, 9vw, 5.2rem);
        line-height: .9;
        letter-spacing: -.055em;
    }

    .page-buy .directory-head {
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
    }

    .page-buy .search {
        width: min(100%, 420px);
        flex: none;
        align-self: flex-end;
    }
}

/* Small screens. */
@media (max-width: 650px) {
    .page-buy .directory {
        padding: 112px 18px 75px;
    }

    .page-buy .directory-head {
        flex-direction: column;
        gap: 24px;
    }

    .page-buy .directory-head h1 {
        margin: 18px 0 20px;
        padding-bottom: 20px;
        font-size: clamp(3.1rem, 15vw, 5.4rem);
        line-height: .82;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .page-buy .filters {
        margin-bottom: 42px;
    }

    .page-buy .group+.group {
        margin-top: 50px;
    }

    .page-buy .platform-grid {
        grid-template-columns: 1fr;
    }

    .page-buy .platform-card {
        min-height: 0;
    }

    .page-buy .directory-head h1.text-platform {
        font-size: clamp(2.6rem, 11vw, 4.2rem);
        line-height: .92;
        letter-spacing: -.05em;
    }

    .page-buy .search {
        width: 100%;
        max-width: none;
        align-self: stretch;
    }

    .page-buy .search input {
        width: 100%;
        height: 48px;
    }
}

/* Narrow phone headings. */
@media (max-width: 560px) {
    .page-buy .directory-head #buyPageTitle {
        font-size: clamp(1.75rem, 8.5vw, 2.4rem) !important;
        line-height: 0.95;
    }
}

/* Reduce motion when requested. */
@media (prefers-reduced-motion: reduce) {

    .page-buy .platform-card,
    .page-buy .platform-link::after,
    .page-buy .filter {
        transition: none;
    }

    .page-buy .platform-card:hover {
        transform: none;
    }
}


/* Styles main title */
@media (max-width: 560px) {
    .page-buy .directory-head #buyPageTitle {
        font-size: clamp(1.75rem, 8.5vw, 2.4rem) !important;
        line-height: 0.95;
    }
}