/* ============================================================
   SYSMOTOR — Main Stylesheet
   Mobile-first. Desktop at 768px+.
   ============================================================ */

:root {
    --color-primary:       #E63946;
    --color-primary-dark:  #C1121F;
    --color-primary-light: #FF6B6B;
    --color-secondary:     #1D3557;
    --color-accent:        #25D366;

    --color-bg:            #F8F9FA;
    --color-bg-card:       #FFFFFF;
    --color-border:        #E0E0E0;
    --color-text:          #212529;
    --color-text-muted:    #6C757D;

    --color-available:     #2ECC71;
    --color-reserved:      #F39C12;
    --color-sold:          #E74C3C;
    --color-new-badge:     #3498DB;
    --color-used-badge:    #8E44AD;

    --color-warranty:      #27AE60;
    --color-financing:     #2980B9;
    --color-gift:          #E91E63;

    --gap-xs:  4px;
    --gap-sm:  8px;
    --gap-md:  16px;
    --gap-lg:  24px;
    --gap-xl:  40px;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --shadow-card:  0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 6px 24px rgba(0,0,0,0.14);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 15px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Container ──────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--gap-md);
}

/* ── Header ─────────────────────────────────────────────── */
.site-header {
    background: var(--color-secondary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.logo {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}
.logo__icon { color: var(--color-primary); font-size: 1.5rem; }
.logo__text span { color: var(--color-primary); }

.nav-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--gap-sm);
    display: block;
}
.site-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--color-secondary);
    flex-direction: column;
    padding: var(--gap-md);
    gap: var(--gap-sm);
    border-top: 1px solid rgba(255,255,255,0.1);
}
.site-nav.open { display: flex; }
.nav-link {
    color: rgba(255,255,255,0.85);
    padding: var(--gap-sm) var(--gap-md);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: background 0.2s;
}
.nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; }

@media (min-width: 768px) {
    .nav-toggle { display: none; }
    .site-nav {
        display: flex;
        position: static;
        flex-direction: row;
        padding: 0;
        border-top: none;
    }
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--color-secondary) 0%, #2d4a6b 100%);
    color: #fff;
    padding: var(--gap-xl) 0;
    text-align: center;
}
.hero__title {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--gap-sm);
}
.hero__title span { color: var(--color-primary); }
.hero__tagline {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    opacity: 0.8;
    margin-bottom: var(--gap-xl);
}
.hero__search {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: var(--gap-md);
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
    max-width: 680px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.hero__search select,
.hero__search input {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px var(--gap-md);
    font-size: 0.95rem;
    color: var(--color-text);
    width: 100%;
    background: #fff;
}
.hero__search select:focus,
.hero__search input:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}
.btn-search {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px var(--gap-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}
.btn-search:hover { background: var(--color-primary-dark); }

@media (min-width: 768px) {
    .hero__search { flex-direction: row; flex-wrap: wrap; }
    .hero__search select,
    .hero__search input { flex: 1; min-width: 150px; }
    .btn-search { width: auto; }
}

/* ── Section headings ───────────────────────────────────── */
.section { padding: var(--gap-xl) 0; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--gap-lg);
}
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-secondary);
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
}
.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.2em;
    background: var(--color-primary);
    border-radius: 2px;
}
.section-link {
    font-size: 0.875rem;
    color: var(--color-primary);
    font-weight: 600;
}
.section-link:hover { text-decoration: underline; }

/* ── Listing Grid ───────────────────────────────────────── */
.listing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-lg);
}
@media (min-width: 480px) {
    .listing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .listing-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Listing Card ───────────────────────────────────────── */
.card {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: box-shadow 0.25s, transform 0.25s;
    display: flex;
    flex-direction: column;
    position: relative;
}
.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}
.card__img-wrap {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #eee;
}
.card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.card:hover .card__img { transform: scale(1.04); }

