/* ==========================================================================================================
   home_all.css - the Games2All home page (Home/Index_AE.cshtml) only, linked from its Styles section.
   Everything is scoped under .g2a-home. The sections are Egypt home parts (g2.css, home_platforms.css,
   gift_cards.css); this file holds the one new block (the hero with its "code vault"), the three steps line under
   Quick buy, the account region pill (.g2a-acct, Shared/_AccountRegionPill) and the Games2All tiles of
   "Shop by platform". Colours: the --g2-* tokens (mint on Games2All); the few platform tones of the code cards and
   tiles are the only literal colours. Logical properties throughout, so one file serves LTR and RTL.
   ========================================================================================================== */

/* ---------- page rhythm: sections --g2-section-space apart (56px, 40px on phones) ---------- */
.g2a-home .g2-sec { padding-block: calc(var(--g2-section-space) / 2); }
.g2a-home h1, .g2a-home h2, .g2a-home h3 { text-wrap: balance; }
.g2a-home p { text-wrap: pretty; }

/* ==========================================================================================================
   HERO (the one new block): copy, search, account pill, popular chips | the code vault (decoration only)
   ========================================================================================================== */
.g2a-hero {
    position: relative;
    z-index: 3; /* the search dropdown and the pill's list open over the sections below */
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    align-items: center;
    gap: 24px;
    padding-block: 40px calc(var(--g2-section-space) / 2);
    color: var(--g2-text);
}

.g2a-hero::before {
    content: "";
    position: absolute;
    inset: -10% 0 auto 45%;
    height: 120%;
    background: radial-gradient(closest-side, var(--g2-brand-soft), transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.g2a-hero__copy { display: grid; gap: 16px; min-width: 0; align-content: center; }

.g2a-hero__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--g2-brand) 35%, transparent);
    background: var(--g2-brand-soft);
    color: var(--g2-brand);
    font-family: var(--g2-font-mono, ui-monospace, Consolas, monospace);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .08em;
}

html[dir="rtl"] .g2a-hero__label { font-family: inherit; letter-spacing: 0; font-size: 12px; }

.g2a-hero__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--g2-brand); animation: g2a-pulse 2s infinite; }

@keyframes g2a-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--g2-brand) 60%, transparent); }
    70%, 100% { box-shadow: 0 0 0 7px transparent; }
}

.g2a-home .g2a-hero__title {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.025em;
    text-transform: none !important;
    color: var(--g2-text) !important;
}

html[dir="rtl"] .g2a-home .g2a-hero__title { letter-spacing: 0; line-height: 1.3; }

.g2a-hero__text { max-width: 48ch; margin: -6px 0 0; font-size: 15px; line-height: var(--g2-text-lh); color: var(--g2-muted); }

/* Search (the header's form: search.css .g2s-field, autocomplete.js) + the account pill beside it. */
.g2a-hero__find { display: flex; align-items: flex-end; gap: 12px; min-width: 0; }

.g2a-home .g2a-hero__search {
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    width: auto !important; /* custom.css gives .search-box its own width */
    min-width: 0;
}

.g2a-home .g2a-hero__search form.g2s-field input.x-autocomplete {
    height: 48px;
    border-color: var(--g2-line2) !important;
    background-color: var(--g2-input) !important;
    font-size: 15px;
}

.g2a-home .g2a-hero__search form.g2s-field input.x-autocomplete:focus {
    border-color: var(--g2-brand) !important;
    box-shadow: 0 0 0 3px var(--g2-brand-soft);
}

/* Popular chips: Egypt's .g2-quicklink in a sideways row (g2.js fades it when it overflows). */
.g2a-hero__popular-wrap { min-width: 0; }
.g2a-hero__popular { display: flex; gap: 8px; }
.g2a-hero__popular .g2-quicklink { flex: 0 0 auto; height: 32px; font-size: 12.5px; }

/* ---------- the account region pill (a general option: Shared/_AccountRegionPill.cshtml) ---------- */
.g2a-acct { display: grid; gap: 6px; flex: 0 0 auto; min-width: 0; }

.g2a-home .g2a-acct__label {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--g2-muted);
    text-transform: none !important;
}

.g2a-acct .g2-dd { min-width: 190px; }
.g2a-acct .g2-dd__button { height: 48px; border-radius: 12px; border-color: var(--g2-line2); font-size: 13.5px; }

