/* Cars Archive Page Styles */

/* AGGRESSIVE FULL-WIDTH OVERRIDES */
body.post-type-archive-car {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

/* Hide sidebars on car archive pages */
body.post-type-archive-car .sidebar,
body.post-type-archive-car aside,
body.post-type-archive-car #secondary,
body.post-type-archive-car .widget-area {
    display: none !important;
}

/* Force main content to full width */
body.post-type-archive-car .site,
body.post-type-archive-car .site-content,
body.post-type-archive-car .content-area,
body.post-type-archive-car main,
body.post-type-archive-car #primary,
body.post-type-archive-car #content,
body.post-type-archive-car .hfeed,
body.post-type-archive-car article {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
}

/* Remove any grid/flex constraints from theme */
body.post-type-archive-car .site-content {
    display: block !important;
    grid-template-columns: 1fr !important;
}

/* Force body to not have max-width */
body.post-type-archive-car {
    max-width: 100% !important;
}

/* Fix the invalid width value on the filter container */
.cars-filters .container {
    width: 100% !important;
    max-width: 1240px !important;
    margin: 0 auto !important;
    display: block !important;
}

/* Optional: Ensure the grid inside expands properly */
.filters-grid {
    display: grid;
    gap: 20px;
    width: 100%;
}

.sharmancar-cars-archive {
    background: #F9FAFB;
    min-height: 100vh;
    width: 100vw;
    max-width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
}

/* Override theme container constraints */
.sharmancar-cars-archive .container {
    max-width: 1600px !important;
    width: 100% !important;
    padding: 0 40px !important;
    margin: 0 auto !important;
}

/* Force full width on parent elements */
.sharmancar-cars-archive,
.sharmancar-cars-archive * {
    box-sizing: border-box;
}

/* Hero Section */
.cars-hero {
    background: linear-gradient(135deg, #E31E24 0%, #C41E3A 100%);
    padding: 100px 20px;
    color: white;
    width: 100%;
    margin: 0;
    text-align: center;
}

.cars-hero .container {
    max-width: 900px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

.hero-content {
    text-align: center;
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    margin: 0 0 20px 0;
    line-height: 1.2;
    color: white;
}

.hero-title .highlight {
    color: #FFFFFF;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.hero-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Filters Section */
.cars-filters {
    background: white;
    padding: 40px 0;
    border-bottom: 1px solid #E5E7EB;
}

.filter-form {
    width: 100%;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.filter-item input,
.filter-item select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: white;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.filter-item select option {
    color: #111827;
    background: #FFFFFF;
}

/* Add custom dropdown arrow for select elements */
.filter-item 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='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
    cursor: pointer;
}

.filter-item input:focus,
.filter-item select:focus {
    outline: none;
    border-color: #E31E24;
    box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.1);
}

.filter-actions {
    display: flex;
    gap: 12px;
}

.btn-filter,
.btn-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-filter {
    background: #E31E24;
    color: #FFFFFF;
}

.btn-filter:hover {
    background: #C41E3A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.3);
}

.btn-reset {
    background: #F3F4F6;
    color: #6B7280;
}

.btn-reset:hover {
    background: #E5E7EB;
}

/* Cars Grid Section */
.cars-grid-section {
    padding: 40px 0 80px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.results-count {
    font-size: 16px;
    color: #6B7280;
    margin: 0;
}

.view-toggle {
    display: flex;
    gap: 8px;
}

.view-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover,
.view-btn.active {
    background: #E31E24;
    border-color: #E31E24;
    color: white;
}

/* Cars Grid */
.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    width: 100%;
}

/* Car Card */
.car-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.car-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* Badge */
.car-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
    background: #3B82F6;
    color: white;
}

.car-badge.new-arrival {
    background: #10B981;
}

.car-badge.featured {
    background: #E31E24;
}

.car-badge.hot-deal {
    background: #EF4444;
}

/* Wishlist Button */
.wishlist-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wishlist-btn:hover {
    background: #E31E24;
    color: white;
    transform: scale(1.1);
}

/* Car Image */
.car-image {
    display: block;
    width: 100%;
    height: 240px;
    overflow: hidden;
    position: relative;
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.car-card:hover .car-image img {
    transform: scale(1.05);
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    color: #9CA3AF;
}

/* Car Info */
.car-info {
    padding: 20px;
}

.car-category {
    font-size: 12px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.car-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.car-title a {
    color: #111827;
    text-decoration: none;
    transition: color 0.3s ease;
}

.car-title a:hover {
    color: #E31E24;
}

.car-dealer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 16px;
}

.car-dealer svg {
    width: 12px;
    height: 12px;
    color: #E31E24;
}

/* Car Specs */
.car-specs {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid #F3F4F6;
    border-bottom: 1px solid #F3F4F6;
    margin-bottom: 16px;
}

.spec {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6B7280;
}

.spec svg {
    color: #9CA3AF;
}

/* Car Footer */
.car-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.car-price {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-current {
    font-size: 24px;
    font-weight: 700;
    color: #E31E24;
}

.price-old {
    font-size: 14px;
    color: #9CA3AF;
    text-decoration: line-through;
}

.price-contact {
    font-size: 14px;
    color: #6B7280;
    font-weight: 600;
}

.btn-view {
    padding: 10px 20px;
    background: #F3F4F6;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-view:hover {
    background: #C41E3A !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.3);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 48px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #E31E24;
    border-color: #E31E24;
    color: white;
}

.pagination .current {
    background: #E31E24;
    border-color: #E31E24;
    color: white;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 80px 20px;
}

.no-results svg {
    color: #D1D5DB;
    margin-bottom: 24px;
}

.no-results h2 {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px 0;
}

.no-results p {
    font-size: 16px;
    color: #6B7280;
    margin: 0 0 32px 0;
}

.btn-reset-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: #E31E24;
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-reset-large:hover {
    background: #C41E3A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.3);
}

/* Responsive */
@media (max-width: 1024px) {
    .cars-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 36px;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        grid-column: 1;
    }
    
    .cars-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    min-height: 400px;
}

.loading-spinner .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top-color: #E31E24;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner p {
    margin-top: 20px;
    font-size: 16px;
    color: #6B7280;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Icon Styles */
.btn-icon,
.spec-icon,
.dealer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.spec-icon {
    font-size: 16px;
    color: #6B7280;
}

.dealer-icon {
    font-size: 12px;
    color: #E31E24;
}

.car-placeholder-icon {
    font-size: 64px;
    display: block;
}

.no-results-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.page-arrow {
    font-size: 24px;
    font-weight: bold;
    display: inline-block;
}

.wishlist-btn .btn-icon {
    font-size: 22px;
    transition: transform 0.3s ease;
}

.wishlist-btn:hover .btn-icon {
    transform: scale(1.2);
}

.wishlist-btn.active .btn-icon {
    content: '♥';
    color: #EF4444;
}

/* Category Filter Section */
.category-filter-section {
    background: white;
    padding: 40px 0;
    border-bottom: 1px solid #E5E7EB;
}

.category-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.category-card {
    background: #f8f8f8;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    transition: 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    background: #ffffff;
}

.category-card.active {
    background: linear-gradient(135deg, #E31E24 0%, #C41E3A 100%);
    box-shadow: 0 10px 25px rgba(227, 30, 36, 0.3);
}

.category-card.active i {
    color: #ffffff;
}

.category-card.active h4 {
    color: #ffffff;
}

.category-card i {
    font-size: 38px;
    color: #E31E24;
    margin-bottom: 15px;
    transition: 0.3s ease;
}

.category-card h4 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #1d1d1d;
    margin: 0;
    transition: 0.3s ease;
}

@media (max-width: 768px) {
    .category-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 12px;
    }
    
    .category-card {
        padding: 20px 10px;
    }
    
    .category-card i {
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .category-card h4 {
        font-size: 12px;
    }
}
