/* Styles for /cars index (extracted from views/cars/index.php). Loaded via header. */
/* .search-form-section, .search-section, .search-form and .form-group
   are defined in the shared /css/search-form.css */

.form-group:has(#generation) {
    flex: 1;
    min-width: auto;
}

.form-input {
    width: 100%;
    height: 56px;
    padding: 6px 40px 8px 16px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 15px;
    background: white;
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: #fa742d;
}

input#make {
    border-radius: 10px 0 0 10px;
}

input#generation {
    border-radius: 0 10px 10px 0;
}

.dropdown-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
    opacity: 0.5;
    transition: transform 0.3s ease;
}

.form-group:has(.dropdown-list.active) .dropdown-icon {
    transform: translateY(-50%) rotate(180deg);
}

.form-label {
    position: absolute;
    left: 16px;
    top: 15px;
    color: rgba(12, 19, 29, 0.5);
    font-size: 15px;
    transition: all 0.3s ease;
    pointer-events: none;
    background: white;
    padding: 0 4px;
    border-radius: 4px;
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
    top: -8px;
    font-size: 12px;
    color: #999999;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.dropdown-list.active {
    display: block;
}

.dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.search-button {
    padding: 0px 32px;
    background: #fa742d;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    height: 56px;
    margin-left: 10px;
}

.search-button:hover {
    background: #e86624;
    transform: translateY(-2px);
}

.search-button:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .search-form {
        width: 100%;
        display: grid;
        grid-template-columns: 30% 30% 27% 10%;
        gap: 1%;
        justify-content: space-between;
    }
    
    .form-group {
        min-width: 0;
    }
    
    .search-button {
        margin-left: 0;
    }

    .form-label {
        top: 7px;
    }
}

.section-header {
    margin: 10px 0 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    /* border-bottom: 2px solid #e8e8e8; */
}

.section-header:first-of-type {
    margin-top: 0;
}

.section-header i {
    font-size: 20px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #1a1a1a;
}

.popular-header i {
    color: #ffc107;
}

.popular-header h2 {
    color: #1a1a1a;
}

.all-brands-header i {
    color: #666;
}

.all-brands-header {
    margin-top: 40px;
}

.latest-header {
    margin-top: 32px;
    padding-bottom: 4px;
}

.latest-header i {
    color: #fa742d;
}

.latest-subtitle {
    margin: 0 0 16px;
    color: #6b7280;
    font-size: 14px;
}

.latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.latest-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #edf0f3;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
}

.latest-card:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
    border-color: #fa742d;
}

.latest-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #f5f6f8;
    overflow: hidden;
}

.latest-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.latest-card:hover .latest-thumb img {
    transform: scale(1.05);
}

.latest-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    background: #fa742d;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.latest-info {
    padding: 12px 14px 14px;
}

.latest-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

.latest-gen {
    font-size: 13px;
    color: #4a5568;
    margin-top: 2px;
}

.latest-years {
    font-size: 12px;
    color: #9aa3af;
    margin-top: 6px;
}

@media (max-width: 768px) {
    .latest-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
}

.cars-index {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Column layout (.page-layout / .page-sidebar-left / .page-main /
   .page-sidebar-right) is defined in the shared /css/page-layout.css */

.popular-brands-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popular-brand-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.popular-brand-item:hover {
    background: #e9ecef;
}

.brand-mini-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.widget-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px 0;
}

.sidebar-widget {
    border-radius: 12px;
    padding-right: 10px;
}

.search-widget {
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}

.search-input-group {
    position: relative;
}

.search-input-group i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.search-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--brand_primary_500, #0c73fe);
    box-shadow: 0 0 0 3px rgba(12, 115, 254, 0.1);
}

