/* Enhanced CarBazaar Car View CSS */
/* Mobile-first responsive design inspired by DoneDeal 2026 */

/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    background: #f8f9fa;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
    line-height: 1.5;
}

/* Back button */
.back-button-container {
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-button:hover {
    color: #22c55e;
}

/* Main container */
.car-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
}

/* Hero Gallery Section */
.hero-gallery {
    position: relative;
    background: #fff;
}

.main-photo-wrapper {
    position: relative;
    width: 100%;
    height: 75vw;
    max-height: 400px;
    background: #f3f4f6;
    overflow: hidden;
}

.photo-loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    pointer-events: none;
}

.photo-loading-spinner .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.main-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.main-photo:active {
    transform: scale(0.98);
}

.no-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    background: #f9fafb;
}

.no-photo-placeholder i {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Price badge overlay */
.price-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #22c55e;
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    z-index: 2;
}

.price-badge .original-price {
    text-decoration: line-through;
    opacity: 0.8;
    font-size: 16px;
    display: block;
    margin-bottom: 2px;
}

.price-badge .sold-text {
    background: #ef4444;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
    margin-top: 2px;
}

/* Navigation arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 3;
    font-size: 18px;
}

.nav-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.nav-prev {
    left: 16px;
}

.nav-next {
    right: 16px;
}

/* Photo indicator */
.photo-indicator {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    z-index: 2;
}

/* Action buttons */
.photo-actions {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.action-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #374151;
}

.action-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn.save-btn.favorited {
    background: #22c55e;
    color: white;
}

.action-btn.save-btn.favorited:hover {
    background: #16a34a;
}

/* Thumbnail carousel */
.thumbnail-carousel {
    display: flex;
    gap: 8px;
    padding: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 100%;
}

.thumbnail-carousel::-webkit-scrollbar {
    display: none;
}

.thumbnail {
    flex: 0 0 80px;
    min-width: 80px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
    border: 2px solid transparent;
}

.thumbnail:hover {
    opacity: 1;
}

.thumbnail.active {
    opacity: 1;
    border-color: #22c55e;
    box-shadow: 0 0 0 1px #22c55e;
}

/* Car Details Section */
.car-details {
    padding: 20px 16px;
}

.car-header {
    margin-bottom: 24px;
}

.car-price {
    font-size: 24px;
    color: #111827;
    font-weight: 700;
    margin-bottom: 12px;
}

.car-price.sold-price .original-price {
    text-decoration: line-through;
    color: #9ca3af;
}

.car-price .sold-text {
    color: #ef4444;
    font-weight: 700;
    margin-left: 8px;
}

.car-title {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.car-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 16px;
    font-weight: 500;
}

.sold-badge {
    background: #ef4444;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    margin-left: 12px;
}

/* Status badges */
.status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
}

.dealer-badge {
    background: #dbeafe;
    color: #1d4ed8;
}

.private-badge {
    background: #f3f4f6;
    color: #374151;
}

.popular-badge {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    animation: pulse 2s infinite;
}

.time-badge {
    background: #f9fafb;
    color: #6b7280;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.view-count {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-size: 14px;
    margin-top: 8px;
}

/* Quick Specs Chips */
.specs-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.spec-chip {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
}

.spec-chip:hover {
    border-color: #22c55e;
    background: #f0fdf4;
}

.spec-chip.highlight {
    border-color: #22c55e;
    background: #f0fdf4;
}

.spec-chip i {
    font-size: 20px;
    color: #22c55e;
    margin-bottom: 8px;
}

.spec-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spec-value {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.spec-status {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    margin-top: 4px;
    text-transform: uppercase;
}

/* NCT Status */
.spec-chip.nct-valid .spec-status {
    background: #dcfce7;
    color: #166534;
}

.spec-chip.nct-expiring .spec-status {
    background: #fef3c7;
    color: #92400e;
}

.spec-chip.nct-expired .spec-status {
    background: #fee2e2;
    color: #991b1b;
}

/* Description */
.description-section {
    margin-bottom: 32px;
}

/* Car Features Section (view page) */
.car-features-section {
    margin-bottom: 32px;
}

.car-features-section h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #111827;
}

.features-cats-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.features-cat-block {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.features-cat-header {
    display: flex;
    align-items: center;
    padding: 9px 14px;
    background: #f9fafb;
}

.features-cat-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.features-cat-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.features-cat-count {
    background: #22c55e;
    color: white;
    border-radius: 12px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 700;
}

.features-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    align-items: center;
}

.feature-tag {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 500;
}

.feature-tag-extra {
    display: none;
}

.features-cat-block.expanded .feature-tag-extra {
    display: inline-block;
}

.features-see-more {
    background: transparent;
    border: 1.5px solid #d1d5db;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: #6b7280;
    transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.features-see-more:hover {
    border-color: #22c55e;
    color: #15803d;
}

.description-section h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #111827;
}

.description-content {
    color: #374151;
    font-size: 16px;
    line-height: 1.6;
    background: #f9fafb;
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid #22c55e;
}

/* Seller Section */
.seller-section {
    border-top: 1px solid #e5e7eb;
    padding: 24px 16px;
    background: #f9fafb;
}