.card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e0e0, #c8c8c8);
    color: #999;
    font-size: 2.5rem;
}

/* Status overlay */
.card__status-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #fff;
}
.card__status-overlay--sold {
    background: rgba(231, 76, 60, 0.75);
}
.card__status-overlay--reserved {
    background: rgba(243, 156, 18, 0.75);
}

/* Type badge (BARU / TERPAKAI) */
.card__type {
    position: absolute;
    top: var(--gap-sm);
    left: var(--gap-sm);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    color: #fff;
    text-transform: uppercase;
}
.card__type--new  { background: var(--color-new-badge); }
.card__type--used { background: var(--color-used-badge); }

/* Featured star */
.card__featured {
    position: absolute;
    top: var(--gap-sm);
    right: var(--gap-sm);
    color: #FFD700;
    font-size: 1.1rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

.card__body {
    padding: var(--gap-md);
    display: flex;
    flex-direction: column;
    gap: var(--gap-xs);
    flex: 1;
}
.card__brand { font-size: 0.75rem; color: var(--color-text-muted); text-transform: uppercase; }
.card__model { font-size: 1rem; font-weight: 700; color: var(--color-secondary); line-height: 1.2; }
.card__year  { font-size: 0.82rem; color: var(--color-text-muted); }
.card__price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-top: var(--gap-xs);
}

/* Feature badges */
.card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap-xs);
    margin-top: var(--gap-sm);
}
.badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 3px;
    color: #fff;
}
.badge--warranty  { background: var(--color-warranty); }
.badge--financing { background: var(--color-financing); }
.badge--gift      { background: var(--color-gift); }

.card__days {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    margin-top: auto;
    padding-top: var(--gap-sm);
    border-top: 1px solid var(--color-border);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--gap-sm);
    padding: 10px var(--gap-lg);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-align: center;
    justify-content: center;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-dark); }