.filter-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-item:hover {
    background: #f5f5f5;
    color: var(--brand_primary_500, #0c73fe);
}

.filter-item.active {
    background: #0b73fe;
    color: white;
}

.filter-count {
    flex-shrink: 0;
    min-width: 22px;
    padding: 1px 7px;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    color: #6b7280;
    background: #f0f2f5;
    border-radius: 10px;
}

.filter-item:hover .filter-count {
    color: var(--brand_primary_500, #0c73fe);
    background: #e8f0ff;
}

.filter-item.active .filter-count {
    color: #fff;
    background: rgba(255, 255, 255, 0.25);
}

.alphabet-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.letter-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    color: #666;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.letter-btn:hover {
    border-color: var(--brand_primary_500, #0c73fe);
    color: var(--brand_primary_500, #0c73fe);
    background: #f5f9ff;
}

.letter-btn.active {
    background: var(--brand_primary_500, #0c73fe);
    color: white;
    border-color: var(--brand_primary_500, #0c73fe);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1a1a1a;
}

.lead {
    font-size: 16px;
    margin: 0;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 4px;
    margin-bottom: 30px;
}

.brand-card {
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 8px;
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

.brand-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.brand-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-placeholder {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea0d 0%, #764ba20a 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999999;
    font-size: 18px;
    font-weight: 700;
}

.brand-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.brand-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 2px 0;
    line-height: 1.3;
}

.brand-meta {
    margin-top: 4px;
}

.country-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    background: #f5f5f5;
    border-radius: 3px;
    font-size: 10px;
    color: #666;
}

.country-badge i {
    font-size: 9px;
}

.popular-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-top: 4px;
    padding: 2px 6px;
    background: #fff3cd;
    color: #856404;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
}

.popular-badge i {
    font-size: 8px;
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination {
    display: flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination li {
    list-style: none;
}

.pagination .page-link {
    padding: 8px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination .page-link:hover {
    background: #f5f5f5;
    border-color: var(--brand_primary_500, #0c73fe);
    color: var(--brand_primary_500, #0c73fe);
}

.pagination .active .page-link {
    background: var(--brand_primary_500, #0c73fe);
    color: white;
    border-color: var(--brand_primary_500, #0c73fe);
}

.pagination .disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .pagination .page-link {
        min-width: 38px;
        padding: 8px 0;
        text-align: center;
    }
}

.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 24px;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.no-results p {
    color: #666;
    margin-bottom: 20px;
}

.btn-reset {
    display: inline-block;
    padding: 10px 20px;
    background: var(--brand_primary_500, #0c73fe);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: #0960d9;
}

@media (max-width: 992px) {
    .filter-list {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
    }

    .brand-card {
        padding: 10px;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
    }

    .logo-placeholder {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .brand-name {
        font-size: 12px;
    }
    
    .country-badge,
    .popular-badge {
        font-size: 9px;
        padding: 2px 4px;
    }
}

.seo-content {
    margin-top: 40px;
    padding: 28px 0 8px;
    border-top: 1px solid #e8e8e8;
    color: #4a5568;
}

.seo-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 14px;
}

.seo-content p {
    font-size: 15px;
    line-height: 1.7;
    margin: 0 0 12px;
    max-width: 900px;
}

.seo-content h3 {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 24px 0 12px;
}

.seo-list {
    margin: 0 0 12px;
    padding-left: 20px;
    max-width: 900px;
}

.seo-list li {
    font-size: 15px;
    line-height: 1.7;
    color: #4a5568;
    margin-bottom: 4px;
}

.seo-links-intro {
    margin-bottom: 10px !important;
    color: #6b7280;
}

.seo-faq {
    max-width: 900px;
}

.seo-faq-item {
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

.seo-faq-item:last-child {
    border-bottom: none;
}

.seo-faq-item h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 6px;
}

.seo-faq-item p {
    margin: 0;
    font-size: 14px;
}

.seo-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.seo-link {
    display: inline-block;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #edf0f3;
    border-radius: 8px;
    color: #4a5568;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.seo-link:hover {
    background: #fff3ec;
    border-color: #fa742d;
    color: #fa742d;
}
