/* BMW family -> model -> year navigation pages */
:root { --bmw-blue:#0066b3; --bmw-blue-dark:#003d6b; --med-gray:#e6e6e6; --dark-gray:#333; }
body { font-family:'Segoe UI',Roboto,Arial,sans-serif; margin:0; background:#f7f7f7; color:#333; min-height:100vh; display:flex; flex-direction:column; }
.bmw-nav-page { flex:1 0 auto; width:100%; }
h1 { margin:24px 24px 6px; font-size:1.6rem; color:var(--bmw-blue-dark); }
.bmw-sub { margin:0 24px 20px; color:#666; }
.bmw-alt { margin:28px 24px; font-size:.9rem; }
.bmw-alt a { color:var(--bmw-blue); }
.bmw-crumb { margin:18px 24px 0; font-size:.85rem; color:#888; }
.bmw-crumb a { color:var(--bmw-blue); text-decoration:none; }
.bmw-crumb a:hover { text-decoration:underline; }

.bmw-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:18px; padding:0 24px 32px; }
.bmw-card { display:block; background:#fff; border:1px solid var(--med-gray); border-radius:10px; overflow:hidden; text-decoration:none; color:inherit; transition:box-shadow .2s,transform .2s,border-color .2s; }
.bmw-card:hover { border-color:var(--bmw-blue); box-shadow:0 4px 14px rgba(0,102,179,.18); transform:translateY(-2px); }
.bmw-card img { width:100%; height:150px; object-fit:cover; background:#0d0d0d; display:block; }
.bmw-card-label { padding:12px 14px 2px; font-weight:600; font-size:1.02rem; color:var(--bmw-blue-dark); }
.bmw-card-sub { padding:0 14px 14px; font-size:.8rem; color:#777; }

.bmw-year-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:12px; padding:0 24px 32px; }
.bmw-year-card { background:#fff; border:1px solid var(--med-gray); border-radius:8px; text-align:center; overflow:hidden; }
.bmw-year-main { display:block; padding:14px 8px; font-weight:600; font-size:1.05rem; color:var(--bmw-blue-dark); text-decoration:none; }
.bmw-year-card:hover { border-color:var(--bmw-blue); box-shadow:0 3px 10px rgba(0,102,179,.15); }
.bmw-year-alt { display:block; padding:5px 0 8px; font-size:.75rem; color:var(--bmw-blue); text-decoration:none; border-top:1px solid var(--med-gray); }
.bmw-year-alt:hover { background:#eef6fc; }
.bmw-model-hero { max-width:420px; width:100%; margin:10px 24px 0; border-radius:10px; }

@media (max-width:700px){
  .bmw-grid { grid-template-columns:repeat(2,1fr); gap:12px; }
  .bmw-year-grid { grid-template-columns:repeat(3,1fr); }
  h1 { font-size:1.3rem; }
}

.bmw-card img[src*="noimage"] { object-fit:contain; background:#fff; }

/* ── Landing page: Ducati-style category cards (fixed 200x160, centered auto-fit grid) ── */
.bmw-landing { padding: 0.75rem 2rem 2rem; line-height: 1.6; }
.bmw-landing-select { margin-bottom: 0.2rem; color: #666; font-weight: 700; text-transform: uppercase; font-size: 1rem; line-height: 1.6; }
.bmw-landing .bmw-grid { display: grid; grid-template-columns: repeat(auto-fit, 200px); width: 100%; justify-content: center; gap: 1rem; padding: 0; }
.bmw-landing .bmw-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 200px;
    aspect-ratio: 5 / 4;
    min-height: 0;
    background: #fff;
    border: 2px solid #0066b3;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0;
    overflow: hidden;
    position: relative;
}
.bmw-landing .bmw-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,102,179,0.2);
    border-color: #003d6b;
}
.bmw-landing-img {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.bmw-landing-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    transition: transform 0.3s ease;
}
.bmw-landing .bmw-card:hover .bmw-landing-img img { transform: scale(1.05); }
.bmw-landing-name {
    flex-shrink: 0;
    margin: 0;
    padding: 0.3rem 0.5rem;
    color: #0066b3;
    font-size: clamp(0.65rem, 1vw, 1rem);
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #fff;
}
.bmw-landing .bmw-alt { margin: 1.5rem 0 0; }

@media (max-width: 768px) {
    .bmw-landing { padding: 0.75rem; }
    .bmw-landing .bmw-grid { gap: 0.75rem; }
}
@media (max-width: 480px) {
    .bmw-landing .bmw-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .bmw-landing .bmw-card { max-width: none; }
    .bmw-landing-name { font-size: 0.75rem; padding: 0.25rem 0.3rem; }
}

/* Model cards with inline year chips (family pages) */
.bmw-card-model { scroll-margin-top: 90px; cursor: default; }
.bmw-card-model:hover { transform: none; }
.bmw-card-title {
    margin: 0;
    padding: 12px 10px 8px;
    text-align: center;
    font-size: 1rem;
    line-height: 1.25;
    min-height: 2.9em;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    color: var(--bmw-blue-dark);
}
.bmw-card-img {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    overflow: hidden;
}
.bmw-card-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; }
.bmw-card-years {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 10px 12px 14px;
}
.bmw-year-chip {
    display: block;
    padding: 7px 4px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--bmw-blue-dark);
    background: #f4f6f8;
    border: 1px solid var(--med-gray);
    border-radius: 6px;
    text-decoration: none;
    transition: all .15s ease;
}
.bmw-year-chip:hover { background: var(--bmw-blue); border-color: var(--bmw-blue); color: #fff; }
