/* ============================================
   STOCK LIST PAGE - PROFESSIONAL STYLING
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
}

/* ============================================
   NAVIGATION
   ============================================ */

.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: static;
    z-index: 100;
}

.nav-container {
    max-width: none;
    margin: 0;
    padding: 0.2rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.nav-logo-img {
    display: block;
    height: 120px;
    width: auto;
    max-width: min(280px, 48vw);
    object-fit: contain;
    object-position: left center;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    filter: none;
    image-rendering: auto;
}

.nav-logo a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-logo a:hover {
    color: #764ba2;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.auth-hidden {
    display: none;
}

.nav-link {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.hero-content h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* ============================================
   SEARCH SECTION
   ============================================ */

.search-section {
    background: white;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin: 2rem;
    border-radius: 12px;
}

.search-container {
    max-width: 1400px;
    margin: 0 auto;
}

.search-container h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.search-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-field label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.search-field input,
.search-field select {
    padding: 0.9rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: white;
    transition: all 0.3s ease;
}

.search-field input:focus,
.search-field select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #f8faff;
}

.search-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
}

.btn-search,
.btn-reset {
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.btn-search {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.btn-reset {
    background: #f0f0f0;
    color: #7f8c8d;
}

.btn-reset:hover {
    background: #e8e8e8;
    color: #2c3e50;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* ============================================
   SIDEBAR - MAKES
   ============================================ */

.sidebar-left {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 16px;
    align-self: start;   /* required for sticky inside CSS grid */
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0;
}

.sidebar-title i {
    color: #667eea;
}

.makes-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.make-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.make-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.make-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left-color: #667eea;
    font-weight: 600;
    color: #667eea;
}

.make-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: #0a0a0a;
    border-radius: 8px;
    overflow: hidden;
    padding: 3px;
}

.make-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.make-logo-placeholder {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.make-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.make-name {
    font-weight: 600;
    color: #2c3e50;
}

.make-count {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   CONTENT RIGHT
   ============================================ */

.content-right {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.results-info h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.results-info p {
    color: #7f8c8d;
    font-size: 0.95rem;
}

.sort-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-container label {
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
}

.sort-container select {
    padding: 0.8rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sort-container select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ============================================
   CARS GRID
   ============================================ */

.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.car-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.car-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.car-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.car-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.car-image-container i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.3);
    position: absolute;
}

.status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@keyframes availableDanceBadge {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
    25% { transform: translateY(-3px) rotate(-2deg) scale(1.05); }
    50% { transform: translateY(0) rotate(0deg) scale(1.08); }
    75% { transform: translateY(-3px) rotate(2deg) scale(1.05); }
}

@keyframes reservedPulseBadge {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.06); filter: brightness(1.12); }
}

@keyframes soldGlitchBadge {
    0%, 100% { transform: translateX(0); filter: grayscale(0.2); }
    20% { transform: translateX(-1px); }
    40% { transform: translateX(1px); }
    60% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
}

.status-badge.available {
    background: linear-gradient(135deg, #69f0ae 0%, #00e676 45%, #00c853 100%);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(0, 200, 83, 0.4);
    animation: availableDanceBadge 1s ease-in-out infinite;
}

.status-badge.reserved {
    background: linear-gradient(135deg, #ffd180 0%, #ffb300 55%, #ff8f00 100%);
    color: #4e342e;
    box-shadow: 0 10px 22px rgba(255, 143, 0, 0.35);
    animation: reservedPulseBadge 1.35s ease-in-out infinite;
}

.status-badge.sold {
    background: linear-gradient(135deg, #ff8a80 0%, #ff5252 55%, #ff1744 100%);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(255, 23, 68, 0.34);
    animation: soldGlitchBadge 1.8s steps(2, end) infinite;
}

@media (prefers-reduced-motion: reduce) {
    .status-badge.available,
    .status-badge.reserved,
    .status-badge.sold {
        animation: none;
    }
}

.car-details {
    padding: 1rem 1.1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.car-title {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.2px;
    color: #2c3e50;
    margin-bottom: 0.2rem;
}

.car-make-model {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-bottom: 0.65rem;
}

.car-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.65rem;
}

.car-specs-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    padding: 0.65rem 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.spec-item {
    text-align: center;
}

.spec-icon {
    color: #667eea;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
    display: block;
}

.spec-label {
    font-size: 0.7rem;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.spec-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2c3e50;
    display: block;
}

.car-desc {
    color: #555;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    flex: 1;
}

.car-actions {
    display: flex;
    gap: 0.8rem;
}

.btn-view-details,
.btn-inquire {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-view-details {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.btn-view-details:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.btn-inquire {
    background: #f0f0f0;
    color: #7f8c8d;
}

.btn-inquire:hover {
    background: #e8e8e8;
    color: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ============================================
   NO RESULTS
   ============================================ */

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: none;
}

.no-results i {
    font-size: 4rem;
    color: #bdc3c7;
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.btn-reset-search {
    display: inline-block;
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-reset-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* ============================================
   MODAL STYLING - PROFESSIONAL DESIGN
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: transparent;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    cursor: pointer;
    z-index: 1;
}

.modal-wrapper {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.3s ease;
}

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

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid #ecf0f1;
    background: #f8f9fa;
    border-radius: 15px 15px 0 0;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #bdc3c7;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background: #e8e8e8;
    color: #e74c3c;
    transform: scale(1.1);
}

/* Modal Grid */
.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    flex: 1;
}

/* Modal Left - Images */
.modal-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-image {
    position: relative;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    background: #f4f6f8;
}

.image-placeholder {
    width: 100%;
    background: #f4f6f8;
    border-radius: 12px;
}

.image-placeholder img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

#modalCarImage {
    display: none;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

/* Modal Meta */
.modal-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.meta-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    border-left: 4px solid #667eea;
}

.meta-item i {
    font-size: 1.5rem;
    color: #667eea;
    min-width: 30px;
    text-align: center;
    margin-top: 0.3rem;
}

.meta-item label {
    font-size: 0.8rem;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.meta-item span {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    display: block;
}

/* Modal Right - Details */
.modal-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.subtitle {
    font-size: 1rem;
    color: #7f8c8d;
    margin: 0;
}

.price-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.status-label {
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    background: #d4edda;
    color: #155724;
}

.status-label.reserved {
    background: #fff3cd;
    color: #856404;
}

.status-label.sold {
    background: #f8d7da;
    color: #721c24;
}

/* Specifications */
.specifications {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.specifications h3 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 1rem;
}

.specs-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.spec-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.spec-value {
    color: #7f8c8d;
    font-weight: 500;
    text-align: right;
}

/* Description */
.description {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.description h3 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 1rem;
}

.description p {
    color: #555;
    line-height: 1.8;
    margin: 0;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    gap: 1rem;
    padding: 2rem;
    border-top: 1px solid #ecf0f1;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

.btn-close-modal,
.btn-full-details {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.btn-close-modal {
    background: #f0f0f0;
    color: #7f8c8d;
}

.btn-close-modal:hover {
    background: #e0e0e0;
    color: #2c3e50;
    transform: translateY(-2px);
}

.btn-full-details {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.btn-full-details:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */

.toast {
    position: fixed;
    bottom: -120px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 1.2rem 2rem;
    border-radius: 8px;
    z-index: 2000;
    transition: bottom 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    text-align: center;
    font-weight: 500;
}

.toast.show {
    bottom: 2rem;
}

.toast.success {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.toast.error {
    background: linear-gradient(135deg, #f44336 0%, #da190b 100%);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: #2c3e50;
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 220px 1fr;
    }

    .modal-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

    .modal-wrapper {
        width: 95%;
    }

    .modal-content {
        max-height: 95vh;
    }
}

@media (max-width: 1024px) {
    .cars-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

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

    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .search-section {
        margin: 1rem;
    }

    .search-row {
        grid-template-columns: 1fr;
    }

    .search-actions {
        flex-direction: column;
    }

    .btn-search,
    .btn-reset {
        width: 100%;
        justify-content: center;
    }

    .main-content {
        padding: 1rem;
        gap: 0.75rem;
        grid-template-columns: 110px 1fr;
    }

    .sidebar-left {
        padding: 0.85rem 0.6rem;
        top: 12px;
    }

    .sidebar-title {
        font-size: 0.82rem;
        gap: 0.4rem;
    }

    .make-item {
        padding: 0.6rem 0.5rem;
        gap: 0.5rem;
    }

    .make-logo-container {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
        padding: 2px;
        background: #0a0a0a;
        border-radius: 6px;
    }

    .make-logo-img {
        width: 100%;
        height: 100%;
    }

    .make-logo-placeholder {
        width: 36px;
        height: 36px;
        font-size: 0.75rem;
        border-radius: 6px;
        flex-shrink: 0;
    }

    .make-name {
        font-size: 0.82rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .make-count {
        font-size: 0.72rem;
    }

    .cars-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .car-specs-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        padding: 0.8rem;
    }

    .spec-item {
        font-size: 0.8rem;
    }

    .spec-icon {
        font-size: 1rem;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.3rem;
    }

    .modal-grid {
        padding: 1.5rem;
        gap: 1rem;
    }

    .modal-meta {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .meta-item {
        padding: 1rem;
    }

    .specifications,
    .description {
        padding: 1rem;
    }

    .price-box {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .modal-footer {
        flex-direction: column;
        padding: 1.5rem;
        gap: 0.8rem;
    }

    .btn-close-modal,
    .btn-full-details {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.8rem 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .nav-link {
        padding: 0.8rem 0;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .search-section {
        margin: 0.5rem;
        padding: 1rem;
    }

    .search-container h2 {
        font-size: 1.2rem;
    }

    .main-content {
        padding: 0.5rem;
        grid-template-columns: 90px 1fr;
        gap: 0.5rem;
    }

    .sidebar-left {
        padding: 0.65rem 0.4rem;
    }

    .make-item {
        padding: 0.5rem 0.35rem;
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }

    .make-logo-container {
        width: 32px;
        height: 32px;
        justify-content: center;
        padding: 2px;
        background: #0a0a0a;
        border-radius: 6px;
    }

    .make-logo-img {
        width: 100%;
        height: 100%;
    }

    .make-logo-placeholder {
        width: 32px;
        height: 32px;
        font-size: 0.65rem;
    }

    .make-info { align-items: center; }

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

    .results-header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.8rem;
    }

    .sort-container {
        width: 100%;
    }

    .sort-container select {
        width: 100%;
    }

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

    .car-spec-item:nth-child(3) {
        grid-column: 1 / -1;
    }

    .modal-header {
        padding: 1rem 1rem 0.75rem;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        position: relative;
    }

    .modal-title {
        font-size: 1rem;
        flex: 1;
        padding-right: 2.5rem;
        line-height: 1.3;
    }

    .close-modal {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        flex-shrink: 0;
    }

    .modal-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 100%;
        border-radius: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-content {
        border-radius: 0;
        min-height: 100%;
    }

    .modal-grid {
        padding: 0.75rem;
        gap: 0.6rem;
    }

    .modal-meta {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .meta-item {
        padding: 0.6rem 0.5rem;
        gap: 0.4rem;
        flex-direction: column;
        align-items: center;
        text-align: center;
        border-left: none;
        border-top: 3px solid #667eea;
    }

    .meta-item i {
        font-size: 1.1rem;
        margin-top: 0;
        min-width: unset;
    }

    .meta-item label {
        font-size: 0.65rem;
    }

    .meta-item span {
        font-size: 0.9rem;
    }

    .price-box {
        padding: 0.9rem 1rem;
        gap: 0.6rem;
    }

    .price {
        font-size: 1.4rem;
    }

    .specifications {
        max-height: none;
        padding: 1rem;
    }

    .spec-row {
        flex-direction: row;
        gap: 0;
        padding: 0.6rem 0.75rem;
    }

    .spec-label {
        font-size: 0.82rem;
        flex: 1;
    }

    .spec-value {
        font-size: 0.82rem;
        flex: 1;
        text-align: right;
    }

    .description {
        padding: 1rem;
    }

    .image-placeholder {
        border-radius: 10px;
    }

    .modal-footer {
        padding: 1rem;
        gap: 0.5rem;
        position: sticky;
        bottom: 0;
        background: #f8f9fa;
        z-index: 5;
    }

    .btn-close-modal,
    .btn-full-details {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
        font-size: 0.9rem;
        gap: 0.5rem;
    }

    .no-results {
        padding: 2rem 1rem;
    }

    .no-results i {
        font-size: 3rem;
    }
}

/* Theme alignment with landing page */
body {
    background: linear-gradient(to bottom, #eef3f8, #f8fbff);
}

.nav-logo i,
.nav-logo a,
.nav-link:hover,
.nav-link.active,
.section-title,
.spec i {
    color: #1f4b6e;
}

.nav-link.active,
.nav-link:hover {
    border-bottom-color: #1f4b6e;
}

.hero-section,
.btn-view-details,
.btn-search,
.pagination-btn.active {
    background:
        radial-gradient(circle at 20% 15%, rgba(227, 155, 87, 0.22), transparent 45%),
        linear-gradient(130deg, #14344f 0%, #1f4b6e 52%, #7d3b2a 100%);
}