.btn--secondary { background: var(--color-secondary); color: #fff; }
.btn--secondary:hover { background: #152845; }
.btn--wa {
    background: var(--color-accent);
    color: #fff;
    font-size: 1rem;
    padding: 14px var(--gap-xl);
}
.btn--wa:hover { background: #1da851; }
.btn--outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}
.btn--outline:hover { background: var(--color-primary); color: #fff; }

/* ── Flash messages ──────────────────────────────────────── */
.flash {
    position: fixed;
    top: var(--gap-lg);
    right: var(--gap-lg);
    z-index: 999;
    padding: var(--gap-md) var(--gap-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    box-shadow: var(--shadow-hover);
    transition: opacity 0.5s;
    max-width: 360px;
}
.flash--success { background: var(--color-available); color: #fff; }
.flash--error   { background: var(--color-sold); color: #fff; }
.flash--warning { background: var(--color-reserved); color: #fff; }
.flash--info    { background: var(--color-financing); color: #fff; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
    background: var(--color-secondary);
    color: rgba(255,255,255,0.8);
    margin-top: var(--gap-xl);
}
.footer-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-xl);
    padding: var(--gap-xl) var(--gap-md);
}
@media (min-width: 768px) {
    .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-brand .logo__icon { color: var(--color-primary); }
.footer-brand strong { font-size: 1.1rem; color: #fff; }
.footer-tagline { font-size: 0.85rem; margin-top: var(--gap-xs); opacity: 0.7; }
.footer-info p, .footer-links a {
    font-size: 0.875rem;
    margin-bottom: var(--gap-sm);
    display: block;
}
.footer-links a { opacity: 0.75; transition: opacity 0.2s; }
.footer-links a:hover { opacity: 1; }
.footer-info a { color: inherit; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    padding: var(--gap-md);
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ── Utilities ───────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-md { margin-top: var(--gap-md); }
.mt-lg { margin-top: var(--gap-lg); }
.mt-xl { margin-top: var(--gap-xl); }
.mb-md { margin-bottom: var(--gap-md); }

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
    background: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    padding: var(--gap-sm) 0;
}
.breadcrumb .container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--gap-sm);
}
.breadcrumb a { color: var(--color-primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span:last-child { color: var(--color-text); font-weight: 600; }

/* ── Listing Detail Layout ───────────────────────────────── */
.listing-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-xl);
    padding: var(--gap-xl) 0 var(--gap-lg);
}
@media (min-width: 900px) {
    .listing-detail {
        grid-template-columns: 1fr 400px;
        align-items: start;
    }
}

/* ── Photo Gallery ───────────────────────────────────────── */
.gallery__main {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: #eee;
}
.gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery__placeholder {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #e0e0e0, #c8c8c8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    gap: var(--gap-sm);
    font-size: 3rem;
}
.gallery__placeholder p { font-size: 0.9rem; }
.gallery__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #fff;
    pointer-events: none;
}
.gallery__overlay--sold     { background: rgba(231,76,60,0.8); }
.gallery__overlay--reserved { background: rgba(243,156,18,0.8); }
.gallery__thumbs {
    display: flex;
    gap: var(--gap-sm);
    margin-top: var(--gap-sm);
    overflow-x: auto;
    padding-bottom: var(--gap-xs);
    scroll-snap-type: x mandatory;
}
.gallery__thumbs::-webkit-scrollbar { height: 4px; }
.gallery__thumbs::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
.gallery__thumb {
    flex-shrink: 0;
    width: 72px;
    height: 54px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: none;
    scroll-snap-align: start;
    transition: border-color 0.15s;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery__thumb.active { border-color: var(--color-primary); }
.gallery__thumb:hover:not(.active) { opacity: 0.8; }

/* ── Listing Info Panel ──────────────────────────────────── */
.listing-status-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--gap-sm);
    margin-bottom: var(--gap-md);
}
.type-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.type-badge--new  { background: var(--color-new-badge); }
.type-badge--used { background: var(--color-used-badge); }
.status-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    color: #fff;
}
.status-pill--available { background: var(--color-available); }
.status-pill--reserved  { background: var(--color-reserved); }
.status-pill--sold      { background: var(--color-sold); }
.featured-tag { font-size: 0.78rem; font-weight: 600; color: #b8860b; }
.listing-title {
    font-size: clamp(1.4rem, 4vw, 1.9rem);
    font-weight: 800;
    color: var(--color-secondary);
    line-height: 1.2;
    margin-bottom: var(--gap-sm);
}
.listing-price {
    font-size: clamp(1.7rem, 5vw, 2.2rem);
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: var(--gap-md);
}
.listing-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap-sm);
    margin-bottom: var(--gap-lg);
}
.wa-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
    margin-bottom: var(--gap-md);
}
.btn--block { width: 100%; }
.btn--wa2 { background: #128C7E; }
.btn--wa2:hover { background: #0e6b61; }
.wa-not-configured {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    padding: var(--gap-sm) var(--gap-md);
    background: #f5f5f5;
    border-radius: var(--radius-sm);
    text-align: center;
}
.sold-notice {
    background: #fff5f5;
    border: 1px solid #fcc;
    border-radius: var(--radius-md);
    padding: var(--gap-md);
    text-align: center;
    margin-bottom: var(--gap-md);
}
.sold-notice p { color: var(--color-sold); font-weight: 600; margin-bottom: var(--gap-sm); }
.listing-meta {
    display: flex;
    gap: var(--gap-md);
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: var(--gap-sm);
    padding-top: var(--gap-sm);
    border-top: 1px solid var(--color-border);
}

/* ── Detail Sections ─────────────────────────────────────── */
.detail-section {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: var(--gap-lg);
    margin-bottom: var(--gap-lg);
    box-shadow: var(--shadow-card);
}
.detail-section__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-secondary);
    margin-bottom: var(--gap-md);
    padding-bottom: var(--gap-sm);
    border-bottom: 2px solid var(--color-primary);
    display: inline-block;
}
.detail-section__sub {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: var(--gap-md);
}

