*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --red: #E2001A;
    --red-dark: #b5001a;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-400: #9ca3af;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    --white: #ffffff;
    --radius: 6px;
    --shadow: 0 1px 4px rgba(0,0,0,.10);
    --shadow-lg: 0 4px 24px rgba(0,0,0,.12);
}

body { font-family: 'Inter', system-ui, sans-serif; color: var(--gray-800); background: var(--white); line-height: 1.5; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }

/* NAV */
.navbar {
    display: flex; align-items: center; gap: 32px; padding: 0 24px;
    height: 58px; background: var(--white); border-bottom: 1px solid var(--gray-200);
    position: sticky; top: 0; z-index: 100;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.navbar-wrapper {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-logo { font-size: 1.25rem; font-weight: 800; color: var(--red); letter-spacing: -.5px; white-space: nowrap; }
.navbar-links { display: flex; gap: 4px; flex: 1; }
.navbar-links a { padding: 6px 12px; border-radius: var(--radius); font-size: .9rem; color: var(--gray-600); font-weight: 500; transition: background .15s; }
.navbar-links a:hover { background: var(--gray-100); color: var(--gray-800); }

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-800);
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    z-index: 99;
    overflow-y: auto;
    padding: 20px;
}

.mobile-menu-content {
    max-width: 1200px;
    margin: 0 auto;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu a {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
    font-weight: 500;
}

.mobile-menu a:hover {
    background: var(--gray-50);
    color: var(--red);
}

/* DROPDOWN MENU */
.nav-dropdown { position: relative; }
.nav-dropdown > a::after {
    content: '▼';
    font-size: 0.6rem;
    margin-left: 4px;
    opacity: 0.5;
}
.nav-dropdown:hover > a { background: var(--gray-100); color: var(--gray-800); }
.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 700px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}
.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.dropdown-col h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-100);
}
.dropdown-col a {
    display: block;
    padding: 6px 0;
    font-size: 0.85rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.15s;
}
.dropdown-col a:hover {
    color: var(--red);
    background: transparent;
}
.dropdown-highlight {
    background: var(--gray-50);
    padding: 16px;
    border-radius: 8px;
}
.dropdown-highlight h4 {
    color: var(--red);
    border-bottom-color: var(--red);
}
.navbar-cta { margin-left: auto; background: var(--red); color: var(--white); border: none; padding: 9px 18px; border-radius: var(--radius); font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; transition: background .15s; }
.navbar-cta:hover { background: var(--red-dark); }

/* HERO */
.hero {
    background: url('https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?w=1400&q=80') center/cover no-repeat;
    position: relative; padding: 80px 24px 64px;
}
.hero::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.52); }
.hero-inner { position: relative; max-width: 760px; margin: 0 auto; }
.hero h1 { color: var(--white); font-size: 2.4rem; font-weight: 800; margin-bottom: 28px; line-height: 1.15; }
.hero h1 span { color: var(--red); }

/* SEARCH FORM */
.search-box { background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-lg); }
.search-tabs { display: flex; border-bottom: 1px solid var(--gray-200); }
.search-tab { flex: 1; padding: 14px; text-align: center; font-weight: 600; font-size: .95rem; cursor: pointer; color: var(--gray-600); border: none; background: none; transition: color .15s; }
.search-tab.active { color: var(--red); border-bottom: 2px solid var(--red); }
.search-fields { padding: 20px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.search-fields select, .search-fields input { width: 100%; padding: 11px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: .9rem; background: var(--gray-50); color: var(--gray-800); appearance: none; -webkit-appearance: none; }
.search-fields select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.search-btn-row { grid-column: 1/-1; }
.search-btn { width: 100%; padding: 13px; background: var(--red); color: var(--white); border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 700; cursor: pointer; transition: background .15s; }
.search-btn:hover { background: var(--red-dark); }

/* STATS */
.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--gray-200); }
.stat-item { padding: 28px 24px; text-align: center; border-right: 1px solid var(--gray-200); }
.stat-item:last-child { border-right: none; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--gray-800); }
.stat-label { font-size: .8rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }

/* SECTION */
.section { padding: 48px 24px; max-width: 1200px; margin: 0 auto; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; }
.section-title { font-size: 1.4rem; font-weight: 800; position: relative; padding-left: 14px; }
.section-title::before { content: ''; position: absolute; left: 0; top: 2px; bottom: 2px; width: 4px; background: var(--red); border-radius: 2px; }
.section-link { font-size: .9rem; color: var(--red); font-weight: 600; }
.section-link:hover { text-decoration: underline; }

/* BRANDS GRID */
.brands-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.brand-card { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px 16px; text-align: center; cursor: pointer; transition: box-shadow .15s, border-color .15s; text-decoration: none; display: block; }
.brand-card:hover { border-color: var(--red); box-shadow: var(--shadow-lg); }
.brand-card img { width: 80px; height: 80px; object-fit: contain; margin: 0 auto 10px; }
.brand-card .brand-name { font-size: .85rem; font-weight: 600; color: var(--gray-800); }
.brand-card .brand-count { font-size: .75rem; color: var(--gray-400); }

/* LISTING GRID */
.listings-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.listing-card { border: 1px solid var(--gray-200); border-radius: 10px; overflow: hidden; cursor: pointer; transition: box-shadow .15s; text-decoration: none; display: block; }
.listing-card:hover { box-shadow: var(--shadow-lg); }
.listing-card img { width: 100%; height: 200px; object-fit: cover; }
.listing-card-body { padding: 14px 16px 16px; }
.listing-price { font-size: 1.3rem; font-weight: 800; color: var(--gray-800); }
.listing-title { font-size: .95rem; font-weight: 600; color: var(--gray-800); margin: 4px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing-specs { display: flex; gap: 10px; flex-wrap: wrap; font-size: .78rem; color: var(--gray-600); }
.listing-specs span { display: flex; align-items: center; gap: 4px; }
.listing-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--gray-100); }
.badge { font-size: .72rem; padding: 3px 8px; border-radius: 20px; font-weight: 600; }
.badge-private { background: #f0f4ff; color: #3b5bdb; }
.badge-dealer { background: #fff0f0; color: var(--red); }
.listing-date { font-size: .75rem; color: var(--gray-400); }

/* FILTERS SIDEBAR */
.results-layout { display: grid; grid-template-columns: 260px 1fr; gap: 28px; max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.filters-panel { background: var(--white); border: 1px solid var(--gray-200); border-radius: 10px; padding: 20px; height: fit-content; }
.filters-title { font-weight: 700; font-size: 1rem; margin-bottom: 16px; color: var(--gray-800); }
.filter-group { margin-bottom: 18px; }
.filter-label { font-size: .82rem; color: var(--gray-600); font-weight: 600; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.filter-group select, .filter-group input { width: 100%; padding: 9px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: .9rem; background: var(--gray-50); color: var(--gray-800); }
.filter-group select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.filter-submit { width: 100%; padding: 11px; background: var(--red); color: var(--white); border: none; border-radius: var(--radius); font-weight: 700; cursor: pointer; font-size: .95rem; }
.filter-submit:hover { background: var(--red-dark); }
.results-count { font-size: .95rem; color: var(--gray-600); margin-bottom: 20px; }
.results-count strong { color: var(--gray-800); }

/* PAGINATION */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 36px; }
.page-btn { padding: 8px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius); background: var(--white); font-size: .9rem; cursor: pointer; font-weight: 500; color: var(--gray-600); text-decoration: none; }
.page-btn:hover { border-color: var(--red); color: var(--red); }
.page-btn.active { background: var(--red); color: var(--white); border-color: var(--red); }

/* DETAIL PAGE */
.detail-layout { max-width: 1200px; margin: 0 auto; padding: 32px 24px; display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }

/* IMAGE GALLERY */
.image-gallery { margin-bottom: 24px; }
.main-image-container { position: relative; margin-bottom: 12px; }
.detail-main img.detail-photo { width: 100%; height: 420px; object-fit: cover; border-radius: 10px; cursor: pointer; }
.image-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}
.thumbnail-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
}
.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}
.thumbnail:hover {
    border-color: var(--gray-300);
}
.thumbnail.active {
    border-color: var(--red);
    opacity: 1;
}
.detail-heading { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.detail-sub { color: var(--gray-600); font-size: .95rem; margin-bottom: 20px; }
.specs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.spec-item { background: var(--gray-50); border-radius: var(--radius); padding: 12px 16px; }
.spec-label { font-size: .75rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: .4px; }
.spec-value { font-size: 1rem; font-weight: 700; color: var(--gray-800); margin-top: 2px; }
.detail-desc { margin-top: 24px; }
.detail-desc h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.detail-desc p { font-size: .95rem; color: var(--gray-600); line-height: 1.7; }

.seller-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: 10px; padding: 24px; position: sticky; top: 74px; }
.seller-price { font-size: 2rem; font-weight: 800; color: var(--gray-800); margin-bottom: 4px; }
.seller-name { font-size: .95rem; color: var(--gray-600); margin-bottom: 20px; }
.contact-btn { width: 100%; padding: 14px; background: var(--red); color: var(--white); border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 700; cursor: pointer; margin-bottom: 10px; }
.contact-btn:hover { background: var(--red-dark); }
.contact-btn-outline { width: 100%; padding: 13px; background: var(--white); color: var(--gray-800); border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: 1rem; font-weight: 600; cursor: pointer; }
.contact-btn-outline:hover { border-color: var(--gray-400); }

