/* ========================================
   BMW Motorrad K-MOTO — Design System
   ======================================== */

/* --- CSS Custom Properties --- */
:root {
    /* Colors */
    --bmw-blue: #0066B1;
    --bmw-blue-light: #1a8ddd;
    --bmw-blue-dark: #004a80;
    --bmw-blue-glow: rgba(0, 102, 177, 0.35);

    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --bg-card-hover: #1c1c1c;
    --bg-header: rgba(10, 10, 10, 0.85);
    --bg-footer: #080808;

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.45);

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-card: rgba(255, 255, 255, 0.06);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --transition-fast: 200ms var(--ease-out);
    --transition-medium: 400ms var(--ease-out);
    --transition-slow: 600ms var(--ease-out);

    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Header --- */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--space-md) var(--space-xl);
    transition: background var(--transition-medium), 
                padding var(--transition-medium),
                backdrop-filter var(--transition-medium);
}

#main-header.scrolled {
    background: var(--bg-header);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: var(--space-sm) var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: opacity var(--transition-fast);
}

.logo:hover {
    opacity: 0.85;
}

/* BMW Motorrad SVG Logo */
.bmw-logo {
    height: 38px;
    width: auto;
    filter: brightness(0) invert(1); /* Make SVG white on dark bg */
    transition: filter var(--transition-fast);
}

#main-header.scrolled .bmw-logo {
    height: 30px;
}

.nav-dealer-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.badge-label {
    font-size: 0.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 500;
}

.badge-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text-primary);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0, 102, 177, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 20% 80%, rgba(0, 102, 177, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 80% 20%, rgba(26, 141, 221, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-primary) 0%, #080810 40%, #0a0a14 70%, var(--bg-primary) 100%);
}

.hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: 
        linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 60px 60px;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: var(--space-xl);
    max-width: 800px;

    animation: heroFadeIn 1.2s var(--ease-out) both;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    background: rgba(0, 102, 177, 0.12);
    border: 1px solid rgba(0, 102, 177, 0.25);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--bmw-blue-light);
    text-transform: uppercase;
    margin-bottom: var(--space-2xl);

    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { border-color: rgba(0, 102, 177, 0.25); }
    50% { border-color: rgba(0, 102, 177, 0.5); }
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--bmw-blue-light);
    border-radius: 50%;
    display: inline-block;
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.7); }
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.75) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero h1 .highlight {
    background: linear-gradient(135deg, var(--bmw-blue-light) 0%, var(--bmw-blue) 50%, #4da8db 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto var(--space-2xl);
    line-height: 1.7;
    font-weight: 400;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-2xl);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-medium);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--bmw-blue) 0%, var(--bmw-blue-light) 100%);
    color: var(--text-primary);
    box-shadow: 
        0 0 0 1px rgba(0, 102, 177, 0.3),
        0 4px 20px rgba(0, 102, 177, 0.25),
        0 8px 40px rgba(0, 102, 177, 0.1);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--bmw-blue-light) 0%, #3399dd 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 0 1px rgba(0, 102, 177, 0.5),
        0 8px 30px rgba(0, 102, 177, 0.35),
        0 12px 50px rgba(0, 102, 177, 0.15);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary span,
.btn-primary svg {
    position: relative;
    z-index: 1;
}

.btn-primary:hover svg {
    transform: translateX(4px);
    transition: transform var(--transition-fast);
}

.btn-primary:active {
    transform: translateY(0);
}

/* --- Features Section --- */
.features {
    position: relative;
    padding: var(--space-4xl) var(--space-xl);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--bmw-blue), transparent);
}

.features-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    transition: all var(--transition-medium);
    position: relative;
    overflow: hidden;

    /* Animation initial state */
    opacity: 0;
    transform: translateY(40px);
}

.feature-card.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.feature-card:nth-child(2).is-visible {
    transition-delay: 0.1s;
}

.feature-card:nth-child(3).is-visible {
    transition-delay: 0.2s;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--bmw-blue), transparent);
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(0, 102, 177, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(0, 102, 177, 0.08);
    border: 1px solid rgba(0, 102, 177, 0.12);
    transition: all var(--transition-medium);
}

.feature-card:hover .feature-icon {
    background: rgba(0, 102, 177, 0.15);
    border-color: rgba(0, 102, 177, 0.3);
    box-shadow: 0 0 20px var(--bmw-blue-glow);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    color: var(--bmw-blue-light);
}

.feature-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    letter-spacing: 0.5px;
}

.feature-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========================================
   Footer
   ======================================== */
#main-footer {
    background: var(--bg-footer);
    border-top: 1px solid var(--border-subtle);
    position: relative;
}

