/* ============================================================
   MRB Motors - Mobile-First Responsive Stylesheet
   ============================================================ */

:root {
    --red:       #c0392b;
    --red-dark:  #96281b;
    --charcoal:  #1c1c1c;
    --dark:      #111111;
    --mid:       #444444;
    --light:     #f4f4f4;
    --white:     #ffffff;
    --border:    #e0e0e0;
    --shadow:    0 2px 12px rgba(0,0,0,.10);
    --shadow-lg: 0 6px 24px rgba(0,0,0,.15);
    --radius:    6px;
    --font:      'Inter', 'Segoe UI', Arial, sans-serif;
    --transition: .2s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--light); color: var(--charcoal); line-height: 1.5; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    background: var(--dark);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-mark {
    background: var(--red);
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: .03em;
    padding: 6px 10px;
    border-radius: var(--radius);
    text-transform: uppercase;
}

.logo-text {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    display: none; /* shown on larger screens */
}

.header-contact {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-phone {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .03em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-phone svg { flex-shrink: 0; }

.btn-enquire {
    background: var(--red);
    color: var(--white);
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    transition: background var(--transition);
    white-space: nowrap;
}

.btn-enquire:hover { background: var(--red-dark); }

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.page-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 64px;
    z-index: 90;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

.filter-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-inner label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--mid);
    text-transform: uppercase;
    letter-spacing: .05em;
    flex-shrink: 0;
}

.filter-select, .filter-input {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: .9rem;
    color: var(--charcoal);
    font-family: var(--font);
    transition: border-color var(--transition);
    min-width: 0;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: var(--red);
}

.filter-select { min-width: 130px; }
.filter-input  { flex: 1; min-width: 120px; max-width: 220px; }

.filter-count {
    margin-left: auto;
    font-size: .85rem;
    color: var(--mid);
    white-space: nowrap;
    font-weight: 600;
}

.btn-clear-filters {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 12px;
    font-size: .82rem;
    color: var(--mid);
    transition: all var(--transition);
    display: none;
}

.btn-clear-filters.visible { display: inline-block; }
.btn-clear-filters:hover { border-color: var(--red); color: var(--red); }

/* ============================================================
   STOCK GRID
   ============================================================ */
.stock-section {
    padding: 24px 0 48px;
}

.stock-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* ---- CAR CARD ---- */
.car-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}

.car-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.car-card a.card-link {
    display: contents;
}

/* Image wrapper */
.card-image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #ddd;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.car-card:hover .card-image img { transform: scale(1.03); }

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    border-radius: 3px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 3px 8px;
}

.badge-featured { background: var(--red); color: var(--white); }
.badge-sold     { background: var(--charcoal); color: var(--white); }

.card-price-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--red);
    color: var(--white);
    font-size: 1.15rem;
    font-weight: 800;
    padding: 6px 14px;
    border-top-left-radius: var(--radius);
}

/* Card body */
.card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.25;
    margin-bottom: 4px;
}

.card-variant {
    font-size: .85rem;
    color: var(--mid);
    margin-bottom: 12px;
}

.card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 14px;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .8rem;
    color: var(--mid);
}

.spec-item svg { flex-shrink: 0; color: var(--red); }

.card-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
}

.btn-view {
    flex: 1;
    background: var(--charcoal);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 10px;
    font-size: .88rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: background var(--transition);
    display: block;
}

.btn-view:hover { background: var(--red); }

.btn-call-card {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--mid);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-call-card:hover { border-color: var(--red); color: var(--red); }

/* No results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--mid);
}

.no-results h3 { font-size: 1.2rem; margin-bottom: 8px; }

/* ============================================================
   CAR DETAIL PAGE
   ============================================================ */
.detail-page { padding: 24px 0 60px; }

