/* =============================================
   JM Motors – Public Site
   Apple-inspired minimal design
   ============================================= */

:root {
    --bg: #000;
    --bg-elevated: #111;
    --bg-card: #1a1a1a;
    --bg-modal: #161616;
    --border: rgba(255,255,255,0.08);
    --border-light: rgba(255,255,255,0.12);
    --text: #f5f5f7;
    --text-secondary: #86868b;
    --text-tertiary: #6e6e73;
    --accent: #dc2626;
    --accent-hover: #ef4444;
    --white: #fff;
    --radius: 20px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== NAV ========== */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 900;
    height: 64px;
    transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
    border-bottom: 1px solid transparent;
}

.nav--scrolled {
    background: rgba(0,0,0,0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-color: var(--border);
}

.nav__inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav__brand {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: var(--text);
}

.nav__brand span {
    font-weight: 800;
    color: var(--accent);
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav__links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.nav__links a:hover { color: var(--white); }

.nav__cta {
    background: var(--accent);
    color: var(--white) !important;
    padding: 8px 18px;
    border-radius: 980px;
    font-weight: 600 !important;
    font-size: 13px !important;
    transition: background 0.2s, transform 0.2s !important;
}

.nav__cta:hover {
    background: var(--accent-hover) !important;
    transform: scale(1.04);
}

.nav__cta i { margin-right: 6px; }

.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    width: 32px;
}

.nav__toggle span {
    display: block;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav__toggle.active span:first-child { transform: rotate(45deg) translate(3px, 3px); }
.nav__toggle.active span:last-child { transform: rotate(-45deg) translate(3px, -3px); }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    border-radius: 980px;
    padding: 14px 28px;
    transition: all 0.25s var(--ease);
    text-decoration: none;
}

.btn--primary {
    background: var(--accent);
    color: var(--white);
}

.btn--primary:hover {
    background: var(--accent-hover);
    transform: scale(1.03);
}

.btn--ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-light);
}

.btn--ghost:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
}

.btn--lg { padding: 16px 32px; font-size: 16px; }

/* ========== HERO ========== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
}

.hero__fade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(220,38,38,0.06) 0%, transparent 100%),
        linear-gradient(180deg, #000 0%, #0a0a0a 100%);
    pointer-events: none;
}

.hero__content {
    position: relative;
    z-index: 1;
    max-width: 680px;
}

.hero__tag {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 20px;
}

.hero__title {
    font-size: clamp(42px, 6vw, 72px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -2px;
    margin-bottom: 20px;
    color: var(--text);
}

.hero__title em {
    font-style: normal;
    background: linear-gradient(135deg, var(--accent), #f87171);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__sub {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 36px;
    line-height: 1.6;
    font-weight: 400;
}

.hero__actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========== SECTIONS ========== */
.section {
    padding: 100px 0;
}

.section--alt {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section__head {
    text-align: center;
    margin-bottom: 56px;
}

.section__head h2 {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.section__head p {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto;
}

/* ========== CAR CARDS ========== */
.cars {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s;
}

.card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    border-color: var(--border-light);
}

.card__img {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #0a0a0a;
}

.card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.card:hover .card__img img {
    transform: scale(1.04);
}

.card__badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--accent);
    color: var(--white);
    padding: 5px 14px;
    border-radius: 980px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.card__body {
    padding: 20px;
}

.card__title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.card__specs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.card__specs span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.card__price {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.card__price-now {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.card__price-old {
    font-size: 15px;
    color: var(--text-tertiary);
    text-decoration: line-through;
}

/* ========== EMPTY ========== */
.empty {
    text-align: center;
    padding: 80px 20px;
}

.empty i { font-size: 56px; color: var(--text-tertiary); margin-bottom: 20px; }
.empty h3 { font-size: 22px; margin-bottom: 8px; }
.empty p { color: var(--text-secondary); margin-bottom: 24px; }

/* ========== FEATURES ========== */
.features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 56px;
}

.feat {
    text-align: center;
    padding: 32px 20px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.3s, transform 0.3s;
}

.feat:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.feat__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(220,38,38,0.1);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 16px;
}

.feat h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}

.feat p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ========== BEFORE/AFTER ========== */
.ba {
    max-width: 600px;
    margin: 0 auto;
}

.ba__title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.ba__slider {
    position: relative;
    width: 100%;
    height: 280px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    --pos: 50%;
}

.ba__layer {
    position: absolute;
    inset: 0;
}

.ba__before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba__after { clip-path: inset(0 0 0 var(--pos)); }