#main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--bmw-blue), transparent);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* Footer Top: 4-column grid */
.footer-top {
    display: grid;
    grid-template-columns: 1.3fr 1fr 0.8fr 0.8fr;
    gap: var(--space-2xl);
    padding: var(--space-3xl) var(--space-xl) var(--space-2xl);
}

.footer-heading {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    position: relative;
    padding-bottom: var(--space-sm);
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--bmw-blue);
    border-radius: 1px;
}

.footer-heading-mt {
    margin-top: var(--space-xl);
}

/* Contact column */
.footer-address {
    margin-bottom: var(--space-lg);
}

.footer-address p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.footer-address strong {
    color: var(--text-primary);
    font-weight: 600;
}

.footer-contact-lines {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
}

.contact-line {
    display: flex;
    gap: var(--space-sm);
    font-size: 0.82rem;
    line-height: 1.6;
}

.contact-label {
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 100px;
}

.contact-line a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.contact-line a:hover {
    color: var(--bmw-blue-light);
}

.footer-link-all {
    font-size: 0.78rem;
    color: var(--bmw-blue-light);
    font-weight: 500;
    transition: color var(--transition-fast);
    display: inline-block;
}

.footer-link-all:hover {
    color: var(--text-primary);
}

/* Hours table */
.hours-table {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hours-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.82rem;
    padding: 2px 0;
}

.hours-day {
    color: var(--text-secondary);
    font-weight: 500;
}

.hours-time {
    color: var(--text-primary);
    font-weight: 400;
}

.hours-note .hours-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}

.hours-closed {
    color: var(--text-muted) !important;
}

/* Footer list */
.footer-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-list li a {
    font-size: 0.82rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    display: inline-block;
    padding: 2px 0;
}

.footer-list li a:hover {
    color: var(--bmw-blue-light);
}

/* Social links */
.footer-social {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.social-link svg {
    width: 18px;
    height: 18px;
}

.social-link:hover {
    background: rgba(0, 102, 177, 0.15);
    border-color: rgba(0, 102, 177, 0.3);
    color: var(--bmw-blue-light);
    transform: translateY(-2px);
}

/* Footer brand logo */
.footer-brand-logo {
    margin-top: var(--space-md);
}

.footer-logo-img {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.footer-logo-img:hover {
    opacity: 0.8;
}

/* Footer bottom / legal */
.footer-bottom {
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    text-align: center;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.footer-legal a {
    font-size: 0.72rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.footer-legal a:hover {
    color: var(--bmw-blue-light);
}

.footer-sep {
    color: var(--text-muted);
    opacity: 0.3;
    font-size: 0.72rem;
}

.footer-copy {
    font-size: 0.68rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2xl);
    }
}

@media (max-width: 768px) {
    #main-header {
        padding: var(--space-sm) var(--space-md);
    }

    #main-header.scrolled {
        padding: var(--space-xs) var(--space-md);
    }

    .bmw-logo {
        height: 28px;
    }

    #main-header.scrolled .bmw-logo {
        height: 24px;
    }

    .badge-label {
        font-size: 0.55rem;
    }

    .badge-name {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }

    .hero-content {
        padding: var(--space-xl) var(--space-md);
    }

    .hero-badge {
        font-size: 0.6rem;
        letter-spacing: 2px;
        margin-bottom: var(--space-xl);
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .btn {
        padding: var(--space-md) var(--space-xl);
        font-size: 0.8rem;
    }

    .features {
        padding: var(--space-3xl) var(--space-md);
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .feature-card {
        padding: var(--space-xl);
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
        padding: var(--space-2xl) var(--space-md);
    }

    .footer-bottom {
        padding: var(--space-md);
    }

    .footer-legal {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .footer-sep {
        display: none;
    }

    .contact-line {
        flex-direction: column;
        gap: 0;
    }

    .contact-label {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .bmw-logo {
        height: 24px;
    }
}

/* --- Print styles --- */
@media print {
    #main-header {
        position: static;
        background: white;
        color: black;
    }

    .hero-bg {
        display: none;
    }

    .hero {
        min-height: auto;
        background: white;
        color: black;
    }

    .hero h1 {
        -webkit-text-fill-color: black;
        background: none;
    }

    .feature-card {
        opacity: 1;
        transform: none;
        background: white;
        border: 1px solid #ddd;
        color: black;
    }

    .bmw-logo, .footer-logo-img {
        filter: none;
    }

    #main-footer {
        background: white;
        color: black;
    }
}

/* --- Focus styles for accessibility --- */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--bmw-blue-light);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
