/* ==========================================================================
   DESIGN SYSTEM & VARIABLES (Flat Premium Theme - No Neon)
   ========================================================================== */
:root {
    /* Color Palette */
    --bg-main: #0e0f14;
    --bg-card: #171822;
    --bg-card-hover: #1f2130;
    --bg-header: #171822;
    --bg-input: #1f2130;
    --bg-input-focus: #26293c;
    --bg-modal: #171822;
    --bg-sidebar-active: rgba(255, 255, 255, 0.06);
    
    --border-main: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    
    --text-primary: #ffffff;
    --text-secondary: #8e92a4;
    --text-muted: #575a6c;
    
    /* Solid Unified Accent Colors */
    --accent-primary: #3b82f6; /* Modern Blue */
    --accent-hover: #2563eb;    /* Darker Blue */
    --accent-rose: #ef4444;     /* Red (Sale) */
    --accent-gold: #f59e0b;     /* Amber (Popular) */
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.4);
    
    /* Fonts */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

/* ==========================================================================
   RESET & GLOBAL STYLES (Enforce absolute no-overflow behavior)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input {
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    outline: none;
}

button {
    cursor: pointer;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* The page-level wrapper — NOT a scroll container itself */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    /* Top padding reserves space for the fixed header (height ~90px) */
    padding: 110px 48px 40px;
    gap: 28px;
    box-sizing: border-box;
}

/* ==========================================================================
   HEADER — Fixed to the top of the viewport at all times
   ========================================================================== */
.app-header {
    position: fixed;         /* Pinned to the viewport — never scrolls away */
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;            /* Above everything including the sidebar */
    background: rgba(23, 24, 34, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-main);
    padding: 16px 48px;      /* Match container side padding */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    box-sizing: border-box;
}

.header-logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 28px; /* Larger logo text */
    letter-spacing: 1px;
    color: var(--text-primary);
    user-select: none;
}

.logo-accent {
    color: var(--accent-primary);
}

.header-search {
    flex: 1;
    max-width: 600px; /* Wider search box */
}

.search-box {
    background: var(--bg-input);
    border: 1px solid var(--border-main);
    border-radius: 12px;
    padding: 12px 18px; /* Larger taller box */
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--accent-primary);
    background: var(--bg-input-focus);
}

.search-icon {
    width: 20px; /* Larger search icon */
    height: 20px;
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    font-size: 15px; /* Larger text */
    background: transparent;
    border: none;
    color: var(--text-primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.clear-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.clear-search-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px; /* Larger action icons spacing */
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 20px; /* Larger click target area */
    border-radius: 10px;
    font-size: 13px; /* Slightly larger text */
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: var(--transition-fast);
}

.action-icon {
    width: 22px; /* Larger action SVGs */
    height: 22px;
    stroke-width: 2;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: var(--border-main);
}

/* ==========================================================================
   MAIN CONTENT AREA
/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.app-content {
    display: block;
    /* No grid needed — sidebar is position:fixed (out of flow) */
}

.catalog-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    width: 100%;
}

/* Sidebar — STICKY: scroll-linked on the left, stops at footer */
.app-sidebar {
    position: sticky;
    top: 125px;               /* Pinned below header (110px) + spacing */
    z-index: 90;
    width: 260px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    scrollbar-width: none;
    align-self: start;
}

.app-sidebar::-webkit-scrollbar { display: none; }

/* Push main content to the right to avoid sidebar overlap */
.app-main-view {
    margin-left: 0;
    flex: 1;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px; /* Taller, larger buttons */
    width: 100%;
    border-radius: 12px;
    font-size: 15px; /* Larger text */
    font-weight: 600;
    text-align: left;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    transition: var(--transition-fast);
}

.nav-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.nav-icon-wrapper svg {
    width: 22px; /* Scaled up navigation SVGs */
    height: 22px;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background: var(--bg-sidebar-active);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.nav-item.active .nav-icon-wrapper {
    color: var(--accent-primary);
}

/* Main Cards View */
.app-main-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-main);
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 24px; /* Larger category title */
}

