:root {
    --bg: #ffffff;
    --bg-secondary: #f5f5f7;
    --text: #1d1d1f;
    --text-muted: #6e6e73;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-light: rgba(0, 113, 227, 0.08);
    --border: #d2d2d7;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --max-width: 1200px;
    --nav-height: 56px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    padding-top: var(--nav-height);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Navigation ---- */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255,255,255,0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.nav-center-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.nav-logo {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1;
}

.nav-logo:hover {
    color: var(--text);
}

.nav-logo img {
    display: block;
    height: 32px;
    width: auto;
}

.nav-logo-text {
    margin-left: 0;
    font-weight: 600;
    font-size: 1.125rem;
}

.btn-catalog {
    display: inline-flex;
    align-items: center;
    padding: 0 20px;
    height: 36px;
    background: #e31837;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 999px;
    margin-left: 24px;
    transition: background 0.2s, box-shadow 0.2s;
    text-decoration: none;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-catalog:hover {
    background: #b0152c;
    color: #fff;
}

.nav-search-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    max-width: 640px;
}
.nav-search-capsule {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 16px;
    height: 36px;
    width: 640px;
    transition: border-color 0.2s, background 0.2s;
}

.nav-search-capsule:focus-within {
    border-color: var(--accent);
    background: var(--bg);

}

.nav-search-capsule-icon {
    font-size: 0.875rem;
    opacity: 0.35;
    line-height: 1;
    flex-shrink: 0;
}

.nav-search-capsule-input {
    border: none;
    outline: none;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    background: transparent;
    color: var(--text);
    width: 100%;
}

.nav-search-capsule-input-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
}

.nav-search-capsule-input::placeholder {
    color: var(--text-muted);
}

.nav-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 360px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 200;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}
.nav-search-dropdown.active {
    display: block;
}
.nav-search-dropdown .search-result-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text);
    font-size: .75rem;
    transition: background .15s;
}
.nav-search-dropdown .search-result-link:hover {
    background: var(--bg-secondary);
}
.nav-search-dropdown .search-result-link:first-child {
    border-radius: 12px 12px 0 0;
}
.nav-search-dropdown .search-result-link:last-child {
    border-radius: 0 0 12px 12px;
}
.nav-search-dropdown .search-result-link:only-child {
    border-radius: 12px;
}
.nav-search-dropdown .search-result-icon {
    width: 20px;
    flex-shrink: 0;
    text-align: center;
    font-size: .75rem;
}
.nav-search-dropdown .search-result-info {
    flex: 1;
    min-width: 0;
}
.nav-search-dropdown .search-result-name {
    display: block;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-search-dropdown .search-result-number {
    display: block;
    font-size: .625rem;
    color: var(--text-muted);
    margin-top: 1px;
}
.nav-search-dropdown .search-result-price {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--accent);
    font-size: .6875rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--text);
}

.nav-search-btn {
    display: inline-block;
    background: none;
    border: none;
    font: inherit;
    font-size: 0.875rem;
    color: var(--accent);
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--accent-light);
    transition: background 0.2s;
}

.nav-search-btn:hover {
    background: rgba(0, 113, 227, 0.15);
}

.nav-admin-link {
    font-size: 0.8125rem;
    font-weight: 600;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.nav-admin-link:hover {
    opacity: 1;
    color: var(--text-muted);
}

.nav-cart-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background 0.2s, box-shadow 0.2s;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.nav-cart-link:hover {
    background: var(--bg-secondary);
}

.nav-cart-icon {
    font-size: 1.125rem;
    line-height: 1;
}

.nav-cart-badge {
    position: absolute;
    top: 0;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #e31837;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
}

/* ---- Hero ---- */

.hero {
    position: relative;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    padding: 80px 24px;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(0,113,227,0.06) 0%, transparent 60%);
}

.hero-content {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.6;
}

.hero-search-btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    font: inherit;
    font-size: 1rem;
    padding: 12px 32px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.hero-search-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

/* ---- Section Titles ---- */

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 28px;
    color: var(--text);
}

/* ---- Brand Grid (Home) ---- */

.brands-section {
    padding: 60px 24px;
}

.brand-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.brands-section .section-title {
    text-align: center;
}

.brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 24px 24px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 30px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    color: var(--text);
}

.brand-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
    color: var(--text);
}

.brand-logo-wrapper {
    width: 100px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.brand-logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.brand-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.brand-arrow {
    color: var(--accent);
    font-size: 1.125rem;
}

/* ---- Featured Section ---- */

.featured-section {
    padding: 0 24px 60px;
}

.motor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
}

.motor-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 30px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    color: var(--text);
}

.motor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: var(--text);
}

.motor-card-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #fff;
}

.motor-card-body {
    padding: 12px 16px 16px;
    margin: 0 10px 10px;
    background: #f5f5f7;
    border: 1px solid var(--border);
    border-radius: 30px;
}

