/* ==================== */
/* ROOT VARIABLES */
/* ==================== */
:root {
    /* الألوان الأساسية */
    --primary-color: #1a5fb4;
    --secondary-color: #e01b24;
    --accent-color: #26a269;
    --light-bg: #f6f5f4;
    --dark-bg: #1c1c1c;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #d1d1d1;
    
    /* الظلال */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 5px 20px rgba(0,0,0,0.12);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    
    /* التدرجات */
    --gradient-primary: linear-gradient(135deg, #1a5fb4, #1c71d8);
    --gradient-accent: linear-gradient(135deg, #e01b24, #c01c28);
    --gradient-success: linear-gradient(135deg, #26a269, #2ec27e);
    --gradient-dark: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    --gradient-whatsapp: linear-gradient(135deg, #27ae60, #219653);
    --gradient-price: linear-gradient(135deg, #e74c3c, #c0392b);
    --gradient-brand: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* الانتقالات */
    --transition: all 0.3s ease;
    --transition-slow: all 0.4s ease;
    --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* القياسات */
    --header-height: 70px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 15px;
    --border-radius-xl: 30px;
    
    /* Safe Areas */
    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);
    --safe-area-left: env(safe-area-inset-left);
    --safe-area-right: env(safe-area-inset-right);
}

/* ==================== */
/* RESET & BASE STYLES */
/* ==================== */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    box-sizing: border-box;
}

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Cairo', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    overflow-x: hidden;
    color: var(--text-color);
    direction: rtl;
}

/* ==================== */
/* CONTAINERS */
/* ==================== */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 1400px) {
    .container {
        max-width: 1140px;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 540px;
        padding: 0 12px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
}

/* ==================== */
/* BUTTONS */
/* ==================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-xl);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    min-height: 50px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-view-details {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    text-align: center;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-view-details:hover {
    background: var(--secondary-color);
}

.btn-request {
    background: var(--gradient-success);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    width: 100%;
    justify-content: center;
    text-decoration: none;
    text-align: center;
}

.btn-request:hover {
    background: linear-gradient(135deg, #219653, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-whatsapp-offer {
    background: var(--gradient-whatsapp);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    width: 100%;
    justify-content: center;
    text-decoration: none;
}

.btn-whatsapp-offer:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-apply-filters {
    background: var(--gradient-dark);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    width: 100%;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-apply-filters:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-reset {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.btn-reset:hover {
    background: #c0392b;
}

.btn-submit {
    background: var(--gradient-dark);
    color: white;
    border: none;
    padding: 16px;
    border-radius: var(--border-radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-cancel {
    background: #f8f9fa;
    color: var(--text-color);
    border: 2px solid var(--border-color);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-cancel:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.btn-back {
    background: #f8f9fa;
    color: #2c3e50;
    border: 2px solid #e1e5e9;
    padding: 15px 30px;
    border-radius: var(--border-radius-sm);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    text-align: center;
}

.btn-back:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.type-btn {
    background: white;
    border: 2px solid #e1e5e9;
    padding: 12px 20px;
    border-radius: var(--border-radius-xl);
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
    font-size: 0.95rem;
}

.type-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.type-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.control-btn {
    background: white;
    border: 2px solid #e1e5e9;
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    flex-shrink: 0;
    font-size: 0.9rem;
}

.control-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.view-offers-btn {
    display: block;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
    width: 100%;
    border: none;
    cursor: pointer;
}

.view-offers-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1c5a7e 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

/* ==================== */
/* HEADERS & TITLES */
/* ==================== */
.main-header {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-bg) 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-content h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 20px;
    font-weight: 800;
}

.header-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.6;
}

.register-header {
    text-align: center;
    padding: 30px 0;
    background: var(--gradient-brand);
    color: white;
}

.register-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.page-title {
    text-align: center;
    margin-bottom: 25px;
    padding: 15px;
    background: var(--gradient-brand);
    color: white;
    border-radius: var(--border-radius-md);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.page-title h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-weight: 800;
}

.page-title p {
    font-size: 1rem;
    opacity: 0.9;
}

.page-header {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px 15px;
    background: var(--gradient-brand);
    color: white;
    border-radius: var(--border-radius-md);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.page-header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 800;
}

.page-header p {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* ==================== */
/* FORMS */
/* ==================== */
.responsive-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: var(--transition);
    font-family: 'Cairo', sans-serif;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: var(--border-radius-md);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.price-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    text-align: center;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
}

.sort-select {
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: var(--border-radius-sm);
    background: white;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    max-width: 300px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232c3e50' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 15px center;
    background-size: 16px;
    padding-right: 40px;
    text-align: right;
}

