/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0f1c;
    --bg-secondary: #0f172a;
    --bg-card: rgba(17, 25, 40, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-primary: rgba(255, 255, 255, 0.12);
    --success: #10b981;
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --------------------------------------------- */
/* HEADER */
/* --------------------------------------------- */

.top-header {
    background: rgba(10, 15, 28, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.nav-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* BRAND */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-logo {
    width: 180px;
    height: auto;
}

.brand h1 {
    position: absolute;
    left: -9999px;
}

/* NAVIGATION */
.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.nav-item-active {
    color: var(--text-primary);
    background: var(--bg-glass);
}

/* BURGER */
.nav-toggle {
    display: none;
}

.nav-toggle-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-glass);
    border: 1px solid var(--border-primary);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* --------------------------------------------- */
/* MAIN */
/* --------------------------------------------- */

.page-main {
    padding: 2.5rem 1rem;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.container {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-top: 1rem;
    width: 100%;
}

/* HEADER CONTENT */
.header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

/* --------------------------------------------- */
/* SUGGESTED QUERIES */
/* --------------------------------------------- */

.suggested-queries {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
    margin-top: 0.75rem;
    padding: 0 1rem;
}

.suggested-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.suggested-pill {
    background: var(--bg-glass);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.suggested-pill:hover {
    background: rgba(59, 130, 246, 0.12);
    color: white;
    border-color: var(--accent-primary);
}

/* --------------------------------------------- */
/* SEARCH BOX */
/* --------------------------------------------- */

.search-box {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 2rem;
}

/* AI Glow */
.search-box:focus-within {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow:
        0 0 12px rgba(59, 130, 246, 0.25),
        0 0 28px rgba(59, 130, 246, 0.15),
        inset 0 0 4px rgba(59, 130, 246, 0.2);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.search-input {
    flex: 1;
    min-width: 250px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
}

.geo-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-sm);
    min-width: 180px;
}

/* Убираем внутреннюю рамку у инпута*/
.search-input,
.search-input:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.search-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    color: white;
    padding: 0.55rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

/* --------------------------------------------- */
/* RESULTS */
/* --------------------------------------------- */

.results {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    margin-top: 2rem;
    width: 100%;
    align-items: stretch; /* ← Это заставит все карточки растягиваться */
}

/* ================================
   SHOP CARD – CLEAN STRUCTURE
================================ */

/* Card wrapper */
.shop-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative; /* ← ДОБАВЬТЕ ЭТО */
    height: 100%; /* ← И ЭТО (важно для одинаковой высоты карточек) */
}

.shop-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* Inner layout */
.shop-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%; /* ← Это важно */
    gap: 1.1rem;
}


/* Header: logo + text */
.shop-header {
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
}

.shop-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 0.1rem;
}

.shop-footer {
    margin-top: auto; /* ← Это прижмет кнопку к низу */
}

/* ================================
   LOGO
================================ */

.shop-logo-large {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-primary);
}

.logo-image-large {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

/* fallback logo (for broken images) */
.logo-image-large[src*="placeholder.com"],
.logo-image-large:not([src]) {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: white;
}

/* ================================
   TITLE + CATEGORY
================================ */

.shop-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.shop-category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* external AI-match badge */
.external-badge,
.external-ai {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.5);
    font-size: 0.72rem;
    color: #bfdbfe;
}

/* ================================
   DESCRIPTION
================================ */

.shop-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    line-height: 1.4;
}

/* ================================
   KEYWORDS
================================ */

.keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.6rem 0 0.3rem;
}

.keyword-tag {
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

/* ================================
   ACTIONS (keywords + button)
================================ */

.shop-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex-grow: 1; /* ← Это займет всё доступное пространство */
}

/* CTA BUTTON – neutral */
.shop-link {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.9);
    color: #e2e8f0;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.84rem;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
    box-shadow: none;
}

.shop-link:hover {
    background: rgba(148, 163, 184, 0.2);
    border-color: rgba(226, 232, 240, 0.9);
    transform: translateY(-1px);
}

/* ================================
   NOTES
================================ */

.shop-notes {
    margin-top: 0.4rem;
}

.shop-notes small {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* --------------------------------------------- */
/* SKELETON LOADING */
/* --------------------------------------------- */

.skeleton {
    opacity: 0.7;
    animation: skeleton-loading 1s linear infinite alternate;
}

.skeleton-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: #243044;
}

.skeleton-text {
    height: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: #243044;
}

.skeleton-title {
    width: 60%;
    height: 14px;
}

.skeleton-category {
    width: 40%;
    height: 12px;
}

.skeleton-description {
    width: 90%;
    height: 12px;
}

.skeleton-keywords {
    width: 70%;
    height: 20px;
}

.skeleton-meta {
    width: 50%;
    height: 12px;
}

@keyframes skeleton-loading {
    0% { background-color: #243044; }
    100% { background-color: #3a475c; }
}

/* --------------------------------------------- */
/* FOOTER */
/* --------------------------------------------- */

.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-left p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

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

/* --------------------------------------------- */
/* HOME SECTIONS */
/* --------------------------------------------- */

.home-sections {
    margin-top: 1.5rem;
    margin-bottom: 1.75rem;
}

/* Cards grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.info-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.75rem;
}

/* Titles */
.info-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.9rem;
}

/* Steps (How it works) */
.info-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.info-steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.step-badge {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #bfdbfe;
}

.step-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.1rem;
}

.step-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Why Nexifind list */
.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.info-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.info-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-top: 0.4rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.8);
}

.info-list-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.1rem;
}

.info-list-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Affiliate bar */
.affiliate-bar {
    margin-top: 1.75rem;
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-primary);
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.affiliate-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    color: var(--text-secondary);
    opacity: 0.85;
}

/* --------------------------------------------- */
/* MOBILE */
/* --------------------------------------------- */

@media (max-width: 900px) {
    .results {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {

    .nav-toggle-btn {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: var(--bg-card);
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        border-bottom-left-radius: var(--radius-md);
        border-bottom-right-radius: var(--radius-md);
        border: 1px solid var(--border-primary);
    }

    .nav-toggle:checked ~ .nav-links {
        display: flex;
    }

    .page-main {
        padding: 2rem 1rem;
    }

    .container {
        padding: 2rem 1.5rem;
        margin: 0 0.5rem;
    }

    .results {
        grid-template-columns: 1fr;
    }

    .shop-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .shop-link {
        width: 100%;
        text-align: center;
    }

    .info-card {
        padding: 1.25rem 1.25rem;
    }

    .affiliate-bar {
        padding: 0.85rem 0.9rem;
    }
}

@media (max-width: 480px) {
    .brand-logo {
        width: 150px;
    }
    .header h2 {
        font-size: 1.7rem;
    }
}