.motor-card-brand {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.motor-card-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 4px 0 8px;
}

.motor-arrow {
    font-size: 0.875rem;
    color: var(--accent);
    font-weight: 500;
}

/* ---- Brand Page ---- */

.brand-page {
    padding: 40px 24px 60px;
}

.back-link {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--accent);
    margin-bottom: 24px;
}

.back-link:hover {
    text-decoration: underline;
}

.brand-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 48px;
    padding: 32px;
    background: #fff;
    border-radius: 30px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.brand-header:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.brand-header-logo {
    flex-shrink: 0;
    width: 120px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-header-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-header-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.brand-header-desc {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-bottom: 8px;
}

.brand-stats {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ---- Motorcycle Page ---- */

.motorcycle-page {
    padding: 40px 24px 60px;
}

.motor-header {
    display: flex;
    gap: 32px;
    margin-bottom: 40px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 30px;
}

.motor-header-img-box {
    width: 260px;
    height: 170px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.motor-header-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 30px;
}

.motor-header-brand {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    font-weight: 600;
}

.motor-header-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 4px 0;
}

.motor-header-year {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-bottom: 4px;
}

.motor-header-desc-box {
    flex: 1;
    min-width: 200px;
    padding-top: 60px;
}

.motor-header-desc {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin: 0;
    line-height: 1.5;
}

.motor-header-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ---- Parts Accordion ---- */

.parts-accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.accordion-item:hover {
    box-shadow: var(--shadow-sm);
}

.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg);
    border: none;
    cursor: pointer;
    font: inherit;
    text-align: left;
    color: var(--text);
    transition: background 0.15s;
}

.accordion-header:hover {
    background: var(--bg-secondary);
}

.accordion-icon {
    font-size: 1.25rem;
    width: 32px;
    text-align: center;
}

.accordion-title {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
}

.accordion-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 10px;
    border-radius: 12px;
}

.accordion-arrow {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.accordion-item.open .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.open .accordion-body {
    max-height: 10000px;
}

/* ---- Parts Table ---- */

.parts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.parts-table th {
    text-align: left;
    padding: 10px 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.parts-table td {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    vertical-align: middle;
}

.parts-table tr:hover td {
    background: var(--bg-secondary);
}

.part-number {
    font-family: "SF Mono", "Roboto Mono", monospace;
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.part-name {
    font-weight: 500;
    color: var(--text);
}

.part-name:hover {
    color: var(--accent);
}

.part-price {
    font-weight: 500;
    white-space: nowrap;
    color: var(--text);
}

.part-detail-link {
    font-size: 0.8125rem;
    color: var(--accent);
}

.cross-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.info-icon { color: #999; cursor: help; font-size: .75rem; }
.badge {
    display: inline-block;
    font-size: 0.6875rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 500;
}

.badge-more {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

/* ---- Part Detail Page ---- */

.part-page {
    padding: 40px 24px 60px;
}

.part-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.part-detail-image {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    position: relative;
}

.part-detail-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    padding: 32px;
}

.part-image-size {
    display: block;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: 0 0 12px;
    font-family: "SF Mono", "Roboto Mono", monospace;
}

.part-detail-category {
    margin-bottom: 12px;
}

.category-badge {
    display: inline-block;
    font-size: 0.8125rem;
    padding: 4px 14px;
    border-radius: 16px;
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 500;
}

.part-detail-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    line-height: 1.2;
}

.part-detail-number,
.part-detail-price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.part-detail-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    min-width: 100px;
}

.part-detail-value {
    font-size: 1rem;
    font-weight: 500;
}

.part-detail-value.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.part-detail-desc {
    padding: 16px 0;
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.part-detail-fitment {
    padding-top: 24px;
}

.part-detail-fitment h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.het-summary {
    font-size: 0.8125rem;
    color: var(--text);
    line-height: 1.6;
}

.het-summary strong {
    font-weight: 600;
    color: var(--text-muted);
}

.het-tag {
    display: inline-block;
    font-size: .6875rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: #e3f2fd;
    color: #1565c0;
    vertical-align: middle;
}

.het-mt-chip {
    display: inline-block;
    font-size: .6875rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    margin: 1px 0;
}

.fitment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fitment-chip {
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 30px;
    transition: border-color 0.2s, background 0.2s;
    color: var(--text);
    min-width: 120px;
}

.fitment-chip:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--text);
}

.fitment-brand {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.fitment-name {
    font-weight: 600;
    font-size: 0.875rem;
}

/* ---- Search Page ---- */

.search-page {
    padding: 40px 24px 60px;
}

.search-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

.search-page-form {
    margin-bottom: 24px;
}

.search-page-input {
    width: 100%;
    padding: 14px 18px;
    font: inherit;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s;
    background: var(--bg);
    color: var(--text);
}

.search-page-input:focus {
    border-color: var(--accent);
}

.search-result-count {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.search-result-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--text);
}

.search-result-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    color: var(--text);
}