.sort-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.privacy-group {
    margin-top: 20px;
}

.privacy-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.privacy-checkbox {
    width: 18px;
    height: 18px;
}

.privacy-text {
    font-size: 0.95rem;
}

.required {
    color: #e74c3c;
}

.hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ==================== */
/* GRID LAYOUTS */
/* ==================== */
.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.offers-grid-large {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.brands-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==================== */
/* CARDS */
/* ==================== */
.offer-card {
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    height: 100%;
}

.offer-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.offer-card-large {
    background: white;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: var(--transition-bounce);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #f1f1f1;
}

.offer-card-large:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    border-color: #3498db;
}

.brand-card {
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: var(--transition-bounce);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 15px;
    text-align: center;
    border: 2px solid transparent;
    position: relative;
}

.brand-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    border-color: #3498db;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 40px 30px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* ==================== */
/* BADGES & LABELS */
/* ==================== */
.offer-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--gradient-accent);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 2;
}

.badge-featured {
    background: linear-gradient(135deg, #ff9a00 0%, #ff5e00 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 94, 0, 0.3);
}

.badge-new {
    background: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 176, 155, 0.3);
}

.offers-count {
    display: inline-block;
    background: var(--gradient-brand);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

/* ==================== */
/* IMAGES */
/* ==================== */
.offer-image {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.offer-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.offer-card:hover .offer-image img {
    transform: scale(1.05);
}

.offer-image-large {
    height: 180px;
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.offer-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.offer-card-large:hover .offer-image-large img {
    transform: scale(1.05);
}

.car-image {
    width: 100%;
    height: 200px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    margin-bottom: 20px;
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-logo-container {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 4px solid #f8f9fa;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: var(--transition-slow);
}

.brand-card:hover .brand-logo-container {
    transform: scale(1.1) rotate(5deg);
    border-color: #3498db;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.brand-card:hover .brand-logo-img {
    transform: scale(1.05);
}

.default-logo {
    font-size: 3rem;
    color: #3498db;
}

/* ==================== */
/* CONTENT SECTIONS */
/* ==================== */
.offer-content {
    padding: 20px;
}

.offer-content-large {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.offer-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    line-height: 1.4;
    height: 3.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.offer-title-large {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1.4;
    font-weight: 700;
    min-height: 45px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.brand-name {
    font-size: 1.3rem;
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.3;
}

.car-title {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 700;
}

.offer-price {
    font-size: 1.8rem;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 15px;
}

.offer-price-large {
    font-size: 1.5rem;
    color: #e74c3c;
    font-weight: 800;
    margin: 10px 0;
    text-align: center;
    background: var(--gradient-price);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.car-price {
    font-size: 2rem;
    color: var(--accent-color);
    font-weight: 800;
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: var(--border-radius-md);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 10px;
    line-height: 1;
}

.stat-label {
    font-size: 1.2rem;
    color: var(--text-light);
    margin: 15px 0;
    font-weight: 500;
}

/* ==================== */
/* DETAILS & STATS */
/* ==================== */
.offer-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.offer-details-large {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius-sm);
    border: 1px solid #e1e5e9;
}

.car-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.car-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.brand-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius-sm);
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.detail-item-large {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 600;
}

.detail-item i {
    color: var(--secondary-color);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.detail-item-large i {
    color: #3498db;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.detail-item span {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ==================== */
/* FILTERS & SIDEBARS */
/* ==================== */
.mobile-filter-toggle {
    display: none;
    background: var(--gradient-dark);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 15px;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.filters-sidebar {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    width: 100%;
    display: none;
}

.filters-sidebar.active {
    display: block;
    animation: slideIn 0.3s ease-out;
}

.filter-group {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f1f1;
}

.filter-title {
    font-weight: 700;
    margin-bottom: 12px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    width: 100%;
}

.filter-options {
    max-height: 150px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #f8f9fa;
    -webkit-overflow-scrolling: touch;
}

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.filter-option:hover {
    background: white;
}

.price-range-display {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    color: #7f8c8d;
    font-weight: 600;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.brand-type-filter {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 15px 5px 20px 5px;
    margin-bottom: 15px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.brand-type-filter::-webkit-scrollbar {
    display: none;
}

/* ==================== */
/* PAGINATION */
/* ==================== */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f1f1f1;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.page-link {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    text-decoration: none;
    color: #3498db;
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition);
    min-width: 40px;
    text-align: center;
}

.page-link:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-2px);
}

.page-link.active {
    background: var(--gradient-dark);
    color: white;
    border-color: #3498db;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

/* ==================== */
/* ALERTS & MESSAGES */
/* ==================== */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius-sm);
    margin: 15px 0;
    display: none;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert i {
    font-size: 1.2rem;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1rem;
    cursor: pointer;
    margin-right: auto;
}

/* ==================== */
/* MODALS & OVERLAYS */
/* ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--dark-bg));
    color: white;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.close-modal:hover {
    transform: scale(1.2);
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.overlay.active {
    display: block;
}

.sort-options {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: white;
    box-shadow: -5px 0 30px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

.sort-options.active {
    right: 0;
}

/* ==================== */
/* LOADING STATES */
/* ==================== */
.loading {
    display: none;
    text-align: center;
    padding: 30px;
    color: #3498db;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 15px;
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 30px;
    color: #3498db;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 15px;
}

/* ==================== */
/* EMPTY STATES */
/* ==================== */
.no-results {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius-md);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.no-results i {
    font-size: 3rem;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin: 30px 0;
    display: none;
}

.empty-state i {
    font-size: 4rem;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

/* ==================== */
/* ANIMATIONS */
/* ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}




/* Desktop */
@media (min-width: 1024px) {
    .offers-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
    
    .offers-grid-large {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
    
    .brands-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
    
    .filters-sidebar {
        width: 320px;
        padding: 25px;
    }
    
    .offer-image-large {
        height: 220px;
    }
    
    .brand-logo-container {
        width: 150px;
        height: 150px;
    }
    
    .brand-stats {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }
}

/* ==================== */
/* DARK MODE SUPPORT */
/* ==================== */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #62a0ea;
        --secondary-color: #f66151;
        --accent-color: #57e389;
        --light-bg: #2d2d2d;
        --dark-bg: #1a1a1a;
        --text-color: #ffffff;
        --text-light: #cccccc;
        --border-color: #444444;
    }
    
    .offer-card,
    .stat-card,
    .brand-card,
    .offer-card-large {
        background: #2c2c2c;
        color: #fff;
    }
    
    .offer-title,
    .stat-number,
    .brand-name,
    .offer-title-large,
    .car-title {
        color: #fff;
    }
    
    .offer-details,
    .car-detail-item,
    .offer-details-large {
        border-color: #444;
    }
    
    .detail-item span,
    .stat-label,
    .brand-name-en,
    .hint {
        color: #ccc;
    }
}

/* ==================== */
/* PRINT STYLES */
/* ==================== */
@media print {
    .btn-primary,
    .btn-view-details,
    .btn-request,
    .btn-whatsapp-offer,
    .btn-apply-filters,
    .btn-reset,
    .filter-tabs,
    .load-more-section,
    .mobile-filter-toggle,
    .filters-sidebar {
        display: none;
    }
    
    .main-header {
        background: white !important;
        color: black !important;
        padding: 20px 0;
    }
    
    .featured-section,
    .stats-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .offer-card,
    .stat-card,
    .brand-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ==================== */
/* DEVICE SPECIFIC FIXES */
/* ==================== */

/* iOS Fixes */
@supports (-webkit-touch-callout: none) {
    .btn-primary,
    .btn-view-details,
    .filter-tab,
    .load-more-btn {
        -webkit-tap-highlight-color: transparent;
    }
    
    .offer-card,
    .stat-card,
    .brand-card {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    input[type="text"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px;
    }
    
    .filter-options,
    .brand-type-filter {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* Android & Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .offer-card:hover,
    .stat-card:hover,
    .brand-card:hover,
    .offer-card-large:hover {
        transform: none;
    }
    
    .btn-primary:active,
    .btn-view-details:active,
    .btn-request:active,
    .btn-whatsapp-offer:active,
    .btn-apply-filters:active,
    .btn-reset:active,
    .btn-submit:active,
    .btn-cancel:active,
    .btn-back:active,
    .type-btn:active,
    .control-btn:active,
    .view-offers-btn:active,
    .page-link:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    button,
    a,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    .detail-item i {
        margin-bottom: 8px;
    }
}

/* Safe Area Support */
@supports (padding: max(0px)) {
    .main-header,
    .featured-section,
    .stats-section,
    .register-header {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    .container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
}

/* Low Resolution Screens */
@media (max-resolution: 150dpi) {
    .offer-image,
    .offer-image-large,
    .car-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-dark);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1c3d5a 100%);
}

/* Text Selection */
::selection {
    background-color: var(--primary-color);
    color: white;
}

::-moz-selection {
    background-color: var(--primary-color);
    color: white;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.flex {
    display: flex;
}

.grid {
    display: grid;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}

/* Focus States */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Placeholder Styling */
::placeholder {
    color: #999;
    opacity: 1;
}

:-ms-input-placeholder {
    color: #999;
}

::-ms-input-placeholder {
    color: #999;
}