/* ===== CARS PAGE CONTAINER ===== */
.cars-page-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}

.page-title {
    font-size: 24px;
    margin: 0 0 25px 0;
    font-weight: 600;
    color: #333;
}

/* ===== FILTERS SECTION ===== */
.filters-section {
    background: white;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #eaeaea;
}

.filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 13px;
}

/* ===== SELECT WRAPPER STYLES (për shigjetat) ===== */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font: inherit;
    color: #333;
    width: 100%;
    height: 42px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
    cursor: pointer;
}

.select-wrapper select:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.08);
}

/* Shigjeta e personalizuar - pa border majtas, madhësia 25px */
.select-arrow {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 25px;
    height: 40px; /* lartësia e select-it minus 2px nga border-i */
    background: #fff;
    border-radius: 0 4px 4px 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* Shigjeta vizuale */
.arrow-down {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #666;
    display: inline-block;
    transition: border-top-color 0.2s;
}

/* Ndrysho ngjyrën e shigjetës kur hover mbi select */
.select-wrapper:hover .arrow-down {
    border-top-color: #333;
}

/* ===== INPUT STYLES - FIX ZOOM ON MOBILE ===== */
.filter-group input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font: inherit;
    color: #333;
    width: 100%;
    height: 42px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
    /* Parandalon zoom-in në mobile */
    -webkit-text-size-adjust: 100%;
}

.filter-group input:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.08);
}

/* heq spinner tek number */
.filter-group input[type="number"] {
    -moz-appearance: textfield;
}

.filter-group input[type="number"]::-webkit-outer-spin-button,
.filter-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ===== FILTER ACTIONS ===== */
.filter-actions {
    grid-column: span 2;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.btn {
    flex: 1;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: #333;
    color: white;
    border: 1px solid #333;
}

.btn-primary:hover {
    background: #555;
    border-color: #555;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ===== CARS GRID ===== */
.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.car-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.car-card {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.car-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* SOLD Badge */
.sold-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #dc3545;
    color: white;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Thumbnail */
.car-image-container {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.car-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.car-card:hover .car-image {
    transform: scale(1.05);
}

/* Detajet */
.car-details {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.car-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
    line-height: 1.3;
}

/* Çmimi */
.car-price {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Specifikat me ikona - HORIZONTALE */
.car-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
    font-size: 13px;
    color: #666;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.spec-item i {
    color: #466337;
    font-size: 14px;
}

/* ===== PAGINATION ===== */
.pagination {
    text-align: center;
    margin: 40px 0;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.pagination-link {
    display: inline-block;
    padding: 6px 10px;
    background-color: #f8f9fa;
    color: #333;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.3s;
}

.pagination-link:hover {
    background-color: #e9ecef;
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pagination-link.active {
    background-color: #333;
    color: white;
    border-color: #333;
}

.pagination-link.prev,
.pagination-link.next {
    padding: 8px 15px;
    font-size: 14px;
}

/* ===== NO RESULTS ===== */
.no-results {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
}

.no-results p {
    font-size: 16px;
    color: #666;
    margin-bottom: 15px;
}

.view-all-link {
    display: inline-block;
    padding: 8px 20px;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.view-all-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 1024px) {
    .filters-form {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .cars-page-container {
        padding: 0 12px;
        margin: 20px auto;
    }

    .page-title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .filters-section {
        padding: 15px;
    }

    .filters-form {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .filter-actions {
        grid-column: span 1;
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        width: 100%;
    }

    /* ===== FIX ZOOM ON MOBILE - INPUT FIELDS ===== */
    .filter-group input {
        font-size: 16px !important;
    }

    .cars-grid {
        gap: 15px;
    }

    .car-image-container {
        height: 160px;
    }

    .car-title {
        font-size: 15px;
    }

    .car-price {
        font-size: 16px;
    }

    .car-specs {
        gap: 10px;
        font-size: 12px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 3px;
    }

    .pagination-link {
        padding: 5px 8px;
        font-size: 12px;
    }

    .pagination-link.prev,
    .pagination-link.next {
        padding: 6px 12px;
        font-size: 13px;
    }

    /* Përshtatja e shigjetave në mobile */
    .select-arrow {
        width: 25px;
        height: 38px;
    }
}

/* Për iOS Safari specifikisht - Fix Zoom */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        .filter-group input {
            font-size: 16px !important;
        }
    }
}

@media (max-width: 480px) {
    .cars-page-container {
        padding: 0 10px;
    }

    .page-title {
        font-size: 20px;
    }

    .filters-section {
        padding: 12px;
    }

    .filter-group label {
        font-size: 12px;
    }

    .select-wrapper select,
    .filter-group input {
        height: 40px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .select-arrow {
        width: 25px;
        height: 38px;
    }

    .cars-grid {
        grid-template-columns: 1fr;
    }

    .car-image-container {
        height: 200px;
    }

    .no-results {
        padding: 30px 15px;
    }

    .no-results p {
        font-size: 15px;
    }
}