.breadcrumb {
    font-size: .82rem;
    color: var(--mid);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb a { color: var(--red); }
.breadcrumb a:hover { text-decoration: underline; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

/* Gallery */
.gallery-main {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #ddd;
    cursor: zoom-in;
    position: relative;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity .3s;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.thumb {
    width: 70px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color var(--transition);
    flex-shrink: 0;
}

.thumb.active, .thumb:hover { border-color: var(--red); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Detail info panel */
.detail-panel {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-header {
    background: var(--dark);
    color: var(--white);
    padding: 20px;
}

.panel-header .car-year { font-size: .85rem; color: #aaa; margin-bottom: 4px; }
.panel-header h1 { font-size: 1.4rem; font-weight: 800; line-height: 1.2; }
.panel-header .car-variant { font-size: .95rem; color: #ccc; margin-top: 4px; }

.panel-price {
    background: var(--red);
    color: var(--white);
    padding: 14px 20px;
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.price-note { font-size: .8rem; font-weight: 400; opacity: .85; }

.panel-specs {
    padding: 0;
    border-bottom: 1px solid var(--border);
}

.spec-row {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}

.spec-row:last-child { border-bottom: none; }
.spec-row .spec-label { color: var(--mid); flex: 1; }
.spec-row .spec-value { font-weight: 600; color: var(--dark); }

.panel-cta {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-primary {
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .05em;
    transition: background var(--transition);
    display: block;
    width: 100%;
}

.btn-primary:hover { background: var(--red-dark); }

.btn-secondary {
    background: var(--charcoal);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 12px;
    font-size: .9rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: background var(--transition);
    display: block;
    width: 100%;
}

.btn-secondary:hover { background: var(--red); }

.btn-phone-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--dark);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 13px;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: .03em;
    transition: background var(--transition);
    width: 100%;
}

.btn-phone-large:hover { background: var(--red); }

/* Description & Extras */
.detail-description {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-top: 0;
}

.detail-description h2 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--dark);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--red);
    display: inline-block;
}

.detail-description p { font-size: .93rem; color: var(--mid); line-height: 1.7; }

.extras-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.extra-tag {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: .8rem;
    color: var(--charcoal);
    font-weight: 500;
}

/* ============================================================
   ENQUIRY MODAL
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideUp .25s ease;
}

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

.modal-header {
    background: var(--dark);
    color: var(--white);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 { font-size: 1rem; font-weight: 700; text-transform: uppercase; }
.modal-close { background: none; border: none; color: #aaa; font-size: 1.5rem; line-height: 1; padding: 0; }
.modal-close:hover { color: var(--white); }

.modal-body { padding: 20px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--mid); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: .9rem;
    font-family: var(--font);
    color: var(--charcoal);
    background: var(--light);
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--red);
    background: var(--white);
}

.form-group textarea { resize: vertical; min-height: 90px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-notice {
    font-size: .78rem;
    color: var(--mid);
    margin-top: 10px;
    line-height: 1.5;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--dark);
    color: #aaa;
    padding: 32px 0 20px;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.footer-brand .logo-mark { font-size: .95rem; }
.footer-brand p { font-size: .82rem; margin-top: 10px; line-height: 1.6; }

.footer-col h4 {
    color: var(--white);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.footer-col address { font-style: normal; font-size: .85rem; line-height: 1.9; }
.footer-col a { color: #aaa; transition: color var(--transition); }
.footer-col a:hover { color: var(--red); }

.opening-hours { font-size: .83rem; line-height: 2; }
.opening-hours .day { color: var(--white); font-weight: 600; margin-right: 8px; }

.footer-bottom {
    border-top: 1px solid #2a2a2a;
    margin-top: 24px;
    padding-top: 16px;
    text-align: center;
    font-size: .78rem;
}

.footer-bottom a { color: #aaa; }
.footer-bottom a:hover { color: var(--red); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.lightbox-overlay.open { display: flex; }

.lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
}

.lightbox-close {
    position: fixed;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,.15);
    border: none;
    color: var(--white);
    font-size: 1.6rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover { background: var(--red); }

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-page { padding: 32px 0 60px; }

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.contact-info-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.contact-info-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--red);
    display: inline-block;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    font-size: .9rem;
}

.contact-item svg { flex-shrink: 0; margin-top: 2px; color: var(--red); }

.map-placeholder {
    background: #e0e0e0;
    border-radius: var(--radius);
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mid);
    font-size: .9rem;
    margin-top: 16px;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--red);
    display: inline-block;
}

/* ============================================================
   UTILITY
   ============================================================ */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.text-red { color: var(--red); }

.sold-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sold-label {
    background: var(--charcoal);
    color: var(--white);
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: 10px 28px;
    border: 3px solid var(--white);
    transform: rotate(-12deg);
}

/* ============================================================
   RESPONSIVE - Tablet 600px+
   ============================================================ */
@media (min-width: 600px) {
    .logo-text { display: block; }

    .stock-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-inner {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   RESPONSIVE - Desktop 960px+
   ============================================================ */
@media (min-width: 960px) {
    .header-inner { height: 72px; }
    .filter-bar { top: 72px; }

    .stock-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .detail-grid {
        grid-template-columns: 1fr 380px;
        align-items: start;
    }

    .detail-gallery { grid-row: 1; grid-column: 1; }
    .detail-panel   { grid-row: 1 / 3; grid-column: 2; position: sticky; top: 84px; }
    .detail-description { grid-row: 2; grid-column: 1; }

    .footer-inner {
        grid-template-columns: 2fr 1fr 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================================
   RESPONSIVE - Wide 1200px+
   ============================================================ */
@media (min-width: 1200px) {
    .stock-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
