/* ===============================
   CAR DETAILS PAGE (car_details.css)
   Dark luxury theme for Lexus models
   =============================== */

/* Body */
body {
    margin: 0;
    font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
    background: #000;
    color: #eee;
    line-height: 1.6;
}

/* ---------- HEADER ---------- */
header {
    position: relative;
    height: 40vh;
    background: url('images/lexus.webp') center center / cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 5px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease-out;
    text-align: center;
}

header.visible {
    opacity: 1;
    transform: translateY(0);
}

header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}

header h1 {
    position: relative;
    font-size: 3rem;
    font-weight: 600;
    z-index: 1;
    margin: 0;
    letter-spacing: 3px;
}

/* ---------- WRAPPER & CONTENT ---------- */
.models-wrapper {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.models-content {
    width: 100%;
    max-width: 1200px;
}

/* ---------- GRID OF CAR MODELS ---------- */
.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, auto)); /* use 'auto' instead of 1fr */
    gap: 25px;
    justify-content: center; /* centers items if fewer than full row */
    align-items: start;
}



/* ---------- MODEL CARD ---------- */
.model-card {
    background: #1a1a1a;
    border-radius: 14px;
    text-decoration: none;
    color: #eee;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 280px;
    min-height: 400px; /* consistent card height */
}

.model-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
}

/* ---------- IMAGE ---------- */
.img-wrap {
    width: 100%;
    background: #111;
    text-align: center;
    padding: 15px;
    border-bottom: 1px solid #222;
}

.img-wrap img {
    width: 100%;
    max-width: 240px;
    border-radius: 10px;
    border: 2px solid #333;
}

/* ---------- MODEL TEXT ---------- */
.model-card h3 {
    font-size: 18px;
    margin: 12px 0 8px;
    color: #fff;
    text-align: center;
    white-space: normal; /* allow wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
    width: 90%;
}

.model-card p {
    font-size: 15px;
    color: #ccc;
    padding: 0 15px 15px;
    text-align: center;
    flex-grow: 1; /* push content to bottom consistently */
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .model-card {
        min-height: 380px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 24px;
        letter-spacing: 2px;
    }

    .model-card h3 {
        font-size: 16px;
    }

    .model-card p {
        font-size: 14px;
    }

    .model-grid {
        gap: 20px;
    }
}

/* ---------- FADE-IN ANIMATION ---------- */
section, .feature, .model-card, header {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease-out;
}

section.visible, .feature.visible, .model-card.visible, header.visible {
    opacity: 1;
    transform: translateY(0);
}