/* ---------- the code vault: three code cards + the delivered receipt (aria-hidden, no product data) ---------- */
.g2a-vault {
    position: relative;
    min-width: 0;
    min-height: 300px;
    pointer-events: none;
    user-select: none;
}

.g2a-code {
    position: absolute;
    width: 58%;
    aspect-ratio: 1.586;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 16px;
    overflow: hidden;
    isolation: isolate;
    color: #fff;
    box-shadow: 0 22px 40px -22px rgba(0, 0, 0, .85), inset 0 0 0 1px rgba(255, 255, 255, .08);
    animation: g2a-float 7s ease-in-out infinite;
}

.g2a-code::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .16) 45%, transparent 60%);
    transform: translateX(-120%);
    animation: g2a-sheen 9s ease-in-out infinite;
}

.g2a-code--xbox { inset-inline-start: 2%; top: 10%; rotate: -8deg; background: radial-gradient(120% 90% at 85% 0, #3fae3f 0, transparent 55%), linear-gradient(135deg, #0e5c0e, #06280a); animation-delay: -2s; }
.g2a-code--psn { inset-inline-start: 20%; top: 22%; z-index: 2; rotate: -1deg; background: radial-gradient(120% 90% at 85% 0, #5aa2ff 0, transparent 55%), linear-gradient(135deg, #0b3d91, #071d4a); }
.g2a-code--steam { inset-inline-start: 38%; top: 2%; rotate: 7deg; background: radial-gradient(120% 90% at 85% 0, #2a6d98 0, transparent 55%), linear-gradient(135deg, #1b2838, #0b1119); animation-delay: -4.5s; }
.g2a-code--psn::after { animation-delay: 1.5s; }
.g2a-code--steam::after { animation-delay: 4s; }

[dir="rtl"] .g2a-code--xbox { rotate: 8deg; }
[dir="rtl"] .g2a-code--psn { rotate: 1deg; }
[dir="rtl"] .g2a-code--steam { rotate: -7deg; }

.g2a-code__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.g2a-code__brand { font-size: 12px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }

.g2a-code__region {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .28);
    font-family: var(--g2-font-mono, ui-monospace, Consolas, monospace);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.g2a-code__region img { width: 16px; height: 12px; border-radius: 2px; }
.g2a-code__face { font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }

.g2a-code__number {
    font-family: var(--g2-font-mono, ui-monospace, Consolas, monospace);
    font-size: 11px;
    letter-spacing: .14em;
    opacity: .78;
}

.g2a-receipt {
    position: absolute;
    inset-inline-end: 0;
    bottom: 0;
    z-index: 3;
    display: grid;
    gap: 8px;
    width: min(270px, 72%);
    box-sizing: border-box;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--g2-line);
    background: color-mix(in srgb, var(--g2-surface) 92%, transparent);
    box-shadow: 0 20px 40px -20px #000;
    animation: g2a-receipt-in .9s cubic-bezier(.2, .7, .2, 1) .4s both;
}

.g2a-receipt__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--g2-muted); }
.g2a-receipt__paid { color: var(--g2-brand); font-weight: 700; }

.g2a-receipt__code {
    font-family: var(--g2-font-mono, ui-monospace, Consolas, monospace);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .1em;
    white-space: nowrap;
    color: var(--g2-text);
}

/* The slow reveal: one character after another, held, then masked again (opacity only; 9s a loop). */
.g2a-receipt__char { opacity: 0; animation: g2a-char 9s linear infinite; animation-delay: calc(var(--i) * .22s + 1.2s); }

.g2a-receipt__cursor {
    display: inline-block;
    width: 7px;
    height: 15px;
    margin-inline-start: 2px;
    vertical-align: -2px;
    background: var(--g2-brand);
    animation: g2a-blink 1s steps(1) infinite;
}

.g2a-receipt__actions { display: flex; gap: 6px; }

.g2a-receipt__action {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--g2-line);
    font-size: 11.5px;
    color: var(--g2-text);
}

.g2a-receipt__action--main { border-color: transparent; background: var(--g2-brand); color: #03201b; font-weight: 700; }

@keyframes g2a-float { 50% { translate: 0 -6px; } }
@keyframes g2a-sheen { 0%, 70% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
@keyframes g2a-receipt-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes g2a-char { 0% { opacity: 0; } 3%, 72% { opacity: 1; } 78%, 100% { opacity: 0; } }
@keyframes g2a-blink { 50% { opacity: 0; } }

/* Under 992px: one column, the vault under the copy and smaller (the search stays in the first screen). */
@media (max-width: 991.98px) {
    .g2a-hero { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 24px; }
    .g2a-hero::before { inset: auto 0 0 20%; height: 60%; }
    .g2a-vault { width: min(100%, 460px); min-height: 230px; margin-inline: auto; }
    .g2a-code__face { font-size: 26px; }
}

@media (max-width: 575.98px) {
    .g2a-home .g2a-hero__title { font-size: 24px; }
    .g2a-hero__text { font-size: 14px; }
    .g2a-hero__find { flex-direction: column; align-items: stretch; gap: 10px; }
    .g2a-acct { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
    .g2a-acct .g2-dd { min-width: 0; }
    .g2a-acct .g2-dd__button { height: 40px; }
    .g2a-home .g2a-hero__search form.g2s-field input.x-autocomplete { height: 46px; }
    .g2a-vault { min-height: 190px; }
    .g2a-code { padding: 10px 12px; border-radius: 12px; }
    .g2a-code__brand { font-size: 10px; }
    .g2a-code__face { font-size: 20px; }
    .g2a-code__number { font-size: 9px; }
    .g2a-receipt { width: min(220px, 68%); padding: 10px 12px; }
    .g2a-receipt__code { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .g2a-hero__dot, .g2a-code, .g2a-code::after, .g2a-receipt, .g2a-receipt__cursor { animation: none; }
    .g2a-receipt__char { opacity: 1; animation: none; }
}

/* ==========================================================================================================
   Quick buy: the three steps line under it
   ========================================================================================================== */
.g2a-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: calc(var(--g2-content-gap) - var(--g2-section-space) / 2) 0 0;
    padding: 0 0 calc(var(--g2-section-space) / 2);
    list-style: none;
}

.g2a-step {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--g2-line);
    border-radius: 12px;
    font-size: 13px;
    line-height: var(--g2-text-lh);
    color: var(--g2-text);
}

.g2a-step__number {
    flex: 0 0 auto;
    font-family: var(--g2-font-mono, ui-monospace, Consolas, monospace);
    font-size: 12px;
    font-weight: 700;
    color: var(--g2-brand);
}

@media (max-width: 767.98px) {
    .g2a-steps { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

/* ==========================================================================================================
   Shop by platform (Egypt's .hp tiles, home_platforms.css): eight tiles, the heading shown at every width
   ========================================================================================================== */
.g2a-home .hp { padding-inline: var(--g2-wrap-pad); padding-block: calc(var(--g2-section-space) / 2); }

.g2a-home .hp__title,
.g2a-home .hp__sub {
    position: static !important;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

.g2a-home .hp__title {
    font-size: var(--g2-title-size);
    font-weight: 700;
    line-height: 1.2;
    text-transform: none !important;
    color: var(--g2-text) !important;
}

.g2a-home .hp__sub { margin: var(--g2-sub-gap) 0 var(--g2-content-gap); font-size: 13.5px; line-height: var(--g2-text-lh); color: var(--g2-muted); }

.g2a-home .hp__wm { font-size: 28px; }

.g2a-home .hp__tile--xb { background: radial-gradient(70% 90% at 88% 20%, rgba(69, 193, 69, .3), transparent 60%), linear-gradient(165deg, #0e4d12, #06180a); }
.g2a-home .hp__tile--steam { background: radial-gradient(70% 90% at 88% 20%, rgba(102, 192, 244, .25), transparent 60%), linear-gradient(165deg, #1b2838, #0b1119); }
.g2a-home .hp__tile--apple { background: radial-gradient(70% 90% at 88% 20%, rgba(167, 176, 188, .25), transparent 60%), linear-gradient(165deg, #2a2f37, #111418); }
.g2a-home .hp__tile--xb .hp__cta { color: #8fe08f; }
.g2a-home .hp__tile--steam .hp__cta { color: #8fd0f5; }
.g2a-home .hp__tile--apple .hp__cta { color: #dfe3e8; }

@media (max-width: 575.98px) {
    .g2a-home .hp__wm { font-size: 22px; }
}

/* ==========================================================================================================
   SEO intro (Egypt's .g2-intro, with an H2 here: the hero holds the H1)
   ========================================================================================================== */
.g2a-home .g2a-intro { padding-block: calc(var(--g2-section-space) / 2) 0; }
