/* --- التنسيقات الأساسية --- */
body {
    font-family: 'Cairo', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

/* ✅ شريط الدليل التجاري (أصفر) */
.directory-banner {
    background-color: #ffc107; /* أصفر */
    color: #212529;
    text-align: center;
    padding: 8px 0;
    font-weight: bold;
    font-size: 14px;
    border-bottom: 1px solid #dee2e6;
}

.directory-text {
    margin: 0;
}

/* ✅ تحسينات عامة */
.container {
    max-width: 100% !important;
    padding: 0 15px;
}

/* ✅ بطاقات الإعلانات (التصميم المطلوب) */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 15px;
    margin: 0 auto;
    max-width: 100%;
}

.listing-card {
    background: white;
    border-radius: 12px 12px 12px 0; /* الزاوية اليسرى السفلية مستقيمة */
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
    position: relative;
    height: 220px;
}

.listing-card:hover {
    transform: translateY(-3px);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.listing-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.overlay-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 12px;
    z-index: 5;
}

.overlay-title {
    color: white;
    font-size: 13px;
    font-weight: bold;
    text-align: left;
    margin-bottom: 3px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 6;
}

.overlay-price {
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 6;
    width: 100%;
    justify-content: space-between;
    padding-right: 40px; /* لترك مساحة للأيقونة */
}

.price-amount {
    font-size: 15px;
    font-weight: bold;
    color: #28a745;
    background-color: rgba(255,255,255,0.95);
    padding: 4px 8px;
    border-radius: 5px;
    min-width: 70px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.detail-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 13px;
    z-index: 6;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.detail-icon:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

.user-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 6;
}

.badge {
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.badge-individual {
    background-color: #28a745;
}

.badge-vendor {
    background-color: #007bff;
}

/* ✅ تحسين للهواتف */
@media (max-width: 576px) {
    .listings-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 10px;
    }

    .listing-card {
        height: 200px;
    }

    .overlay-info {
        height: 90px;
    }

    .overlay-title {
        font-size: 12px;
    }

    .price-amount {
        font-size: 14px;
        padding: 3px 6px;
        min-width: 65px;
    }

    .detail-icon {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .badge {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* ✅ شاشات صغيرة جدًا */
@media (max-width: 375px) {
    .listing-card {
        height: 180px;
    }

    .overlay-info {
        height: 80px;
    }

    .overlay-title {
        font-size: 11px;
    }

    .price-amount {
        font-size: 13px;
        padding: 2px 5px;
        min-width: 60px;
    }

    .detail-icon {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
}

/* ✅ صفحة البحث */
.search-container {
    background-color: #f8f9fa;
    padding: 20px;
    margin: 20px 0;
}

.search-form {
    max-width: 800px;
    margin: 0 auto;
}

.search-form h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.search-filters {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.search-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: end;
}

.search-inputs input,
.search-inputs select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-inputs input[type="text"] {
    grid-column: span 2;
}

.price-range {
    display: flex;
    gap: 10px;
}

.price-range input {
    flex: 1;
}

.search-inputs button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.search-inputs button:hover {
    background-color: #c82333;
}

.search-info {
    margin: 20px 0;
    padding: 15px;
    background-color: #e9ecef;
    border-radius: 4px;
}

.search-info h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.search-info p {
    margin: 0;
    color: #666;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-results p {
    font-size: 18px;
    margin-bottom: 20px;
}

.no-results a {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.no-results a:hover {
    background-color: #0056b3;
}

/* ✅ تحسين للهواتف */
@media (max-width: 768px) {
    .search-inputs {
        grid-template-columns: 1fr;
    }
    
    .search-inputs input[type="text"] {
        grid-column: span 1;
    }
    
    .price-range {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-form {
        padding: 10px;
    }
    
    .search-container {
        padding: 10px;
    }
}

/* ✅ الفوتر */
.main-footer {
    background-color: #333; /* رمادي داكن */
    color: white;
    padding: 30px 10px 20px;
    margin-top: 60px;
    border-top: 3px solid #dc3545; /* حدود حمراء */
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 30px;
    margin-bottom: 20px;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-section h4 {
    color: #ffa41c;
    margin-bottom: 15px;
    font-size: 16px;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section a {
    color: #ddd;
    text-decoration: none;
    display: block;
    margin: 8px 0;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #ffa41c;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    font-size: 14px;
    color: #aaa;
}

/* ✅ تحسين الفوتر للهواتف */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .footer-section {
        min-width: 100%;
    }

    .footer-bottom {
        width: 100%;
        padding: 15px 0;
    }
}