/* ============================================================
   Ops Game Studio — Epic Games Store-inspired Stylesheet
   Dark, minimal, immersive gaming storefront
   ============================================================ */

:root {
    --bg: #121212;
    --bg-card: #1a1a1a;
    --bg-card-hover: #242424;
    --bg-nav: #18181a;
    --bg-badge: #2a2a2a;
    --text: #e8e8e8;
    --text-muted: #a0a0a0;
    --text-dim: #6a6a6a;
    --border: #2a2a2a;
    --border-light: #363636;
    --accent: #0078f2;         /* Epic blue */
    --accent-hover: #0066d6;
    --free-bg: #0078f2;
    --discount: #f2c94c;
    --discount-text: #121212;
    --wishlist: #ef4444;
    --radius: 4px;
    --radius-lg: 12px;
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: min(1360px, 94%);
    margin-inline: auto;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ===== NAVIGATION BAR (Epic-style top nav) ===== */
.navbar {
    background: var(--bg-nav);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
    backdrop-filter: blur(12px);
}
.navbar-inner {
    display: flex;
    align-items: center;
    height: 56px;
    gap: 18px;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    font-weight: 700;
    font-size: .95rem;
    color: #fff;
    letter-spacing: -.01em;
}
.nav-logo-icon {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    background: #000;
    color: #fff;
    font-weight: 800;
    font-size: .75rem;
    border-radius: 4px;
}

/* Nav links */
.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}
.nav-link {
    padding: 8px 14px;
    border-radius: 4px;
    font-size: .84rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color .15s, background .15s;
    white-space: nowrap;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-link.active { color: #fff; }

/* Search in nav */
.nav-search {
    flex: 1;
    max-width: 320px;
    margin-left: auto;
    position: relative;
}
.nav-search input {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 8px 16px 8px 38px;
    font-size: .84rem;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: background .2s, border-color .2s;
}
.nav-search input::placeholder { color: var(--text-dim); }
.nav-search input:focus {
    background: #333;
    border-color: #555;
}
.nav-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-dim);
}

/* Nav actions */
.nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}
.nav-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 4px;
    color: var(--text-muted);
    transition: color .15s, background .15s;
    position: relative;
    display: grid;
    place-items: center;
}
.nav-btn:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-cart-count {
    position: absolute;
    top: 2px; right: 2px;
    min-width: 17px; height: 17px;
    background: var(--accent);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    border-radius: 50%;
    display: none;
    place-items: center;
    padding: 0 3px;
}

/* ===== MOBILE NAV TOGGLE ===== */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 6px;
    color: var(--text);
    cursor: pointer;
}

/* ===== HERO CAROUSEL ===== */
.hero {
    position: relative;
    background: #0a0a0a;
    overflow: hidden;
    padding: 32px 0 20px;
}
.hero-slider {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 8px;
}
.hero-slider::-webkit-scrollbar { display: none; }

.hero-slide {
    flex: 0 0 min(85vw, 1100px);
    scroll-snap-align: start;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 280px;
    cursor: pointer;
    background: #1a1a1a;
}
.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}
.hero-slide:hover img { transform: scale(1.03); }

.hero-slide-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 40px 32px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85) 40%, rgba(0,0,0,0.95));
    pointer-events: none;
}
.hero-slide-info h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: -.02em;
}
.hero-slide-info p {
    font-size: .9rem;
    color: var(--text-muted);
    max-width: 500px;
}

.hero-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}
.hero-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #444;
    border: none;
    transition: background .2s, transform .2s;
}
.hero-dot.active { background: #fff; transform: scale(1.2); }

/* ===== SECTION HEADERS ===== */
.section {
    padding: 40px 0;
}
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
}
.section-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.01em;
}
.section-header a {
    font-size: .82rem;
    color: var(--accent);
    font-weight: 500;
    transition: color .15s;
}
.section-header a:hover { color: #4da3ff; }

/* ===== GAME CARD GRID (EGS-style horizontal cards) ===== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Main game card */
.game-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s, background .2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.game-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.game-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #111;
}
.game-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.game-card:hover .game-card-media img { transform: scale(1.04); }

/* Wishlist button */
.game-card-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: .85rem;
    display: grid;
    place-items: center;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .2s, transform .2s, background .2s;
    z-index: 2;
    backdrop-filter: blur(6px);
}
.game-card:hover .game-card-wishlist { opacity: 1; transform: translateY(0); }
.game-card-wishlist:hover { background: rgba(0,0,0,0.8); }
.game-card-wishlist.wished { color: var(--wishlist); }