.seller-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

.seller-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.seller-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: #f3f4f6;
}

.seller-avatar.default {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 24px;
}

.seller-info {
    flex: 1;
}

.seller-name {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #111827;
}

.seller-type {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #22c55e;
}

.seller-location {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

/* Contact Methods */
.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 56px;
    width: 100%;
}

.contact-btn.primary {
    background: #22c55e;
    color: white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.contact-btn.primary:hover {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.contact-btn.secondary {
    background: #f9fafb;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.contact-btn.secondary:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.contact-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.revealed-contact {
    margin-top: 8px;
}

.revealed-number {
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

/* Dealer Actions */
.dealer-actions {
    margin-top: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline {
    background: transparent;
    color: #22c55e;
    border-color: #22c55e;
}

.btn-outline:hover {
    background: #22c55e;
    color: white;
}

/* Owner actions — consistent sizing for all buttons in the row */
.owner-actions .btn,
.owner-actions .btn-sell-script {
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
}

/* Safety Notice */
.safety-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fef3c7;
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid #f59e0b;
}

.safety-notice i {
    color: #f59e0b;
    font-size: 20px;
    margin-top: 2px;
}

.safety-notice strong {
    color: #92400e;
    display: block;
    margin-bottom: 4px;
}

.safety-notice p {
    margin: 0 0 8px 0;
    color: #92400e;
    font-size: 14px;
    line-height: 1.4;
}

.safety-link {
    color: #92400e;
    font-weight: 600;
    text-decoration: none;
}

.safety-link:hover {
    text-decoration: underline;
}

/* Owner Section */
.owner-section {
    padding: 24px 16px;
    background: #f0fdf4;
    border-top: 1px solid #bbf7d0;
}

.owner-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 2px solid #22c55e;
    text-align: center;
}

.owner-card h3 {
    margin: 0 0 12px 0;
    color: #166534;
}

.owner-card p {
    margin: 0 0 20px 0;
    color: #166534;
}

.owner-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-primary {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
}

.btn-primary:hover {
    background: #16a34a;
    border-color: #16a34a;
}

/* Messages btn — neutral dark outline, not competing with green */
.owner-actions .btn-outline {
    background: transparent;
    color: #374151;
    border-color: #d1d5db;
}
.owner-actions .btn-outline:hover {
    background: #f3f4f6;
    color: #111827;
    border-color: #9ca3af;
}

/* Sell Script btn in owner-actions — charcoal fill, distinct from green */
.owner-actions .btn-sell-script {
    background: #1a1a1a;
    color: #fff;
    border: 1.5px solid #1a1a1a;
    transform: none;
    opacity: 1;
}
.owner-actions .btn-sell-script:hover {
    background: #333;
    border-color: #333;
    transform: none;
    opacity: 1;
}

/* Mobile Contact Bar */
.mobile-contact-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    z-index: 1000;
    transform: translateY(0);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    min-height: 52px;
}

.mobile-btn.primary {
    background: #22c55e;
    color: white;
    flex: 2;
}

.mobile-btn.secondary {
    background: #f9fafb;
    color: #374151;
    border: 2px solid #e5e7eb;
}

/* Photo Modal */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.photo-modal .modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #374151;
    z-index: 1;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: #374151;
    z-index: 1;
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
}

/* Share Modal */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 2000;
    padding: 0;
}

.share-modal .modal-content {
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 24px;
    width: 100%;
    max-width: 480px;
    animation: slideUp 0.3s ease;
}

.share-modal h3 {
    margin: 0 0 20px 0;
    text-align: center;
    font-size: 20px;
    color: #111827;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border-radius: 12px;
    background: #f9fafb;
    color: #374151;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-option:hover {
    background: #f3f4f6;
}

.share-option i {
    font-size: 24px;
}