.search-no-result {
    text-align: center;
    padding: 48px 0;
    color: var(--text-muted);
}

.search-hint {
    text-align: center;
    padding: 48px 0;
    color: var(--text-muted);
}

/* ---- Cart Page ---- */

.cart-page {
    padding: 40px 24px 60px;
    max-width: 900px;
    margin: 0 auto;
}

.cart-page h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.cart-items {
    display: flex;
    flex-direction: column;
}

.cart-empty {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.cart-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.cart-total {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

/* ---- Footer ---- */

.footer {
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-tagline {
    margin-top: 4px;
    font-size: 0.75rem;
}

.footer-admin-link {
    color: var(--text-muted);
    text-decoration: underline;
    opacity: 0.5;
}

.footer-admin-link:hover {
    opacity: 1;
    color: var(--text-muted);
}

/* ---- Diagram styles ---- */

.diagram-section .diagram-hotspot:hover::after {
    content: attr(data-number) " \2014  " attr(data-part);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1d1d1f;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.diagram-outer:hover .diagram-controls {
    opacity: 1 !important;
}
.diagram-controls button:hover {
    background: rgba(0,0,0,0.06) !important;
}

.diagram-hotspot-row {
    background: rgba(0,113,227,0.12) !important;
    outline: 2px solid #0071e3;
    outline-offset: -1px;
}

/* ---- Parts accordion (legacy) ---- */

.accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 40px;
}
.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: none;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.accordion-header:hover { background: #ebebed; }
.accordion-count {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: auto;
}
.accordion-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s;
    margin-left: 6px;
}
.accordion-item.open .accordion-chevron { transform: rotate(180deg); }
.accordion-body {
    display: none;
    padding: 0;
    overflow-x: auto;
}
.accordion-item.open .accordion-body { display: block; }

/* ---- Parts table (legacy) ---- */
.parts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.parts-table th {
    padding: 8px 14px;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.parts-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.parts-table tr:last-child td { border-bottom: none; }
.parts-table tr:hover td { background: var(--bg-secondary); }
.part-number-link { font-family: monospace; font-size: 0.75rem; color: var(--accent); }
.part-price { font-weight: 500; white-space: nowrap; }

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .brand-grid {
        grid-template-columns: 1fr;
    }

    .motor-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .motor-header {
        flex-direction: column;
    }

    .motor-header-img-box {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .motor-header-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .part-detail {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .brand-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .part-detail-number,
    .part-detail-price {
        flex-direction: column;
        gap: 4px;
    }

    .part-detail-label {
        min-width: auto;
    }

    .search-modal {
        max-width: calc(100% - 32px);
    }
}

@media (max-width: 480px) {
    .motor-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 60px 16px;
    }

    .parts-table th,
    .parts-table td {
        padding: 10px 12px;
    }

    .part-number {
        font-size: 0.75rem;
    }
}

/* Responsive: Diagram page */
@media (max-width: 1024px) {
    .diagram-layout {
        flex-direction: column !important;
    }
    .diagram-sidebar {
        width: 100% !important;
        border-left: none !important;
        border-top: 1px solid var(--border) !important;
        max-height: 50vh;
    }
    .diagram-header-sidebar {
        display: none !important;
    }
    .sidebar-header-row {
        display: flex !important;
    }
    .diagram-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .nav-search-capsule {
        width: 280px;
    }
}
@media (max-width: 768px) {
    .nav-search-dropdown {
        position: fixed;
        top: 56px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vw - 16px);
        max-width: 360px;
        min-width: 0;
        max-height: 60vh;
        border-radius: 10px;
        font-size: .6875rem;
    }
    .nav-search-capsule-input {
        font-size: 16px;
    }
    .nav-search-capsule {
        width: 180px;
    }
    .nav-inner {
        padding: 0 12px;
    }
    .nav-center-group {
        justify-content: flex-end;
    }
    .nav-search-wrap {
        flex: none;
        width: 180px;
        max-width: 180px;
    }
    .btn-catalog {
        padding: 0 12px;
        font-size: 0.6875rem;
    }
    .nav-logo-text {
        display: none;
    }
    .nav-logo img {
        height: 28px;
    }
}
@media (max-width: 520px) {
    .diagram-grid {
        grid-template-columns: 1fr !important;
    }
    .nav-search-capsule {
        width: 110px;
        padding: 0 10px;
    }
    .nav-search-capsule-icon svg {
        width: 18px;
        height: 18px;
    }
    .nav-search-wrap {
        width: 110px;
        max-width: 110px;
    }
    .nav-links {
        gap: 8px;
    }
    .nav-logo img {
        height: 24px;
    }
    .btn-catalog {
        padding: 0 8px;
        font-size: 0.625rem;
        height: 30px;
    }
}
