:root {
    --bg: #0a0a0a;
    --bg-card: #111111;
    --bg-card-hover: #161616;
    --border: #222222;
    --border-light: #2a2a2a;
    --text: #ffffff;
    --text-muted: #9ca3af;
    --accent: #ff6b00;
    --accent-hover: #e65c00;
    --radius-sm: 10px;
    --radius: 18px;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

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

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.03em;
}

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

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

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background-color 0.15s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
    background-color: rgba(255, 107, 0, 0.12);
}

/* Hero */
.hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 0 64px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 50%, rgba(255, 107, 0, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 70% 30%, rgba(255, 107, 0, 0.08) 0%, transparent 35%),
        linear-gradient(180deg, rgba(17, 17, 17, 0) 0%, var(--bg) 100%),
        var(--bg);
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(180deg, transparent 0%, var(--bg) 100%);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.section-tag {
    display: inline-block;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 20px;
    letter-spacing: -0.03em;
}

.hero-accent {
    color: var(--accent);
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin: 0 auto 36px;
    max-width: 620px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 54px;
    padding: 0 32px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--text);
    box-shadow: 0 8px 24px rgba(255, 107, 0, 0.35);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 107, 0, 0.45);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent);
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-dark {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.card {
    display: block;
    padding: 36px;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
    text-align: left;
}

.card:hover {
    transform: translateY(-6px);
    background-color: var(--bg-card-hover);
    border-color: var(--border-light);
}

.card-icon {
    font-size: 2.25rem;
    margin-bottom: 20px;
}

.card-img-wrapper {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #ffffff;
    transition: transform 0.4s;
}

.card:hover .card-img {
    transform: scale(1.03);
}

.card-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.card-text {
    color: var(--text-muted);
    margin: 0 0 24px;
    font-size: 1rem;
    line-height: 1.6;
}

.card-link {
    color: var(--accent);
    font-weight: 700;
    font-size: 1rem;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
}

.stat {
    text-align: center;
    padding: 24px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* CTA */
.cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 40px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.cta-content {
    max-width: 560px;
}

.cta-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 10px;
}

.cta-text {
    color: var(--text-muted);
    margin: 0;
}

/* Search page */
.search-section {
    padding: 48px 0 80px;
    text-align: center;
}

.search-section .page-title {
    text-align: center;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 28px;
    letter-spacing: -0.02em;
}

.filter-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 32px;
    margin: 0 auto 32px;
}

.size-form,
.car-form {
    display: flex;
    flex-direction: column;
    gap: 28px;
    max-width: 680px;
    margin: 0 auto;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-label {
    font-weight: 700;
    font-size: 1rem;
}

.label-muted {
    color: var(--text-muted);
    font-weight: 400;
}

.selects-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.select-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 120px;
}

.select-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
}

.input {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 44px;
}

.input:hover {
    border-color: var(--border-light);
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15);
}

.input option {
    background: var(--bg-card);
    color: var(--text);
}

.input.small {
    width: auto;
    min-width: 110px;
    text-align: left;
}

.input-sep {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1.1rem;
    padding-bottom: 14px;
}

/* Results */
.results-meta {
    margin: 0 0 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.result-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 26px;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: transform 0.15s, border-color 0.15s;
}

.result-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.result-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.result-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 3px;
}

.result-years {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.result-kinds {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.kind-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.kind-factory {
    background-color: rgba(255, 107, 0, 0.15);
    color: var(--accent);
}

.kind-replace {
    background-color: var(--border);
    color: var(--text);
}

.kind-tuning {
    background-color: var(--text);
    color: var(--bg);
}

/* Car header */
.car-header {
    margin-bottom: 24px;
    padding: 28px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.car-title {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0 0 6px;
}

.car-subtitle {
    color: var(--text-muted);
    margin: 0 0 8px;
    font-size: 1rem;
}

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

/* Sizes table */
.sizes-table {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.sizes-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.sizes-row:last-child {
    border-bottom: none;
}

.sizes-header {
    background-color: var(--bg);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.sizes-cell {
    font-size: 1rem;
}

.size-pairs {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.size-pairs:last-child {
    margin-bottom: 0;
}

.size-common {
    color: var(--text);
    font-weight: 500;
}

.size-common::before {
    content: '';
}

/* Empty state */
.empty-state {
    margin-top: 8px;
    padding: 40px;
    text-align: center;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.empty-hint {
    font-size: 0.9rem;
    margin-top: 8px;
}

/* Back link */
.back-link {
    margin-top: 24px;
}

.back-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    background-color: var(--bg-card);
    padding: 28px 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 720px) {
    .hero-title {
        font-size: 2.1rem;
    }

    .header .container {
        flex-direction: column;
        height: auto;
        padding-top: 14px;
        padding-bottom: 14px;
        gap: 12px;
    }

    .hero {
        min-height: auto;
        padding: 60px 0 48px;
    }

    .section {
        padding: 56px 0;
    }

    .filter-card {
        padding: 22px;
    }

    .selects-row {
        gap: 12px;
    }

    .select-field {
        min-width: 100px;
    }

    .cta {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-kinds {
        justify-content: flex-start;
    }

    .sizes-row {
        grid-template-columns: 100px 1fr 1fr;
        font-size: 0.85rem;
        padding: 14px;
    }
}