.results-count {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* Game Cards Grid (4 columns spanning full screen = massive cards) */
.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px; /* Wider spacing */
    width: 100%;
}

.grid-loader {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    color: var(--text-secondary);
    gap: 12px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-main);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Game Card (Much Larger dimensions) */
.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 16px; /* Larger rounded corners */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
}

.game-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
}

.card-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    transition: transform 0.4s ease;
}

.game-card:hover .card-image-wrapper img {
    transform: scale(1.04);
}

.region-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 4px 8px; /* Larger badge */
    border-radius: 6px;
    font-size: 12px; /* Larger text */
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.card-info {
    padding: 20px; /* Increased internal padding */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 10px;
}

.card-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px; /* Scaled up card title */
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 13px; /* Scaled up description text */
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: auto; /* Push the footer downward */
}

/* Card Price Footer */
.card-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-price {
    font-family: var(--font-heading);
    font-size: 16px; /* Scaled up card price display */
    font-weight: 700;
    color: var(--accent-primary);
}

/* Sale/Popular Badges */
.sale-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent-rose);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 2;
}

.popular-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent-gold);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 2;
}

/* ==========================================================================
   FOOTER SECTION
   ========================================================================== */
.app-footer {
    background: var(--bg-header);
    border: 1px solid var(--border-main);
    border-radius: 16px;
    padding: 48px; /* Taller footer spacing */
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer-col h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Payment badges styling (Taller & Wider badges) */
.payment-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.payment-badge {
    background: var(--bg-input);
    border: 1px solid var(--border-main);
    border-radius: 8px;
    padding: 8px 20px; /* Larger badge padding */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 110px; /* Wider */
    height: 42px; /* Taller */
    transition: var(--transition-fast);
}

.payment-badge:hover {
    background: var(--bg-input-focus);
    border-color: rgba(255, 255, 255, 0.12);
}

.badge-text {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Info links */
.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-link {
    color: var(--text-secondary);
    transition: var(--transition-fast);
    font-size: 14px; /* Larger links */
}

.footer-link:hover {
    color: var(--text-primary);
    transform: translateX(4px);
}

/* Social links (Uniform circles - Bigger) */
.social-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.social-btn {
    width: 44px; /* Larger diameter */
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border-main);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.social-btn svg {
    width: 22px; /* Larger SVGs */
    height: 22px;
}

.social-btn:hover {
    color: #fff;
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

/* Footer bottom */
.footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-main);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ==========================================================================
   TOP-UP MODAL DIALOG (Flat styling, no glows)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: var(--bg-modal);
    border: 1px solid var(--border-main);
    border-radius: 20px; /* Larger border radius */
    width: 90%;
    max-width: 900px; /* Wider modal container */
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal-overlay.open .modal-container {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-main);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.modal-body {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 520px;
}

/* Left: Game info panel */
.modal-game-info {
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border-main);
    padding: 32px; /* Larger padding */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-game-image-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    padding-top: 125%;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-game-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-game-region-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.modal-game-info h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.modal-game-info p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

/* Right: Form purchase panel */
.modal-form-container {
    padding: 32px;
    overflow-y: auto;
    max-height: 85vh;
}

.form-section {
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-label {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

/* Input Styles */
.form-section input[type="text"] {
    background: var(--bg-input);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    padding: 12px 16px;
    color: #fff;
    font-size: 15px;
    transition: var(--transition-fast);
}

.form-section input[type="text"]:focus {
    border-color: var(--accent-primary);
    background: var(--bg-input-focus);
}

.input-helper {
    color: var(--text-muted);
    font-size: 12px;
}

/* Package Grid / Tiles (Larger) */
.package-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.package-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    padding: 16px; /* Larger tiles padding */
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: var(--transition-fast);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.package-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

.package-card.active {
    background: rgba(59, 130, 246, 0.06);
    border-color: var(--accent-primary);
}

.package-amount {
    font-weight: 700;
    font-size: 16px; /* Larger text */
    color: var(--text-primary);
}

.package-price {
    font-size: 14px; /* Larger text */
    font-weight: 600;
    color: var(--accent-primary);
}

.package-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent-rose);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-bottom-left-radius: 6px;
}

/* Payment Selector (Bigger targets) */
.payment-selector-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.payment-option {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    padding: 14px 18px; /* Taller target elements */
    cursor: pointer;
    transition: var(--transition-fast);
    gap: 16px;
}

.payment-option:hover {
    background: rgba(255, 255, 255, 0.04);
}

.payment-option.active {
    background: rgba(59, 130, 246, 0.04);
    border-color: var(--accent-primary);
}

.payment-option input[type="radio"] {
    accent-color: var(--accent-primary);
    width: 18px;
    height: 18px;
}

.payment-option-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.payment-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.payment-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Form Summary & Purchase Button (Bigger) */
.form-summary {
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-main);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.summary-val {
    color: var(--text-primary);
    font-weight: 600;
}

.total-row {
    border-top: 1px solid var(--border-main);
    padding-top: 12px;
    font-size: 14px;
    color: var(--text-primary);
}

.summary-price {
    font-size: 20px; /* Scaled up price */
    font-weight: 800;
    color: var(--accent-primary);
    font-family: var(--font-heading);
}

.submit-btn {
    background: var(--accent-primary);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 16px; /* Scaled up checkout button text */
    font-weight: 700;
    padding: 14px 24px; /* Larger vertical sizing */
    border-radius: 12px;
    text-align: center;
    width: 100%;
    transition: var(--transition-fast);
}

.submit-btn:hover {
    background: var(--accent-hover);
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.toast {
    background: #1c1d29;
    border: 1px solid var(--border-hover);
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    padding: 16px 20px;
    color: #fff;
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(15px);
    opacity: 0;
    animation: slideIn 0.25s forwards ease-out;
}

@keyframes slideIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast.fade-out {
    animation: fadeOut 0.3s forwards;
}

@keyframes fadeOut {
    to {
        transform: translateY(-8px);
        opacity: 0;
    }
}

.toast-icon {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
}

.toast-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */

/* Large desktop: 3 columns when screen narrows */
@media (max-width: 1400px) {
    .app-container { padding: 110px 32px 40px; }
    .app-header { padding: 16px 32px; }
    /* Sidebar shifts left to match new container padding */
    .app-sidebar { left: 32px; }
    /* Main view margin = sidebar(260) + gap(32) = 292 (unchanged) */
    .game-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

/* Standard tablet landscape / small desktop */
@media (max-width: 1100px) {
    .app-container { padding: 96px 24px 32px; gap: 20px; }
    .app-header { padding: 14px 24px; }
    .catalog-wrapper { gap: 20px; }
    .app-sidebar { width: 210px; max-height: calc(100vh - 130px); }
    /* Main view margin = sidebar(210) + gap(20) = 230px */
    .app-main-view { margin-left: 0; }
    .game-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
    .footer-grid { grid-template-columns: 1.5fr 1fr; gap: 28px; }
    .payments-col { grid-column: 1 / -1; }
}

/* Tablet portrait: sidebar collapses to horizontal sticky nav */
@media (max-width: 860px) {
    .app-container { padding: 80px 20px 28px; gap: 0; }
    .app-header { padding: 12px 20px; gap: 16px; }

    .catalog-wrapper {
        flex-direction: column;
        gap: 0;
    }
    /* Main view gets its margin reset — sidebar is no longer on the left */
    .app-main-view { margin-left: 0; }

    /* Sidebar reverts to sticky horizontal strip across the top */
    .app-sidebar {
        position: sticky;
        left: auto;
        top: 58px;
        transform: none;
        width: 100%;
        z-index: 150;
        max-height: none;
        overflow-y: visible;
        background: var(--bg-main);
        border-bottom: 1px solid var(--border-main);
        padding: 8px 0 10px;
        margin-bottom: 20px;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .sidebar-nav::-webkit-scrollbar { display: none; }

    .nav-item {
        flex-shrink: 0;
        width: auto;
        padding: 10px 16px;
        font-size: 14px;
        transform: none !important;
    }

    .game-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }

    .modal-body { grid-template-columns: 1fr; min-height: auto; }
    .modal-game-info {
        border-right: none;
        border-bottom: 1px solid var(--border-main);
        padding: 20px;
        flex-direction: row;
        align-items: center;
        gap: 16px;
    }
    .modal-game-image-wrapper { width: 80px; padding-top: 100px; flex-shrink: 0; }
    .modal-game-info h2 { font-size: 20px; }
    .modal-game-info p { display: none; }
    .modal-form-container { padding: 20px; }
}

/* Hide button text labels at tablet size to make room for search */
@media (max-width: 768px) {
    .action-btn span { display: none; }
    .action-btn { padding: 12px; }
}

/* Mobile landscape / large phone */
@media (max-width: 680px) {
    .game-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .card-title { font-size: 16px; }
    .card-desc { display: none; } /* Hide description to keep cards compact */
    .modal-game-info { padding: 14px 16px; gap: 12px; }
    .modal-game-image-wrapper { width: 60px; padding-top: 75px; }
    .modal-game-info h2 { font-size: 17px; }
}

/* Mobile portrait: header wraps, search on its own row */
@media (max-width: 600px) {
    .app-header {
        flex-wrap: wrap;
        padding: 10px 16px;
        gap: 10px;
    }

    .header-logo { font-size: 22px; order: 1; }
    .header-actions { order: 2; gap: 6px; }

    .header-search {
        order: 3;
        width: 100%;
        max-width: 100%;
    }

    .search-box { padding: 10px 14px; }

    /* Wrapped header becomes taller (~120px) — push content down accordingly */
    .app-container { padding: 128px 16px 24px; }
    .app-sidebar { top: 118px; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
    .payments-col { grid-column: 1 / -1; }
}

/* Small mobile */
@media (max-width: 420px) {
    .app-container { padding: 138px 10px 24px; gap: 10px; }
    .action-btn { padding: 8px; }

    .game-grid { grid-template-columns: 1fr; gap: 12px; }
    .card-info { padding: 14px; }
    .card-desc { display: none; }

    .app-sidebar { top: 128px; }

    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .footer-col h3 { margin-bottom: 10px; }
    .package-grid { grid-template-columns: 1fr; }

    .modal-container { width: 100%; border-radius: 16px 16px 0 0; align-self: flex-end; }
    .modal-overlay { align-items: flex-end; }
}

/* ==========================================================================
   PRODUCT PAGE PREMIUM REDESIGN (Kupikod / Steam / Epic Games hybrid style)
   ========================================================================== */

.product-page-container {
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--text-secondary);
}

.breadcrumbs a {
    transition: var(--transition-fast);
}

.breadcrumbs a:hover {
    color: var(--text-primary);
}

.breadcrumbs .active-crumb {
    color: var(--text-muted);
}

/* Product Grid Layout */
.product-grid-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 32px;
    align-items: start;
    width: 100%;
}

/* Left Column: Info */
.product-info-column {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Product Hero Card */
.product-hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-hero-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.product-hero-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-region-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    backdrop-filter: blur(4px);
}

.product-hero-details {
    padding: 28px;
    border-top: 1px solid var(--border-main);
}

.product-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.2;
}

.product-meta-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-tag {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

.category-tag {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-primary);
}

.region-tag {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-main);
}

/* Advantages */
.advantages-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.advantage-item {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.advantage-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.advantage-text h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.advantage-text p {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Sections description */
.details-section {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 20px;
    padding: 28px;
}

.section-heading {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.details-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.details-content p {
    margin-bottom: 12px;
}

.details-content p:last-child {
    margin-bottom: 0;
}

/* Guide content */
.guide-content ol {
    padding-left: 20px;
}

.guide-content li {
    margin-bottom: 12px;
}

.guide-content li:last-child {
    margin-bottom: 0;
}

.guide-alert {
    margin-top: 16px;
    padding: 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.guide-alert.warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* Right Column: Sticky Purchase Widget */
.product-purchase-column {
    position: sticky;
    top: 125px; /* Stay fixed under header */
    z-index: 80;
}

.sticky-purchase-card {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 20px;
    padding: 28px;
}

.widget-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-main);
    padding-bottom: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.group-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    background: var(--bg-input);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    transition: var(--transition-fast);
    width: 100%;
}

.form-input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-input-focus);
}

.error-text {
    font-size: 12px;
    color: var(--accent-rose);
    margin-top: 2px;
}

/* Denomination selection styled vertical */
.denom-grid-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.denom-card-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.denom-card-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

.denom-card-row.selected {
    background: rgba(59, 130, 246, 0.06);
    border-color: var(--accent-primary);
}

.denom-info-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.denom-icon {
    font-size: 16px;
}

.denom-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.denom-info-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.denom-badge-tag {
    background: var(--accent-rose);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.denom-price-tag {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary);
}

.denom-card-row.selected .denom-price-tag {
    color: var(--text-primary);
}

/* Payment cards selection list */
.payment-cards-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.payment-card-item {
    cursor: pointer;
    width: 100%;
}

.hidden-radio {
    display: none;
}

.payment-card-body {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-fast);
}