.modal-close-btn {
    width: 100%;
    padding: 16px;
    background: #f9fafb;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Tablet Styles */
@media (min-width: 768px) {
    .back-button-container {
        padding: 24px 32px;
    }
    
    .main-photo-wrapper {
        height: 50vw;
        max-height: 500px;
    }
    
    .car-details {
        padding: 32px;
    }
    
    .car-title {
        font-size: 36px;
    }
    
    .specs-chips {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 16px;
    }
    
    .contact-methods {
        flex-direction: row;
    }
    
    .contact-btn {
        flex: 1;
    }
    
    .mobile-contact-bar {
        display: none;
    }
    
    .owner-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .share-modal {
        align-items: center;
    }
    
    .share-modal .modal-content {
        border-radius: 16px;
        max-width: 400px;
        animation: none;
    }
    
    .similar-cars-section {
        padding: 48px 32px;
    }
    
    .similar-cars-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 24px;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .car-detail-container {
        display: grid;
        grid-template-columns: 1fr 400px;
        gap: 0;
        margin: 24px auto;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    }
    
    .hero-gallery {
        grid-row: 1 / 3;
        min-width: 0;
        overflow: hidden;
    }
    
    .main-photo-wrapper {
        aspect-ratio: 4 / 3;
        height: auto;
        min-height: unset;
        max-height: 70vh;
    }
    
    .car-details {
        padding: 32px;
    }
    
    .seller-section {
        padding: 24px 32px 32px 32px;
        background: #f9fafb;
        border-top: none;
        border-left: 1px solid #e5e7eb;
    }
    
    .specs-chips {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-methods {
        flex-direction: column;
    }
    
    .similar-cars-section {
        padding: 64px 48px;
    }
    
    .similar-cars-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 24px;
    }
}

/* Large Desktop */
@media (min-width: 1280px) {
    .car-detail-container {
        grid-template-columns: 1fr 480px;
    }
    
    .specs-chips {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .spec-chip {
        border-width: 2px;
    }
    
    .contact-btn {
        border-width: 2px;
    }
}

/* Focus styles for accessibility */
.contact-btn:focus,
.action-btn:focus,
.nav-arrow:focus,
.thumbnail:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading states */
.contact-btn:disabled {
    position: relative;
    color: transparent;
}

.contact-btn:disabled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Similar Cars Section */
.similar-cars-section {
    padding: 32px 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px 0;
}

.section-header p {
    color: #6b7280;
    font-size: 16px;
    margin: 0;
}

.similar-cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.similar-car-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.car-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.car-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f3f4f6;
}

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

.similar-car-card:hover .car-photo {
    transform: scale(1.05);
}

.no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    font-size: 32px;
}

.car-price-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.dealer-badge-small {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(29, 78, 216, 0.9);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.car-details-summary {
    padding: 16px;
}

.car-title-small {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.car-specs-small {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #6b7280;
    flex-wrap: wrap;
}

.car-specs-small .spec {
    font-weight: 500;
}

.car-specs-small .separator {
    color: #d1d5db;
}

.car-location-small {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #9ca3af;
}

.view-more-section {
    text-align: center;
}

.view-more-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
}

/* Print styles */
@media print {
    .mobile-contact-bar,
    .nav-arrow,
    .action-btn,
    .photo-actions {
        display: none !important;
    }
    
    .main-photo-wrapper {
        height: 400px;
    }
    
    .car-detail-container {
        grid-template-columns: 1fr;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}

/* ============================================================
   SELL SCRIPT MODAL
   ============================================================ */

/* Trigger button — matches site primary green */
.btn-sell-script {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #22c55e;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, transform 0.1s;
    letter-spacing: 0.01em;
}
.btn-sell-script:hover { background: #16a34a; transform: translateY(-1px); }
.btn-sell-script:active { transform: translateY(0); }

/* Overlay */
.sell-script-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

/* Modal card */
.sell-script-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
    width: 100%;
    max-width: 600px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header — dark charcoal, easy to read */
.sell-script-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #1a1a1a;
    color: #fff;
    flex-shrink: 0;
}
.sell-script-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #fff;
}
.sell-script-modal-header .sell-script-badge {
    font-size: 0.72rem;
    font-weight: 600;
    background: #22c55e;
    color: #fff;
    border-radius: 4px;
    padding: 2px 7px;
    margin-left: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Close button */
.sell-script-close {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}
.sell-script-close:hover { background: rgba(255,255,255,0.25); }

/* Scrollable content area */
.sell-script-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Idle / generate state */
.sell-script-idle {
    text-align: center;
    padding: 28px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.sell-script-idle-icon {
    font-size: 2.2rem;
    line-height: 1;
    margin-bottom: 4px;
}
.sell-script-idle p {
    color: #374151;
    font-size: 0.95rem;
    margin: 0;
    max-width: 360px;
}

/* Loading spinner */
.sell-script-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 28px 16px;
    color: #374151;
    font-size: 0.95rem;
    justify-content: center;
}
.sell-script-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #e5e7eb;
    border-top-color: #22c55e;
    border-radius: 50%;
    animation: sellScriptSpin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes sellScriptSpin { to { transform: rotate(360deg); } }

/* Error state */
.sell-script-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
}

/* Tab bar */
.sell-script-tabs {
    display: flex;
    gap: 0;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
    flex-shrink: 0;
}
.sell-script-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.sell-script-tab-btn:hover:not(.active) { background: #e5e7eb; color: #374151; }
.sell-script-tab-btn.active {
    background: #fff;
    color: #111827;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Script text */
.sell-script-tab-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sell-script-text {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-left: 3px solid #22c55e;
    border-radius: 0 8px 8px 0;
    padding: 16px 18px;
    font-size: 0.9rem;
    line-height: 1.7;
    font-family: 'Segoe UI', Arial, sans-serif;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    color: #1f2937;
}

/* Copy button */
.sell-script-copy-btn {
    align-self: flex-start;
    background: #fff;
    border: 1.5px solid #22c55e;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 0.83rem;
    font-weight: 600;
    color: #16a34a;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.sell-script-copy-btn:hover { background: #22c55e; color: #fff; }

/* Mobile: slide up from bottom */
@media (max-width: 480px) {
    .sell-script-modal-overlay { align-items: flex-end; padding: 0; }
    .sell-script-modal { border-radius: 14px 14px 0 0; max-height: 90vh; }
}
