/* ═══════════════════════════════════════
   VARIABLES & RESET
   ═══════════════════════════════════════ */
/* :root {
    --primary: #004fc5;
    --accent: #00ba2b;
    --surface: #ffffff;
    --bg: #f5f6f8;
    --text: #1a1a1a;
    --muted: #8e8e93;
    --border: #e5e5ea;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --header-h: 72px;
    --max-w: 680px;   
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
} */

:root {
    --primary: #004fc5;
    --accent: #00ba2b;
    --surface: #ffffff;
    --bg: #f5f6f8;
    --text: #1a1a1a;
    --muted: #8e8e93;
    --border: #e5e5ea;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --header-h: 72px;
    --max-w: 680px;  
}

/* body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
} */

/* ═══════════════════════════════════════
   FIXED SEARCH HEADER
   ═══════════════════════════════════════ */
.search-portal {
    position: fixed;
    top: 7rem;
    right: 0;
    left: 0;
    z-index: 2000;
    background: rgba(245,246,248,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-portal.scrolled {
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.search-bar-wrap {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 1.2rem 1.6rem;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0 1.4rem;
    height: 4.8rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,79,197,0.08);
}

.search-icon {
    font-size: 1.6rem;
    color: var(--muted);
    margin-left: 1rem;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.6rem;
    color: var(--text);
    outline: none;
    font-family: inherit;
}

.search-bar input::placeholder {
    color: #c7c7cc;
}

.search-clear {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: #e5e5ea;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 1.2rem;
    margin-right: 0.4rem;
    transition: background 0.15s;
}

.search-clear:hover {
    background: #d1d1d6;
}

/* Spacer to push content below fixed header */
.header-spacer {
    height: calc(var(--header-h) + 1rem);
}

/* ═══════════════════════════════════════
   SEARCH RESULTS (sample2 style)
   ═══════════════════════════════════════ */
.search-results {
    display: none;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.6rem 2rem;
}

.search-results.active {
    display: block;
}

.results-list {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.result-item {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: 1.4rem 1.6rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:active {
    background: #f2f2f7;
}

.res-icon {
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.res-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.res-fallback {
    color: var(--muted);
    font-size: 1.6rem;
}

.res-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.res-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.res-cat {
    font-size: 1.2rem;
    color: var(--muted);
}

.res-chevron {
    font-size: 1.2rem;
    color: #c7c7cc;
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted);
}

.no-results.hidden {
    display: none;
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.5;
}

.no-results p {
    font-size: 1.5rem;
}

/* ═══════════════════════════════════════
   MAIN APP LAYOUT (sample1 style)
   ═══════════════════════════════════════ */

.stores-app {
    max-width: var(--max-w);
    margin: 0rem auto;
    padding: 0 1.6rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 2.5rem;
}

.category-section {
    animation: fadeUp 0.5s ease both;
    margin: 0;
}

.category-section:nth-child(1) { animation-delay: 0.05s; }
.category-section:nth-child(2) { animation-delay: 0.10s; }
.category-section:nth-child(3) { animation-delay: 0.15s; }
.category-section:nth-child(4) { animation-delay: 0.20s; }

.cat-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.2rem;
    padding-right: 0.4rem;
}

/* ═══════════════════════════════════════
   HORIZONTAL SLIDER
   ═══════════════════════════════════════ */
.slider-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.stores-row {
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 0.4rem 0.4rem 1rem;
    margin: -0.4rem -0.4rem;
    /* Hide scrollbar cross-browser */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stores-row::-webkit-scrollbar {
    display: none;
}

.slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    font-size: 1.2rem;
    transition: opacity 0.2s, transform 0.15s;
    display: none;
}

.slide-arrow:active {
    transform: translateY(-50%) scale(0.92);
}

.slide-prev { right: -0.4rem; }
.slide-next { left: -0.4rem; }

/* ═══════════════════════════════════════
   STORE CARD
   ═══════════════════════════════════════ */
.store-card {
    flex: 0 0 auto;
    width: 8.2rem;
    scroll-snap-align: start;
}

.store-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 0.8rem;
}

.store-thumb {
    width: 8.2rem;
    height: 8.2rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.store-link:active .store-thumb {
    transform: scale(0.96);
    box-shadow: var(--shadow-md);
}

.store-thumb img {
    width: 65%;
    height: 65%;
    object-fit: contain;
    transition: transform 0.3s;
}

.store-link:hover .store-thumb img {
    transform: scale(1.08);
}

.store-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f6f8, #e5e5ea);
    color: var(--muted);
    font-size: 2.4rem;
}

.store-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* ═══════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 8rem 2rem;
    color: var(--muted);
}

.empty-state i {
    font-size: 5rem;
    margin-bottom: 1.6rem;
    opacity: 0.4;
}

.empty-state p {
    font-size: 1.6rem;
}

/* ═══════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════
   RESPONSIVE: BIG SCREENS
   ═══════════════════════════════════════ */
@media (min-width: 768px) {
    :root {
        --header-h: 80px;
        --max-w: 900px;
    }

    .search-bar-wrap {
        padding: 1.6rem 2.4rem;
    }

    .search-bar {
        height: 5.4rem;
        border-radius: 28px;
    }

    .search-icon {
        font-size: 1.8rem;
    }

    .search-bar input {
        font-size: 1.7rem;
    }

    .stores-app {
        padding: 0 2.4rem 4rem;
        gap: 3.2rem;
    }

    .cat-title {
        font-size: 2rem;
        margin-bottom: 1.6rem;
    }

    .store-card,
    .store-thumb {
        width: 10rem;
        height: 10rem;
    }

    .store-name {
        font-size: 1.3rem;
    }

    .slide-arrow {
        width: 3.6rem;
        height: 3.6rem;
        font-size: 1.4rem;
       
    }

    .slide-prev { right: -1rem; }
    .slide-next { left: -1rem; }

    .result-item {
        padding: 1.6rem 2rem;
    }

    .res-icon {
        width: 4.8rem;
        height: 4.8rem;
    }

    .res-name {
        font-size: 1.6rem;
    }
}

@media (min-width: 1024px) {
    :root {
        --max-w: 1100px;
    }

    .store-card,
    .store-thumb {
        width: 11rem;
        height: 11rem;
    }

    .stores-row {
        gap: 1.6rem;
    }
}

/* ═══════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════ */
.hidden { display: none !important; }