.payment-card-item:hover .payment-card-body {
    background: rgba(255, 255, 255, 0.04);
}

.payment-card-item.checked .payment-card-body {
    background: rgba(59, 130, 246, 0.06);
    border-color: var(--accent-primary);
}

.payment-card-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.payment-card-details {
    display: flex;
    flex-direction: column;
}

.payment-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.payment-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Checkout summary and submit */
.purchase-summary-box {
    margin-top: 24px;
    border-top: 1px solid var(--border-main);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.summary-value-price {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--accent-primary);
}

.checkout-submit-btn {
    background: var(--accent-primary);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    padding: 14px 20px;
    border-radius: 12px;
    text-align: center;
    width: 100%;
    transition: var(--transition-fast);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.checkout-submit-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.checkout-submit-btn:active {
    transform: translateY(0);
}

.checkout-submit-btn:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
}

.form-error-box {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    padding: 12px;
    color: var(--accent-rose);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Responsive Adaptive design for Product Page */

@media (max-width: 1100px) {
    .product-title {
        font-size: 24px;
    }
}

@media (max-width: 960px) {
    .product-grid-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .product-purchase-column {
        position: static;
    }
    
    .sticky-purchase-card {
        max-height: none;
    }
}

@media (max-width: 680px) {
    .advantages-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .product-title {
        font-size: 20px;
    }
    
    .details-section {
        padding: 20px;
    }
    
    .sticky-purchase-card {
        padding: 20px;
    }
}

/* Screenshots Gallery under Hero card */
.product-screenshots-gallery {
    padding: 20px 28px 0;
    border-top: 1px solid var(--border-main);
}

.screenshots-thumb-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.screenshot-thumb-item {
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-fast);
}

.screenshot-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.screenshot-thumb-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

.screenshot-thumb-item.active {
    border-color: var(--accent-primary);
}

@media (max-width: 680px) {
    .screenshots-thumb-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .product-screenshots-gallery {
        padding: 16px 20px 0;
    }
}

/* Steam Top-Up Widget Custom Styles */
.submit-pay-btn:hover {
    background: var(--accent-hover) !important;
}
.currency-selector select option {
    background: #1f2130;
    color: #ffffff;
}

.currency-pill-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-main);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.currency-pill-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}
.currency-pill-btn.active {
    border-color: var(--accent-primary) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}
.currency-pill-btn .flag {
    font-size: 18px;
}


