:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --line: #dbe3ee;
    --line-strong: #c3cfdf;
    --text: #102033;
    --muted: #637084;
    --brand: #1957d2;
    --brand-soft: #e8f0ff;
    --accent: #ffb23f;
    --shadow: 0 10px 30px rgba(16, 32, 51, 0.08);
}

* {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

body.bike-app {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(25, 87, 210, 0.08), transparent 26%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
    color: var(--text);
}

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

a:hover {
    color: inherit;
}

.bike-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

.bike-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(219, 227, 238, 0.9);
    position: sticky;
    top: 0;
    z-index: 20;
}

.bike-brand {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.bike-logo {
    display: block;
    width: min(320px, 52vw);
    height: auto;
}

.bike-lang-switcher {
    display: inline-flex;
    gap: 0.5rem;
}

.bike-lang-switcher form {
    display: inline-flex;
    gap: 0.5rem;
    margin: 0;
}

.lang-pill {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
}

button.lang-pill {
    appearance: none;
    cursor: pointer;
    font: inherit;
    line-height: 1;
}

.lang-pill.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.bike-sidebar {
    grid-row: 2;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(8px);
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-section {
    margin-bottom: 1rem;
}

.compose-btn {
    display: block;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--brand), #4e82ff);
    color: #fff;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.compose-btn.active {
    box-shadow: 0 12px 28px rgba(25, 87, 210, 0.28);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-label {
    margin: 0.8rem 0 0.35rem;
    padding: 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.sidebar-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.7rem 0.9rem;
    border-radius: 14px;
    color: var(--text);
    font-weight: 600;
}

.sidebar-link:hover {
    background: rgba(25, 87, 210, 0.08);
}

.sidebar-link.active {
    background: var(--brand-soft);
    color: var(--brand);
}

.sidebar-support {
    border: 1px solid rgba(255, 178, 63, 0.28);
    background: rgba(255, 178, 63, 0.08);
}

.sidebar-support.active {
    background: rgba(25, 87, 210, 0.12);
    border-color: rgba(25, 87, 210, 0.22);
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 1rem;
}

.bike-main {
    grid-row: 2;
    min-width: 0;
    padding: 1.25rem;
}

.content-surface {
    min-height: calc(100vh - 6rem);
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(219, 227, 238, 0.92);
    border-radius: 28px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-title {
    margin: 0;
    font-size: clamp(1.6rem, 2vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.page-subtitle {
    margin: 0.35rem 0 0;
    color: var(--muted);
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 6px 20px rgba(16, 32, 51, 0.04);
}

.listing-card {
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.listing-card:hover,
.listing-card:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(25, 87, 210, 0.22);
    box-shadow: 0 12px 28px rgba(16, 32, 51, 0.08);
}

.panel + .panel {
    margin-top: 1rem;
}

.panel-body {
    padding: 1rem;
}

.search-strip {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1.05fr 1fr 1fr 1.15fr 0.8fr 0.8fr 0.9fr auto;
    align-items: center;
}

.search-strip .form-control,
.search-strip .form-select {
    border-radius: 14px;
    border-color: var(--line-strong);
}

.search-strip .btn {
    border-radius: 14px;
    min-height: 44px;
}

.result-meta {
    color: var(--muted);
    font-size: 0.92rem;
}

.metric-card {
    height: 100%;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

.metric-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 800;
}

.metric-value {
    margin-top: 0.35rem;
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text);
}

.page-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0.15rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
}

.page-link:hover {
    border-color: rgba(25, 87, 210, 0.28);
    background: rgba(25, 87, 210, 0.06);
}

.page-link-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 800;
}

.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1rem;
    color: var(--muted);
    font-weight: 700;
}

.result-grid {
    display: grid;
    gap: 0.9rem;
}

.result-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 1rem;
    padding: 0.95rem;
    align-items: start;
}

.result-thumb {
    width: 150px;
    height: 110px;
    border-radius: 18px;
    object-fit: cover;
    background: #e8edf5;
}

.result-title {
    margin: 0 0 0.3rem;
    font-size: 1.1rem;
    font-weight: 800;
}

.result-title a {
    color: var(--text);
}

.result-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--brand);
}

.result-description {
    margin: 0.55rem 0 0;
    color: var(--muted);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 1rem;
}

.detail-gallery {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.detail-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 18px;
    cursor: zoom-in;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(8, 15, 28, 0.82);
    backdrop-filter: blur(8px);
    z-index: 1000;
}

.image-lightbox.open {
    display: flex;
}

.image-lightbox-backdrop {
    position: absolute;
    inset: 0;
}

.image-lightbox-content {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 1200px);
    max-height: 88vh;
}

.image-lightbox img {
    display: block;
    max-width: 92vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    background: #fff;
}

.image-lightbox-close {
    position: absolute;
    top: -0.75rem;
    right: -0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.detail-hero {
    padding: 1.2rem;
}

.detail-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand);
}

.detail-card {
    padding: 1rem;
}

.detail-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.detail-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(219, 227, 238, 0.7);
}

.detail-list li:last-child {
    border-bottom: 0;
}

.detail-label {
    color: var(--muted);
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-section {
    padding: 1rem;
}

.form-section h2,
.form-section h3 {
    margin: 0 0 0.9rem;
    font-size: 1.05rem;
    font-weight: 800;
}

.form-help {
    color: var(--muted);
    font-size: 0.92rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
}

.btn-outline-primary {
    color: var(--brand);
    border-color: var(--brand);
}

.btn-outline-primary:hover {
    background: var(--brand);
    border-color: var(--brand);
}

@media (max-width: 1080px) {
    .bike-shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .search-strip {
        grid-template-columns: 1fr 1fr;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .bike-shell {
        grid-template-columns: 1fr;
    }

    .bike-sidebar {
        grid-row: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .bike-main {
        padding: 0.9rem;
    }

    .content-surface {
        padding: 1rem;
        border-radius: 22px;
    }

    .search-strip,
    .result-row {
        grid-template-columns: 1fr;
    }

    .result-thumb {
        width: 100%;
        height: 200px;
    }
}