.ba__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ba__placeholder--before { background: linear-gradient(135deg,#2a1f0a,#1a1500); color: #c9a84c; }
.ba__placeholder--after { background: linear-gradient(135deg,#0a1a2a,#001020); color: #4ca8c9; }
.ba__placeholder i { font-size: 32px; }
.ba__placeholder span { font-size: 16px; font-weight: 700; }

.ba__label {
    position: absolute;
    bottom: 10px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.ba__before .ba__label { left: 10px; }
.ba__after .ba__label { right: 10px; }

.ba__range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 10;
}

.ba__slider::after {
    content: '';
    position: absolute;
    top: 0;
    left: var(--pos);
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: var(--white);
    z-index: 5;
}

.ba__hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 10px;
}

/* ========== CONTACT ========== */
.contact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.contact__card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 24px;
    text-align: center;
    transition: transform 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.contact__card:hover {
    transform: translateY(-3px);
    border-color: var(--border-light);
}

.contact__card--main {
    border-color: rgba(220,38,38,0.25);
    background: linear-gradient(135deg, var(--bg-card), rgba(220,38,38,0.04));
}

.contact__card i {
    font-size: 24px;
    color: var(--accent);
    margin-bottom: 4px;
}

.contact__number {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.contact__card--main .contact__number { color: var(--accent); }

.contact__label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========== FOOTER ========== */
.footer {
    padding: 24px 0;
    border-top: 1px solid var(--border);
}

.footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-tertiary);
}

.footer__brand {
    font-size: 16px;
    color: var(--text-secondary);
}

.footer__brand strong { color: var(--accent); }

/* ========== MODAL ========== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.modal.open {
    pointer-events: auto;
    opacity: 1;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal__sheet {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 800px;
    max-height: 92vh;
    background: var(--bg-modal);
    border-radius: var(--radius) var(--radius) 0 0;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.45s var(--ease);
}

.modal.open .modal__sheet {
    transform: translateY(0);
}

.modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal__close:hover { background: rgba(0,0,0,0.8); }

/* Gallery */
.modal__gallery {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #0a0a0a;
}

.modal__slides {
    display: flex;
    height: 100%;
    transition: transform 0.45s var(--ease);
}

.modal__slides img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(10px);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 5;
}

.modal__arrow:hover { background: rgba(0,0,0,0.7); transform: translateY(-50%) scale(1.08); }
.modal__arrow--prev { left: 14px; }
.modal__arrow--next { right: 14px; }

.modal__dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
}

.modal__dots button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}

.modal__dots button.active {
    background: var(--white);
    transform: scale(1.3);
}

/* Modal body */
.modal__body {
    padding: 28px 28px 36px;
}

.modal__body h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.modal__price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 24px;
}

.modal__price-now {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
}

.modal__price-old {
    font-size: 18px;
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.modal__specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 24px;
}

.modal__spec {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    background: var(--bg-modal);
}

.modal__spec-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.modal__spec-value {
    font-size: 15px;
    font-weight: 600;
}

.modal__desc {
    margin-bottom: 24px;
}

.modal__desc p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.modal__cta {
    width: 100%;
}

/* ========== RESPONSIVE ========== */
@media (min-width: 769px) {
    .modal__sheet {
        border-radius: var(--radius);
        margin: auto;
        max-height: 90vh;
    }

    .modal {
        align-items: center;
    }

    .modal__sheet {
        transform: translateY(40px);
        opacity: 0;
        transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
    }

    .modal.open .modal__sheet {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 1024px) {
    .features {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav__toggle { display: flex; }

    .nav__links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(0,0,0,0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 20px 24px;
        gap: 0;
        border-bottom: 1px solid var(--border);
    }

    .nav__links.open { display: flex; }

    .nav__links a {
        padding: 14px 0;
        font-size: 16px;
        border-bottom: 1px solid var(--border);
    }

    .nav__links a:last-child { border: none; }

    .nav__cta {
        margin-top: 8px;
        text-align: center;
        display: block;
        padding: 14px !important;
    }

    .hero { padding: 100px 20px 60px; }
    .hero__title { font-size: 38px; letter-spacing: -1px; }
    .hero__sub { font-size: 16px; }

    .section { padding: 64px 0; }

    .cars { grid-template-columns: 1fr; }

    .features { grid-template-columns: 1fr; gap: 12px; }

    .contact { grid-template-columns: 1fr; }

    .footer__inner { flex-direction: column; gap: 8px; text-align: center; }

    .hero__actions { flex-direction: column; align-items: center; }
    .hero__actions .btn { width: 100%; max-width: 320px; }

    .modal__body h2 { font-size: 22px; }
    .modal__price-now { font-size: 22px; }
    .modal__specs { grid-template-columns: 1fr 1fr; }
    .modal__body { padding: 20px 20px 28px; }
}

@media (max-width: 480px) {
    .card__title { font-size: 17px; }
    .card__price-now { font-size: 20px; }
    .card__body { padding: 16px; }

    .modal__specs { grid-template-columns: 1fr; }
    .modal__gallery { aspect-ratio: 4/3; }
}