/* Badge */
.game-card-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: .7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
    z-index: 2;
}
.badge-free { background: var(--free-bg); color: #fff; }
.badge-discount { background: var(--discount); color: var(--discount-text); }
.badge-new { background: #444; color: #fff; }
.badge-hot { background: #e74c3c; color: #fff; }

/* Card body */
.game-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.game-card-title {
    font-size: .9rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.game-card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: .74rem;
    color: var(--text-dim);
}
.game-card-tags span {
    background: var(--bg-badge);
    padding: 2px 8px;
    border-radius: 4px;
}
.game-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Price */
.game-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.price-original {
    font-size: .78rem;
    color: var(--text-dim);
    text-decoration: line-through;
}
.price-current {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}
.price-free {
    font-size: .9rem;
    font-weight: 700;
    color: #4dff4d;
}
.game-card-cta {
    font-size: .78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 4px;
    border: none;
    transition: background .15s;
}
.cta-buy {
    background: var(--accent);
    color: #fff;
}
.cta-buy:hover { background: var(--accent-hover); }
.cta-free {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.cta-free:hover { background: rgba(255,255,255,0.18); }

.empty-msg {
    text-align: center;
    color: var(--text-dim);
    padding: 56px 0;
    font-size: 1rem;
    grid-column: 1 / -1;
}

/* ===== FEATURED ROW (wide horizontal scroll) ===== */
.featured-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.featured-row::-webkit-scrollbar { display: none; }
.featured-card {
    flex: 0 0 210px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.featured-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.featured-card-media {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #111;
}
.featured-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.featured-card:hover .featured-card-media img { transform: scale(1.05); }
.featured-card-body {
    padding: 10px 12px 12px;
}
.featured-card-title {
    font-size: .82rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}
.featured-card-price {
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
}

/* ===== ADVANTAGES / FEATURES ===== */
.advantages {
    background: #181818;
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 48px 0;
}
.adv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.adv-card {
    background: #1e1e1e;
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    transition: background .2s;
}
.adv-card:hover { background: #252525; }
.adv-icon { font-size: 1.8rem; display: block; margin-bottom: 12px; }
.adv-card h3 { font-size: .95rem; font-weight: 600; margin-bottom: 6px; color: #fff; }
.adv-card p { font-size: .82rem; color: var(--text-muted); line-height: 1.5; }

/* ===== HOW TO BUY ===== */
.how-to { padding: 48px 0; }
.steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
.steps li {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    transition: border-color .2s;
}
.steps li:hover { border-color: rgba(255,255,255,0.12); }
.steps li span {
    display: inline-grid;
    place-items: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 12px;
}
.steps h3 { font-size: .92rem; font-weight: 600; margin-bottom: 4px; color: #fff; }
.steps p { font-size: .8rem; color: var(--text-muted); }

/* ===== FOOTER ===== */
.footer {
    background: #0a0a0a;
    color: var(--text-dim);
    padding-top: 48px;
    font-size: .84rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 36px;
    padding-bottom: 40px;
}
.footer-logo { margin-bottom: 12px; }
.footer-logo .logo-text { color: #fff; font-weight: 700; font-size: 1.1rem; }
.footer-logo .logo-text small { display: block; font-weight: 400; font-size: .7rem; color: var(--text-muted); margin-top: 2px; }
.footer-col h4 {
    color: #fff;
    font-size: .88rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.footer-col ul { list-style: none; display: grid; gap: 7px; }
.footer-col a {
    color: var(--text-dim);
    transition: color .15s;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 16px 0;
    text-align: center;
    font-size: .78rem;
    color: var(--text-dim);
}
.footer-legal-links { display: inline-block; margin-left: 10px; }
.footer-legal-links a { color: var(--text-dim); transition: color .15s; }
.footer-legal-links a:hover { color: #fff; }
.footer-sep { margin: 0 8px; color: #3a3a3a; }

/* ===== CART DRAWER ===== */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s;
    z-index: 200;
}
.cart-overlay.open { opacity: 1; visibility: visible; }

.cart-drawer {
    position: fixed;
    top: 0; right: 0;
    height: 100dvh;
    width: min(400px, 100%);
    background: var(--bg-card);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform .28s ease;
    box-shadow: -4px 0 30px rgba(0,0,0,0.7);
    border-left: 1px solid var(--border);
}
.cart-drawer.open { transform: translateX(0); }

.cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.cart-head h3 { font-size: 1rem; color: #fff; font-weight: 600; }
.cart-close {
    border: none;
    background: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: color .15s;
    padding: 4px;
}
.cart-close:hover { color: #fff; }

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cart-empty {
    margin: auto;
    text-align: center;
    color: var(--text-dim);
    font-size: .88rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    align-items: center;
    background: #202020;
    border-radius: 8px;
    padding: 10px;
}
.cart-item-thumb {
    width: 48px; height: 48px;
    border-radius: 4px;
    overflow: hidden;
    background: #111;
}
.cart-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.thumb-fallback {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    font-size: 1.2rem;
}
.cart-item-info h4 { font-size: .82rem; color: #fff; line-height: 1.3; font-weight: 500; }
.cart-item-info .price { font-size: .82rem; font-weight: 700; color: #fff; }
.cart-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #444;
    border-radius: 4px;
}
.qty-control button {
    border: none;
    background: none;
    width: 26px; height: 26px;
    font-weight: 600;
    font-size: .9rem;
    color: var(--text-muted);
    transition: color .15s, background .15s;
}
.qty-control button:hover { color: #fff; background: rgba(255,255,255,0.05); }
.qty-control .qty { min-width: 28px; text-align: center; font-size: .82rem; font-weight: 600; }
.remove-item {
    border: none;
    background: none;
    font-size: .7rem;
    color: #888;
    transition: color .15s;
}
.remove-item:hover { color: #e74c3c; }

.cart-foot {
    border-top: 1px solid var(--border);
    padding: 18px 20px 22px;
    display: grid;
    gap: 10px;
}
.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: .92rem;
    color: #fff;
}
.cart-total-row strong { font-size: 1.15rem; }
.cart-note { font-size: .7rem; color: var(--text-dim); }
.cart-foot .btn {
    width: 100%;
    text-align: center;
    padding: 11px;
    border-radius: 4px;
    font-weight: 600;
    font-size: .84rem;
    border: none;
    transition: background .15s;
}
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost { background: #2a2a2a; color: #fff; }
.btn-ghost:hover { background: #333; }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translate(-50%, 100px);
    background: #333;
    color: #fff;
    padding: 12px 22px;
    border-radius: 8px;
    font-size: .84rem;
    font-weight: 500;
    opacity: 0;
    transition: transform .3s, opacity .3s;
    z-index: 300;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    max-width: 90%;
    text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ===== LEGAL PAGES ===== */
.legal-page { padding: 48px 0 60px; min-height: 60vh; }
.legal-content {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
    padding: 44px 48px;
    max-width: 820px;
    margin: 0 auto;
}
.legal-content h1 {
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.legal-update {
    font-size: .78rem;
    color: var(--text-dim);
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.legal-content h2 {
    font-size: 1.1rem; font-weight: 600;
    color: #fff;
    margin-top: 30px; margin-bottom: 10px;
}
.legal-content h3 {
    font-size: .95rem; font-weight: 500;
    color: var(--text-muted);
    margin-top: 16px; margin-bottom: 6px;
}
.legal-content p {
    margin-bottom: 10px;
    line-height: 1.65;
    color: var(--text-muted);
}
.legal-content ul {
    margin-bottom: 12px; padding-left: 20px;
    display: grid; gap: 5px;
}
.legal-content ul li { line-height: 1.55; color: var(--text-muted); }
.legal-content a { color: var(--accent); font-weight: 500; }
.legal-content a:hover { text-decoration: underline; }
.cat-link {
    background-color: #272729;
    &:hover {
        background-color: #bfc0fa;
    }
}
.cat-link.active {
    background-color: #bfc0fa;
}
/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
@media (max-width: 680px) {
    .nav-links { display: none; }
    .nav-toggle { display: grid; }
    .nav-search { max-width: 200px; }
    .hero-slide { min-height: 180px; }
    .hero-slide-info { padding: 30px 20px 20px; }
    .hero-slide-info h2 { font-size: 1.1rem; }
    .hero-slide-info p { font-size: .78rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .game-grid { grid-template-columns: 1fr; }
    .section-header { flex-direction: column; gap: 4px; }
    .legal-content { padding: 24px 20px; }
}