/* Specs Table */
.specs-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.specs-table th,
.specs-table td {
    padding: var(--gap-sm) var(--gap-md);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}
.specs-table th {
    color: var(--color-text-muted);
    font-weight: 600;
    width: 40%;
    background: var(--color-bg);
}
.specs-table td { color: var(--color-text); font-weight: 500; }
@media (min-width: 480px) { .specs-table th { width: 30%; } }

/* Instalment Table */
.instalment-wrap { overflow-x: auto; margin-bottom: var(--gap-sm); }
.instalment-table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 0.88rem; }
.instalment-table th,
.instalment-table td {
    padding: var(--gap-sm) var(--gap-md);
    text-align: center;
    border: 1px solid var(--color-border);
}
.instalment-table thead th { background: var(--color-secondary); color: #fff; font-weight: 600; }
.instalment-table tbody tr:nth-child(even) { background: var(--color-bg); }
.monthly-highlight { font-weight: 700; color: var(--color-primary); }
.instalment-note { font-size: 0.78rem; color: var(--color-text-muted); font-style: italic; }

/* Description */
.listing-description { font-size: 0.92rem; line-height: 1.75; color: var(--color-text); }

/* Similar Bikes */
.similar-section { margin-bottom: var(--gap-xl); }
.listing-grid--3 { grid-template-columns: 1fr; }
@media (min-width: 480px) { .listing-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .listing-grid--3 { grid-template-columns: repeat(3, 1fr); } }

/* ── Search Page ─────────────────────────────────────────── */
.search-hero {
    background: var(--color-secondary);
    color: #fff;
    padding: var(--gap-lg) 0;
}
.search-hero__title { font-size: 1.5rem; font-weight: 700; }
.search-filters {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: var(--gap-lg);
    margin: var(--gap-lg) 0;
    box-shadow: var(--shadow-card);
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap-md);
    align-items: flex-end;
}
.filter-row + .filter-row {
    margin-top: var(--gap-md);
    padding-top: var(--gap-md);
    border-top: 1px solid var(--color-border);
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--gap-xs);
    flex: 1;
    min-width: 140px;
}
.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.filter-group select,
.filter-group input[type="number"] {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 9px var(--gap-md);
    font-size: 0.9rem;
    color: var(--color-text);
    background: #fff;
    width: 100%;
}
.filter-group select:focus,
.filter-group input:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.filter-range { display: flex; align-items: center; gap: var(--gap-sm); }
.filter-range input,
.filter-range select { flex: 1; min-width: 0; }
.filter-group--actions {
    display: flex;
    flex-direction: row;
    gap: var(--gap-sm);
    align-items: flex-end;
    flex: 0 0 auto;
    min-width: auto;
}
.results-header { margin-bottom: var(--gap-lg); }
.results-count { font-size: 0.9rem; color: var(--color-text-muted); font-weight: 600; }
.no-results { text-align: center; padding: 4rem var(--gap-md); color: var(--color-text-muted); }
.no-results__icon { font-size: 3rem; margin-bottom: var(--gap-md); }
.no-results h2 { font-size: 1.2rem; color: var(--color-secondary); margin-bottom: var(--gap-sm); }
.no-results a { color: var(--color-primary); text-decoration: underline; }
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--gap-sm);
    padding: var(--gap-xl) 0;
    flex-wrap: wrap;
}
.pagination__btn {
    padding: 8px var(--gap-lg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-secondary);
    background: var(--color-bg-card);
    transition: background 0.2s;
}
.pagination__btn:hover { background: var(--color-bg); }
.pagination__pages { display: flex; gap: var(--gap-xs); }
.pagination__page {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-secondary);
    background: var(--color-bg-card);
    transition: all 0.15s;
}
.pagination__page:hover,
.pagination__page.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
