/* ===== VARIABLES ===== */
:root {
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-primary-light: #818cf8;
    --color-accent: #22d3ee;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    
    --color-text: #111827;
    --color-text-muted: #6b7280;
    --color-text-light: #9ca3af;
    
    --color-bg: #f8fafc;
    --color-bg-card: #ffffff;
    --color-bg-gray: #f1f5f9;
    
    --color-border: #e2e8f0;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    
    --radius: 16px;
    --radius-lg: 24px;
    
    --transition: all 0.2s ease;
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

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

img { max-width: 100%; display: block; }

/* ===== HEADER ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo__icon {
    font-size: 1.5rem;
}

.logo--footer { color: white; }

.nav {
    display: flex;
    gap: 24px;
}

.nav__link {
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav__link:hover {
    color: var(--color-primary);
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #22d3ee 100%);
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top, rgba(255,255,255,0.15), transparent 70%);
    pointer-events: none;
}

.hero__content {
    position: relative;
    z-index: 1;
}

.hero__title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    color: white;
}

.hero__title .highlight {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 520px;
    margin: 0 auto 32px;
}

/* Search Form */
.search-form {
    display: flex;
    gap: 12px;
    max-width: 560px;
    margin: 0 auto 24px;
}

.search-form input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: white;
    transition: var(--transition);
}

.search-form input:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 28px;
    background: var(--color-text);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.search-btn__icon { font-size: 1.1rem; }

/* Badges */
.hero__badges {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.badge {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

/* ===== SECTIONS ===== */
.section { padding: 60px 0; }
.section--gray { background: var(--color-bg-gray); }
.section--results { padding-top: 20px; }

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
}

/* ===== TAGS (Popular) ===== */
.tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.tag {
    padding: 10px 20px;
    background: var(--color-bg-card);
    border: 2px solid var(--color-border);
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.tag:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== RESULTS HEADER ===== */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-count {
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ===== PRODUCTS GRID ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ===== PRODUCT CARD ===== */
.product-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--color-primary-light);
}

.product-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.store-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.store-badge--kupikod { background: #dbeafe; color: #1e40af; }
.store-badge--ggsel { background: #dcfce7; color: #166534; }
.store-badge--gamepark { background: #fef3c7; color: #92400e; }
.store-badge--gabestore { background: #f3e8ff; color: #6b21a8; }

.best-badge {
    background: linear-gradient(135deg, var(--color-success), #059669);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.product-card__name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.4;
    flex-grow: 1;
}

.product-card__price-block {
    margin-bottom: 20px;
}

.price-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-success);
    letter-spacing: -0.02em;
}

.buy-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
    text-align: center;
}

.buy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
}

.product-card__note {
    margin-top: 16px;
    color: var(--color-text-light);
    font-size: 0.8rem;
    text-align: center;
}

/* ===== STEP CARDS ===== */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.step-card {
    background: var(--color-bg-card);
    padding: 32px 24px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.step-card__number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0 auto 20px;
}

.step-card h3 {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.step-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ===== FOOTER ===== */
.footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 48px 0 0;
}

.footer__inner {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #1e293b;
}

.footer__brand .logo { margin-bottom: 12px; }

.footer__desc {
    font-size: 0.95rem;
    opacity: 0.8;
}

.footer__links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.footer__col h4 {
    color: white;
    font-weight: 600;
    margin-bottom: 16px;
    font-size: 1rem;
}

.footer__col a {
    display: block;
    padding: 4px 0;
    opacity: 0.8;
    transition: var(--transition);
    font-size: 0.95rem;
}

.footer__col a:hover {
    opacity: 1;
    color: white;
}

.footer__bottom {
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
}

.footer__disclaimer {
    margin-top: 8px;
    opacity: 0.6;
    font-size: 0.85rem;
}

/* ===== SEARCH LOADER ===== */
.search-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px 20px;
    margin-top: 20px;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader-text {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Анимация появления результатов */
.products-grid {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header__inner {
        flex-direction: column;
        gap: 16px;
        padding: 14px 20px;
    }
    
    .hero { padding: 60px 0 40px; }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-form input,
    .search-btn {
        width: 100%;
    }
    
    .hero__badges {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .footer__inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer__links {
        justify-content: center;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .section-title { font-size: 1.5rem; }
    
    .tags-grid {
        flex-direction: column;
        align-items: center;
    }
    
    .tag { width: 100%; text-align: center; }
    
    .price-value { font-size: 1.75rem; }
}