/* FORM PAGE */
.form-page { max-width: 760px; margin: 0 auto; padding: 40px 24px; }
.form-page h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 6px; }
.form-page .subtitle { color: var(--gray-600); margin-bottom: 32px; }
.form-section { background: var(--white); border: 1px solid var(--gray-200); border-radius: 10px; padding: 24px; margin-bottom: 20px; }
.form-section h2 { font-size: 1rem; font-weight: 700; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-100); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.full { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--gray-600); }
.form-group input, .form-group select, .form-group textarea { padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: .95rem; background: var(--gray-50); color: var(--gray-800); transition: border-color .15s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--red); }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-submit { width: 100%; padding: 15px; background: var(--red); color: var(--white); border: none; border-radius: var(--radius); font-size: 1.05rem; font-weight: 700; cursor: pointer; margin-top: 8px; }
.form-submit:hover { background: var(--red-dark); }
.alert { padding: 14px 18px; border-radius: var(--radius); font-size: .95rem; margin-bottom: 20px; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error { background: #fff0f0; color: #b91c1c; border: 1px solid #fecaca; }

/* BREADCRUMB */
.breadcrumb { max-width: 1200px; margin: 0 auto; padding: 16px 24px 0; display: flex; gap: 8px; font-size: .85rem; color: var(--gray-400); }
.breadcrumb a { color: var(--gray-600); }
.breadcrumb a:hover { color: var(--red); }
.breadcrumb span { color: var(--gray-300); }

/* FOOTER */
footer { background: var(--gray-800); color: #e5e7eb; padding: 48px 24px 24px; margin-top: 64px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; max-width: 1200px; margin: 0 auto 32px; }
.footer-col h3 { font-size: .9rem; font-weight: 700; color: var(--white); margin-bottom: 12px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a { font-size: .85rem; color: #9ca3af; transition: color .15s; }
.footer-col ul li a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid #374151; padding-top: 20px; text-align: center; font-size: .82rem; color: #6b7280; max-width: 1200px; margin: 0 auto; }

/* UTILS */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--gray-600); font-size: .9rem; margin-bottom: 20px; }
.back-link:hover { color: var(--red); }

@media (max-width: 900px) {
    .listings-grid { grid-template-columns: 1fr 1fr; }
    .brands-grid { grid-template-columns: repeat(3, 1fr); }
    .stats-bar { grid-template-columns: 1fr 1fr; }
    .detail-layout { grid-template-columns: 1fr; }
    .results-layout { grid-template-columns: 1fr; }
    .search-fields { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .dropdown-menu { min-width: 500px; }
    .dropdown-grid { grid-template-columns: repeat(2, 1fr); }
    .navbar { gap: 16px; padding: 0 16px; }
    .navbar-cta { padding: 8px 14px; font-size: 0.85rem; }
}

@media (max-width: 600px) {
    /* Navigation mobile */
    .navbar { padding: 0 12px; gap: 8px; height: auto; min-height: 58px; flex-wrap: wrap; }
    .navbar-logo img { height: 40px; }
    .navbar-links { display: none; }
    .mobile-menu-toggle { display: block !important; }
    .navbar-cta { 
        display: none; /* Hide on mobile, shown in mobile menu instead */
    }
    
    /* Hero mobile */
    .hero { padding: 40px 16px 32px; }
    .hero h1 { font-size: 1.5rem; line-height: 1.2; margin-bottom: 20px; }
    
    /* Search mobile */
    .search-fields { grid-template-columns: 1fr; gap: 10px; padding: 16px; }
    .search-tab { font-size: 0.85rem; padding: 12px; }
    
    /* Stats mobile */
    .stats-bar { grid-template-columns: 1fr 1fr; }
    .stat-item { padding: 20px 12px; }
    .stat-value { font-size: 1.5rem; }
    .stat-label { font-size: 0.75rem; }
    
    /* Grids mobile */
    .listings-grid { grid-template-columns: 1fr; gap: 16px; }
    .brands-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    
    /* Cards mobile */
    .listing-card img { height: 180px; }
    .listing-card-body { padding: 12px; }
    .listing-price { font-size: 1.1rem; }
    .listing-title { font-size: 0.9rem; }
    .listing-specs { font-size: 0.72rem; gap: 6px; }
    
    /* Section mobile */
    .section { padding: 32px 16px; }
    .section-title { font-size: 1.2rem; }
    
    /* Footer mobile */
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    footer { padding: 32px 16px 16px; margin-top: 48px; }
    
    /* Forms mobile */
    .form-page { padding: 24px 16px; }
    .form-page h1 { font-size: 1.5rem; }
    .form-grid { grid-template-columns: 1fr; }
    .form-section { padding: 16px; }
    .form-section h2 { font-size: 0.95rem; }
    
    /* Detail page mobile */
    .detail-layout { grid-template-columns: 1fr; gap: 20px; padding: 20px 16px; }
    .detail-photo { height: 250px !important; }
    .detail-heading { font-size: 1.3rem; }
    .specs-grid { grid-template-columns: 1fr; gap: 10px; }
    .seller-card { position: static; }
    
    /* Filters mobile */
    .filters-panel { margin-bottom: 20px; }
    .results-count { font-size: 0.9rem; }
    
    /* Pagination mobile */
    .pagination { gap: 6px; flex-wrap: wrap; }
    .page-btn { padding: 6px 10px; font-size: 0.85rem; }
    
    /* Breadcrumb mobile */
    .breadcrumb { padding: 12px 16px 0; font-size: 0.8rem; }
    
    /* Dropdown mobile - hide on mobile */
    .dropdown-menu { display: none !important; }
    .nav-dropdown > a::after { display: none; }
}

/* Tablet landscape */
@media (min-width: 601px) and (max-width: 900px) {
    .navbar-links { 
        display: flex; 
        gap: 2px;
        font-size: 0.85rem;
    }
    .navbar-links a { padding: 5px 8px; font-size: 0.8rem; }
    .dropdown-menu { min-width: 400px; }
    .dropdown-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .dropdown-col h4 { font-size: 0.75rem; }
    .dropdown-col a { font-size: 0.8rem; }
}

/* Small mobile */
@media (max-width: 400px) {
    .stats-bar { grid-template-columns: 1fr; }
    .stat-item { border-right: none; border-bottom: 1px solid var(--gray-200); }
    .stat-item:last-child { border-bottom: none; }
    .brands-grid { grid-template-columns: 1fr; }
    .brand-card { padding: 16px; }
    .hero h1 { font-size: 1.3rem; }
    .navbar-logo img { height: 35px; }
}

/* BUTTONS & PAGINATION */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: all .15s;
}
.btn-secondary {
    background: var(--white);
    color: var(--gray-600);
}
.btn-secondary:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}
.pagination {
    flex-wrap: wrap;
}
.pagination .btn {
    min-width: 40px;
    height: 40px;
}
