:root {
    --primary-color: #3C7D59;       /* أخضر نخلي */
    --secondary-color: #E28C3B;     /* برتقالي رملي */
    --background-color: #FAF5EF;    /* بيج فاتح */
    --text-color: #4B3B2A;          /* بني داكن */
    --subtext-color: #7A7066;       /* رمادي متوسط */
    --white: #FFFFFF;               /* أبيض */
    --hover-primary: #2F6044;       /* أخضر داكن Hover */
    --hover-secondary: #C5732D;     /* برتقالي أغمق Hover */
    --card-bg: #FFFEFC;             /* خلفية بطاقات ناعمة */
    --form-bg: #FDFBF7;             /* خلفية النماذج دافئة */
}

body {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    color: var(--text-color);
    background: var(--background-color);
    line-height: 1.6;
}

/* ==========================
   الحاوية
========================== */
.container {
    width: 95%;
    max-width: 100%;
    margin: 40px auto;
    padding: 0 16px;
    box-sizing: border-box;
}

/* ==========================
   نموذج البحث
========================== */
.filter-form {
    margin-bottom: 20px;
    background: var(--form-bg);
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}
.search-bar {
    width: 100%;
    max-width: 760px;
    display: flex;
    gap: 10px;
}
.search-bar input[type="text"] {
    padding: 12px 16px;
    border: 1.5px solid var(--primary-color);
    border-radius: 12px;
    flex: 1;
    font-size: 15px;
    background: var(--white);
}
.search-bar button {
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    background: var(--secondary-color);
    color: var(--white);
    font-weight: 600;
    cursor: pointer;
    transition: all .3s ease;
    box-shadow: 0 3px 6px rgba(226, 140, 59, 0.4);
}
.search-bar button:hover {
    background: var(--hover-secondary);
}

.filter-bottom-row {
    width: 100%;
    max-width: 760px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.reset-filters-btn {
    padding: 10px 18px;
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
    transition: all .3s ease;
}
.reset-filters-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}
.store-count {
    font-weight: 700;
    color: var(--subtext-color);
}

/* ==========================
   أزرار تبديل العرض
========================== */
.view-toggle {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    justify-content: center;
}
.view-toggle button {
    padding: 10px 16px;
    border-radius: 12px;
    border: 2px solid var(--primary-color);
    background: var(--card-bg);
    cursor: pointer;
    font-weight: 700;
    color: var(--primary-color);
    transition: all .3s ease;
    box-shadow: 0 2px 6px rgba(60, 125, 89, 0.25);
}
.view-toggle button:hover,
.view-toggle button.active {
    background: var(--primary-color);
    color: var(--white);
}

/* ==========================
   قوائم المتاجر
========================== */
.store-list {
    display: grid;
    gap: 20px;
    align-items: start;
}

/* عرض شبكة */
.view-grid .store-list {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

/* عرض كبير */
.view-large .store-list {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* بطاقات المتاجر */
.store-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 16px;
    border-radius: 16px;
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    height: auto;
    transition: transform .2s ease, box-shadow .2s ease;
}
.store-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.grid-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    height: 100%;
    box-sizing: border-box;
    text-align: center;
}
.store-logo-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 6px;
}
.store-logo {
    width: 60%;
    max-width: 220px;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    background: var(--background-color);
}
.view-large .store-logo {
    width: 70%;
    max-width: 150px;
}

.store-title {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 6px 0 0 0;
    color: var(--text-color);
}
.store-desc--short,
.store-desc--full {
    font-size: 13px;
    color: var(--subtext-color);
}
.store-desc--short {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}
.store-desc--full {
    display: none;
    white-space: normal;
}
.view-large .store-desc--full {
    display: block;
}
.view-large .store-desc--short {
    display: none;
}
.store-ads-count {
    font-size: 13px;
    color: var(--subtext-color);
    margin-top: auto;
    padding-bottom: 6px;
}

/* شعار افتراضي */
.store-logo.placeholder {
    background: #f2eee7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-weight: 600;
    font-size: 14px;
    border-radius: 50%;
    width: 60%;
    max-width: 220px;
    aspect-ratio: 1/1;
    pointer-events: none;
    user-select: none;
}

/* تحسين الموبايل */
@media (max-width: 600px) {
    .filter-bottom-row {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    .view-grid .store-list,
    .view-large .store-list {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

/* تكبير الخط في العرض الكبير */
.view-large .store-title {
    font-size: calc(16px * 1.2);
}
.view-large .store-desc--full {
    font-size: calc(13px * 1.2);
}
.view-large .store-ads-count {
    font-size: calc(13px * 1.2);
}
