/* =============================================
   سوق الشراء - Main Stylesheet
   Language: Arabic (RTL)
   Author: OlSouq Dev Team
   ============================================= */

/* ========== CSS VARIABLES ========== */
:root {
    --primary:       #1A3C5E;
    --primary-light: #2563EB;
    --primary-dark:  #0F2540;
    --accent:        #F59E0B;
    --accent-light:  #FCD34D;
    --accent-dark:   #D97706;
    --success:       #10B981;
    --danger:        #EF4444;
    --warning:       #F59E0B;
    --info:          #3B82F6;

    --bg:            #F0F4F8;
    --bg-card:       #FFFFFF;
    --bg-dark:       #0F2540;

    --text-dark:     #1A202C;
    --text-body:     #4A5568;
    --text-light:    #718096;
    --text-muted:    #A0AEC0;

    --border:        #E2E8F0;
    --border-dark:   #CBD5E0;

    --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow:        0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-md:     0 10px 25px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.06);
    --shadow-lg:     0 20px 40px rgba(0,0,0,.12), 0 8px 16px rgba(0,0,0,.07);
    --shadow-xl:     0 32px 64px rgba(0,0,0,.15);

    --radius-sm:  6px;
    --radius:     12px;
    --radius-md:  16px;
    --radius-lg:  24px;
    --radius-full: 9999px;

    --font-main: 'Cairo', sans-serif;
    --font-alt:  'Tajawal', sans-serif;

    --transition: .3s cubic-bezier(.4,0,.2,1);
    --transition-slow: .6s cubic-bezier(.4,0,.2,1);

    --header-h: 70px;
    --nav-h:    48px;
}

/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text-body);
    direction: rtl;
    text-align: right;
    line-height: 1.7;
    overflow-x: hidden;
    max-width: 100%;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

/* ========== TOPBAR ========== */
.topbar {
    background: var(--primary-dark);
    color: rgba(255,255,255,.8);
    font-size: .8rem;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
}
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.topbar-left span, .topbar-right a {
    display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.75);
    transition: color var(--transition);
}
.topbar-right a:hover { color: var(--accent-light); }
.topbar i { font-size: .75rem; }

/* ========== HEADER ========== */
.header {
    background: #fff;
    box-shadow: 0 2px 20px rgba(0,0,0,.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow var(--transition);
}
.header.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,.15); }

.header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--header-h);
    padding: 0;
    overflow: hidden;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(37,99,235,.3);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-main { font-size: 1.15rem; font-weight: 800; color: var(--primary); }
.logo-sub { font-size: .65rem; color: var(--text-light); font-weight: 400; }

/* Header Search */
.header-search {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.header-search:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(37,99,235,.1);
}
.search-cat {
    background: none;
    border: none;
    border-left: 1px solid var(--border);
    padding: 0 16px;
    height: 46px;
    color: var(--text-body);
    font-size: .85rem;
    cursor: pointer;
    outline: none;
    white-space: nowrap;
}
.search-input {
    flex: 1;
    border: none;
    background: none;
    padding: 0 16px;
    height: 46px;
    font-size: .9rem;
    color: var(--text-dark);
    outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-btn {
    width: 46px; height: 46px;
    background: var(--primary-light);
    color: #fff;
    border-radius: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    transition: background var(--transition);
    flex-shrink: 0;
}
.search-btn:hover { background: var(--primary); }

/* Header Actions */
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-right: auto; }

.btn-post-ad {
    display: flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: .9rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(245,158,11,.35);
    transition: all var(--transition);
    white-space: nowrap;
}
.btn-post-ad:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245,158,11,.45);
}
.btn-post-ad i { font-size: 1.1rem; }

.header-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-body);
    font-size: 1rem;
    position: relative;
    transition: all var(--transition);
}
.header-icon:hover { background: var(--primary-light); color: #fff; }

.notif-badge {
    position: absolute;
    top: -4px; left: -4px;
    background: var(--danger);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
}

.mobile-menu-btn {
    width: 40px; height: 40px;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border-radius: var(--radius-sm);
}
.mobile-menu-btn span {
    width: 22px; height: 2px;
    background: var(--text-dark);
    transition: var(--transition);
    display: block;
}
.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* Main Nav */
.main-nav {
    background: var(--primary);
    border-top: 1px solid rgba(255,255,255,.1);
}
.nav-list {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav-list::-webkit-scrollbar { display: none; }
.nav-list li a {
    display: flex; align-items: center; gap: 6px;
    padding: 12px 18px;
    color: rgba(255,255,255,.8);
    font-size: .85rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all var(--transition);
}
.nav-list li a:hover,
.nav-list li a.active {
    color: var(--accent-light);
    border-bottom-color: var(--accent);
    background: rgba(255,255,255,.05);
}
.nav-list li a i { font-size: .8rem; }

/* ========== HERO ========== */
.hero {
    position: relative;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #1e4a8c 100%);
    padding: 80px 0 60px;
    overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; overflow: hidden; }

.hero-shape {
    position: absolute;
    border-radius: 50%;
    opacity: .08;
    background: #fff;
}
.shape-1 { width: 600px; height: 600px; top: -200px; left: -150px; }
.shape-2 { width: 400px; height: 400px; bottom: -100px; right: -100px; opacity: .05; }
.shape-3 { width: 200px; height: 200px; top: 50%; right: 30%; opacity: .06; }

.particles { position: absolute; inset: 0; }

.hero-content { position: relative; z-index: 2; max-width: 800px; }

.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(245,158,11,.2);
    border: 1px solid rgba(245,158,11,.3);
    color: var(--accent-light);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 24px;
    animation: fadeInDown .6s ease both;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 16px;
    animation: fadeInUp .6s .1s ease both;
}
.text-gradient {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,.75);
    margin-bottom: 36px;
    animation: fadeInUp .6s .2s ease both;
}

/* Hero Search */
.hero-search {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 8px;
    margin-bottom: 24px;
    animation: fadeInUp .6s .3s ease both;
}
.hero-search-inner {
    display: flex;
    align-items: center;
    gap: 0;
}
.hs-field {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px;
    flex: 1;
    border-left: 1px solid var(--border);
}
.hs-field:first-child { border-left: none; }
.hs-field i { color: var(--primary-light); font-size: 1rem; flex-shrink: 0; }
.hs-field input {
    flex: 1; border: none; outline: none;
    font-size: .95rem; color: var(--text-dark);
    background: none;
}
.hs-field input::placeholder { color: var(--text-muted); }
.hs-divider { border-right: 1px solid var(--border); }

.hs-btn {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: #fff;
    padding: 14px 32px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    display: flex; align-items: center; gap: 8px;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(37,99,235,.4);
    transition: all var(--transition);
    flex-shrink: 0;
}
.hs-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37,99,235,.5); }

.hero-tags {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    animation: fadeInUp .6s .4s ease both;
}
.hero-tags span { color: rgba(255,255,255,.6); font-size: .85rem; }
.hero-tags a {
    background: rgba(255,255,255,.12);
    color: rgba(255,255,255,.9);
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: .82rem;
    border: 1px solid rgba(255,255,255,.15);
    transition: all var(--transition);
}
.hero-tags a:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.3); }

/* Hero Stats */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 48px;
    position: relative; z-index: 2;
    animation: fadeInUp .6s .5s ease both;
}
.stat-card {
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius);
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition);
}
.stat-card:hover {
    background: rgba(255,255,255,.18);
    transform: translateY(-3px);
}
.stat-icon {
    width: 48px; height: 48px;
    background: rgba(255,255,255,.15);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-light);
    font-size: 1.3rem;
    flex-shrink: 0;
}
.stat-info { display: flex; flex-direction: column; }
.stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}
.stat-label { font-size: .78rem; color: rgba(255,255,255,.65); margin-top: 4px; }

/* ========== SECTIONS ========== */
.section { padding: 70px 0; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 12px;
}
.section-header.centered {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.section-label {
    display: inline-block;
    color: var(--primary-light);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    position: relative;
    padding-right: 16px;
}
.section-label::before {
    content: '';
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
}

.section-sub {
    color: var(--text-light);
    font-size: .95rem;
    margin-top: 8px;
    max-width: 500px;
}

.see-all {
    color: var(--primary-light);
    font-size: .9rem;
    font-weight: 600;
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-full);
    transition: all var(--transition);
}
.see-all:hover { background: var(--primary-light); color: #fff; }

/* ========== CATEGORIES ========== */
.categories-section { background: #fff; }

.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.cat-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
    cursor: pointer;
}
.cat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    border-radius: 0 0 0 80px;
    background: var(--cat-color, var(--primary-light));
    opacity: .1;
    transition: all var(--transition);
}
.cat-card:hover {
    border-color: var(--cat-color, var(--primary-light));
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.cat-card:hover::before { width: 100%; height: 100%; border-radius: 0; opacity: .08; }

.cat-icon-wrap {
    width: 52px; height: 52px;
    border-radius: var(--radius);
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    color: var(--cat-color, var(--primary));
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    transition: all var(--transition);
}
.cat-card:hover .cat-icon-wrap {
    background: var(--cat-color, var(--primary));
    color: #fff;
    transform: scale(1.1) rotate(-5deg);
}

.cat-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}
.cat-count { font-size: .78rem; color: var(--text-muted); }

.cat-arrow {
    position: absolute;
    bottom: 16px; left: 16px;
    width: 28px; height: 28px;
    background: var(--cat-color, var(--primary-light));
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem;
    opacity: 0;
    transform: translateX(-8px);
    transition: all var(--transition);
}
.cat-card:hover .cat-arrow { opacity: 1; transform: translateX(0); }

/* ========== AD CARD ========== */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.ads-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.ad-card {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all var(--transition);
    position: relative;
}
.ad-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.ad-image-wrap {
    position: relative;
    padding-top: 66%;
    overflow: hidden;
    background: var(--bg);
}
.ad-image-wrap img {
    position: absolute;
    inset: 0; width: 100%; height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.ad-card:hover .ad-image-wrap img { transform: scale(1.08); }

.ad-badges {
    position: absolute;
    top: 10px; right: 10px;
    display: flex; flex-direction: column; gap: 4px;
}
.badge-featured, .badge-urgent {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: .72rem;
    font-weight: 700;
}
.badge-featured {
    background: rgba(245,158,11,.95);
    color: #fff;
    backdrop-filter: blur(4px);
}
.badge-urgent { background: rgba(239,68,68,.95); color: #fff; }

.fav-btn {
    position: absolute;
    top: 10px; left: 10px;
    width: 34px; height: 34px;
    background: rgba(255,255,255,.9);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    font-size: .9rem;
    transition: all var(--transition);
    backdrop-filter: blur(4px);
}
.fav-btn:hover, .fav-btn.active { color: var(--danger); transform: scale(1.15); }

.ad-views {
    position: absolute;
    bottom: 10px; left: 10px;
    background: rgba(0,0,0,.5);
    color: #fff;
    font-size: .72rem;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(4px);
}

.ad-body { padding: 16px; }

.ad-cat {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--primary-light);
    font-size: .75rem;
    font-weight: 600;
    margin-bottom: 6px;
    background: rgba(37,99,235,.08);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.ad-title {
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}
.ad-title a { color: var(--text-dark); }
.ad-title a:hover { color: var(--primary-light); }

.ad-price .price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
}
.ad-price .price-free { color: var(--success); font-weight: 700; }

.ad-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: .75rem;
    color: var(--text-muted);
}
.ad-meta span { display: flex; align-items: center; gap: 4px; }
.ad-meta i { font-size: .7rem; }

/* ========== PROMO SECTION ========== */
.promo-section {
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%);
    padding: 60px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.promo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.promo-card {
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}
.promo-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.promo-sell {
    background: linear-gradient(135deg, #1A3C5E, #2563EB);
    color: #fff;
}
.promo-buy {
    background: linear-gradient(135deg, #0f4c2b, #10B981);
    color: #fff;
}
.promo-affiliate {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
}

.promo-icon {
    width: 64px; height: 64px;
    background: rgba(255,255,255,.2);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.promo-card h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.promo-card p { font-size: .9rem; opacity: .85; margin-bottom: 24px; }

.promo-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.2);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: .9rem;
    border: 1px solid rgba(255,255,255,.3);
    transition: all var(--transition);
}
.promo-btn:hover { background: rgba(255,255,255,.35); gap: 12px; }

/* ========== FILTER TABS ========== */
.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.filter-tab {
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-light);
    background: #fff;
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.filter-tab:hover { border-color: var(--primary-light); color: var(--primary-light); }
.filter-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(26,60,94,.3);
}

/* ========== LATEST SECTION ========== */
.latest-section { background: var(--bg); }

.loading-ads {
    grid-column: 1 / -1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px;
    gap: 16px;
    color: var(--text-muted);
}

.loader {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.load-more-wrap { text-align: center; margin-top: 40px; }

.btn-load-more {
    background: #fff;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 12px 36px;
    border-radius: var(--radius-full);
    font-size: .95rem;
    font-weight: 700;
    display: inline-flex; align-items: center; gap: 8px;
    transition: all var(--transition);
}
.btn-load-more:hover { background: var(--primary); color: #fff; }

/* ========== HOW IT WORKS ========== */
.how-section { background: #fff; }

.steps-grid {
    display: flex;
    align-items: center;
    gap: 0;
}

.step-card {
    flex: 1;
    text-align: center;
    padding: 40px 32px;
    position: relative;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}
.step-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.step-num {
    font-size: 4rem;
    font-weight: 900;
    color: rgba(37,99,235,.08);
    line-height: 1;
    margin-bottom: -10px;
    font-family: var(--font-alt);
}

.step-icon {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    color: #fff;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(37,99,235,.3);
    transition: all var(--transition);
}
.step-card:hover .step-icon { transform: scale(1.1) rotate(-5deg); }

.step-card h3 { font-size: 1.15rem; font-weight: 800; color: var(--text-dark); margin-bottom: 10px; }
.step-card p { font-size: .9rem; color: var(--text-light); }

.step-arrow {
    font-size: 1.5rem;
    color: var(--border-dark);
    padding: 0 20px;
    flex-shrink: 0;
}

/* ========== TESTIMONIALS ========== */
.testimonials-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    overflow: hidden;
}
.testimonials-section .section-label { color: var(--accent-light); }
.testimonials-section .section-title { color: #fff; }

.testimonials-slider {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.testimonial-card {
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all var(--transition);
    position: relative;
}
.testimonial-card:hover {
    background: rgba(255,255,255,.18);
    transform: translateY(-4px);
}

.testi-quote {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 16px;
    opacity: .5;
}
.testimonial-card > p {
    font-size: .95rem;
    line-height: 1.8;
    color: rgba(255,255,255,.85);
    margin-bottom: 24px;
}

.testi-user {
    display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.testi-user img {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.3);
}
.testi-user strong { display: block; font-size: .95rem; color: #fff; }
.testi-user span { font-size: .8rem; color: rgba(255,255,255,.6); }

.testi-stars { color: var(--accent); font-size: .85rem; }
.testi-dots { display: flex; justify-content: center; gap: 8px; }
.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    transition: all var(--transition);
    cursor: pointer;
}
.dot.active { background: var(--accent); width: 24px; border-radius: var(--radius-full); }

/* ========== CTA ========== */
.cta-section {
    position: relative;
    padding: 80px 0;
    overflow: hidden;
    background: var(--bg);
}
.cta-bg {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(37,99,235,.05), rgba(245,158,11,.05));
    border-top: 2px solid var(--border);
    border-bottom: 2px solid var(--border);
}
.cta-content {
    position: relative;
    text-align: center;
}
.cta-content h2 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 16px;
}
.cta-content p { color: var(--text-light); font-size: 1rem; margin-bottom: 36px; }

.cta-buttons { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

.cta-btn-primary {
    display: inline-flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    padding: 16px 36px;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 8px 25px rgba(245,158,11,.4);
    transition: all var(--transition);
}
.cta-btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(245,158,11,.5); }

.cta-btn-secondary {
    display: inline-flex; align-items: center; gap: 10px;
    background: #fff;
    color: var(--primary);
    padding: 16px 36px;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid var(--primary);
    box-shadow: var(--shadow);
    transition: all var(--transition);
}
.cta-btn-secondary:hover { background: var(--primary); color: #fff; transform: translateY(-3px); }

/* ========== FOOTER ========== */
.footer { background: var(--primary-dark); color: rgba(255,255,255,.75); }

.footer-top { padding: 60px 0 40px; }

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
}

.footer-logo {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 1.4rem; font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
}
.footer-logo i {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
}

.footer-brand p {
    font-size: .88rem;
    line-height: 1.8;
    color: rgba(255,255,255,.6);
    margin-bottom: 24px;
}

.social-links { display: flex; gap: 10px; }
.social-link {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
    transition: all var(--transition);
    border: 1px solid rgba(255,255,255,.15);
    color: rgba(255,255,255,.7);
}
.social-link:hover { transform: translateY(-3px); color: #fff; }
.social-link.facebook:hover { background: #1877f2; border-color: #1877f2; }
.social-link.twitter:hover { background: #1da1f2; border-color: #1da1f2; }
.social-link.instagram:hover { background: #e1306c; border-color: #e1306c; }
.social-link.youtube:hover { background: #ff0000; border-color: #ff0000; }
.social-link.whatsapp:hover { background: #25d366; border-color: #25d366; }

.footer-col h4 {
    font-size: 1rem; font-weight: 700; color: #fff;
    margin-bottom: 20px;
    position: relative; padding-bottom: 12px;
}
.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 30px; height: 2px;
    background: var(--accent);
}

.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a {
    font-size: .88rem;
    color: rgba(255,255,255,.6);
    display: flex; align-items: center; gap: 8px;
    transition: all var(--transition);
}
.footer-col ul a:hover { color: var(--accent-light); gap: 12px; }
.footer-col ul a i { font-size: .7rem; color: var(--accent); }

.app-badges { display: flex; flex-direction: column; gap: 10px; }
.app-badge {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--radius);
    padding: 10px 16px;
    color: #fff;
    transition: all var(--transition);
}
.app-badge:hover { background: rgba(255,255,255,.15); transform: translateX(-4px); }
.app-badge i { font-size: 1.5rem; }
.app-badge small { display: block; font-size: .7rem; opacity: .7; }
.app-badge strong { font-size: .9rem; }

.footer-contact p {
    display: flex; align-items: center; gap: 10px;
    font-size: .85rem; color: rgba(255,255,255,.6);
    margin-bottom: 8px;
}
.footer-contact i { color: var(--accent); width: 16px; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 20px 0;
}
.footer-bottom-inner {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { font-size: .85rem; color: rgba(255,255,255,.5); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: .82rem; color: rgba(255,255,255,.5); transition: color var(--transition); }
.footer-links a:hover { color: var(--accent-light); }

/* ========== BACK TO TOP ========== */
.back-to-top {
    position: fixed;
    bottom: 32px; left: 32px;
    width: 46px; height: 46px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition);
    z-index: 999;
    pointer-events: none;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--primary-light); transform: translateY(-3px); }

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 9999;
}
.toast {
    display: flex; align-items: center; gap: 12px;
    background: #fff;
    border-radius: var(--radius);
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    font-size: .9rem;
    font-weight: 600;
    min-width: 280px;
    border-right: 4px solid var(--primary);
    animation: slideInRight .3s ease;
    color: var(--text-dark);
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger);  }
.toast.warning { border-color: var(--warning); }
.toast i { font-size: 1.2rem; }
.toast.success i { color: var(--success); }
.toast.error   i { color: var(--danger);  }
.toast.warning i { color: var(--warning); }

/* ========== SKELETON ========== */
.skeleton-line {
    background: linear-gradient(90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
    display: block;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ========== UTILS ========== */
.mt-4  { margin-top: 32px; }
.mt-2  { margin-top: 10px; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--text-muted); }

/* ── Global buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}
.btn-block { width: 100%; display: flex; }
.btn-sm  { padding: 7px 14px; font-size: .82rem; }
.btn-lg  { padding: 14px 28px; font-size: 1rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover  { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-info    { background: var(--info); color: #fff; }
.btn-info:hover    { background: #2563eb; }
.btn-ghost   { background: transparent; border: none; color: var(--text-body); }
.btn-ghost:hover   { background: var(--bg); }

/* ── Form controls ── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: .88rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: .9rem;
    font-family: inherit;
    color: var(--text-body);
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; }

/* ── Alerts ── */
.alert {
    padding: 13px 18px;
    border-radius: 10px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .9rem;
    font-weight: 600;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error, .alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info    { background: #dbeafe; color: #1e40af; }

/* ── Badges global ── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: .75rem; font-weight: 700;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-info     { background: #dbeafe; color: #1e40af; }

.btn-outline {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: .95rem;
    font-weight: 700;
    transition: all var(--transition);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ========== ANIMATIONS ========== */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .categories-grid { grid-template-columns: repeat(4, 1fr); }
    .ads-grid { grid-template-columns: repeat(3, 1fr); }
    .ads-grid-5 { grid-template-columns: repeat(4, 1fr); }
    .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
    .footer-col:last-child { grid-column: 1 / -1; }
}

@media (max-width: 992px) {
    .hero { padding: 60px 0 40px; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .categories-grid { grid-template-columns: repeat(3, 1fr); }
    .promo-grid { grid-template-columns: 1fr; }
    .ads-grid { grid-template-columns: repeat(2, 1fr); }
    .ads-grid-5 { grid-template-columns: repeat(3, 1fr); }
    .testimonials-slider { grid-template-columns: 1fr; }
    .steps-grid { flex-direction: column; }
    .step-arrow { transform: rotate(90deg); padding: 10px 0; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    /* ── Overflow control ── */
    *, *::before, *::after { box-sizing: border-box; }
    html, body { overflow-x: hidden; max-width: 100%; }

    /* ── Header ── */
    .topbar { display: none; }
    .header-search { display: none !important; }
    .logo-sub { display: none; }
    .logo-icon { width: 36px; height: 36px; font-size: 1rem; }
    .logo-main { font-size: .95rem; }
    .mobile-menu-btn { display: flex; }
    .header-actions { gap: 6px; }
    .btn-post-ad { padding: 8px 12px; }
    .btn-post-ad span { display: none; }
    .hdr-username { display: none !important; }
    .hdr-dropdown { left: auto !important; right: 0 !important; }

    /* ── Mobile search bar (injected by header.php) ── */
    .mobile-searchbar { display: block !important; }

    /* ── Nav ── */
    .main-nav {
        display: none;
        position: fixed;
        top: var(--header-h); right: 0; left: 0;
        z-index: 999;
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
        box-shadow: var(--shadow-lg);
    }
    .main-nav.open { display: block; }
    .nav-list { flex-direction: column; gap: 0; }
    .nav-list li a { padding: 13px 20px; border-bottom: 1px solid rgba(255,255,255,.1); border-left: none; border-right: none; }

    /* ── Hero ── */
    .hero-title { font-size: 1.7rem; }
    .hero-search-inner { flex-direction: column; }
    .hs-field { border-left: none; border-bottom: 1px solid var(--border); }
    .hs-btn { width: 100%; justify-content: center; }
    .hs-divider { border-right: none; }

    /* ── Grids ── */
    .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .ads-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .ads-grid-5 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }

    /* ── Search page ── */
    .search-page-layout { grid-template-columns: 1fr !important; gap: 14px; }
    .filter-sidebar { position: static !important; }
    .filter-header { cursor: pointer; }

    /* ── Dashboard ── */
    .dashboard-layout { grid-template-columns: 1fr !important; padding: 14px 0 40px; }
    .dashboard-sidebar, .dash-sidebar { display: none !important; }
    .stats-row { grid-template-columns: 1fr 1fr !important; gap: 12px; }
    .messages-layout { grid-template-columns: 1fr !important; }
    .conversations-list { max-height: 240px; border-left: none; border-bottom: 1px solid var(--border); }

    /* ── Post form ── */
    .post-ad-layout { grid-template-columns: 1fr !important; }
    .form-row { grid-template-columns: 1fr !important; }

    /* ── Ad detail ── */
    .ad-detail-layout { grid-template-columns: 1fr !important; }
    .ad-detail-sidebar { order: -1; }

    /* ── Tables ── */
    .data-table, .dash-table, .admin-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* ── Footer ── */
    .footer-grid { grid-template-columns: 1fr !important; gap: 24px; }
    .footer-bottom-inner { flex-direction: column; text-align: center; gap: 8px; }
    .cta-buttons { flex-direction: column; align-items: center; }

    /* ── Utils ── */
    .page-wrapper { padding: 16px 0 40px; }
}

@media (max-width: 480px) {
    .section { padding: 40px 0; }
    .container { padding: 0 12px; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .ads-grid, .ads-grid-5 { grid-template-columns: 1fr 1fr; gap: 10px; }
    .ads-grid-search, .results-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
    .hero-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-num { font-size: 1.2rem; }
    .hero-title { font-size: 1.4rem; }
    .back-to-top { bottom: 16px; left: 16px; }
    .toast-container { right: 12px; left: 12px; }
    .toast { min-width: unset; }
    .pagination { gap: 4px; }
    .page-btn { min-width: 32px; height: 32px; font-size: .8rem; }
}

/* ========== PAGE-SPECIFIC: AUTH ========== */
.auth-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 40px 20px;
}
.auth-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%; max-width: 460px;
    box-shadow: var(--shadow-xl);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo .logo-icon { margin: 0 auto 12px; width: 64px; height: 64px; font-size: 1.8rem; border-radius: var(--radius-md); }
.auth-title { font-size: 1.6rem; font-weight: 800; color: var(--text-dark); text-align: center; margin-bottom: 8px; }
.auth-sub { text-align: center; color: var(--text-muted); font-size: .9rem; margin-bottom: 32px; }
.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: #fff;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(37,99,235,.35);
    transition: all var(--transition);
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(37,99,235,.45); }
.auth-footer { text-align: center; margin-top: 24px; font-size: .9rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary-light); font-weight: 600; }

/* ========== AD DETAIL PAGE ========== */
.ad-detail-wrap {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
    padding: 32px 0;
}
.ad-gallery { border-radius: var(--radius-lg); overflow: hidden; }
.ad-main-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.ad-thumbs { display: flex; gap: 8px; margin-top: 8px; }
.ad-thumb { width: 70px; height: 52px; border-radius: var(--radius-sm); object-fit: cover; cursor: pointer; border: 2px solid transparent; transition: border-color var(--transition); }
.ad-thumb.active { border-color: var(--primary-light); }

.ad-info-card { background: #fff; border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.ad-info-price { font-size: 2rem; font-weight: 900; color: var(--primary); margin-bottom: 20px; }

.seller-card { background: #fff; border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); margin-top: 16px; }
.seller-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.seller-info h4 { font-weight: 700; }
.seller-info span { font-size: .8rem; color: var(--text-muted); }
.btn-contact {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, var(--success), #059669);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    margin-top: 16px;
    box-shadow: 0 4px 15px rgba(16,185,129,.35);
    transition: all var(--transition);
}
.btn-contact:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16,185,129,.45); }

/* ============================================================
   Dashboard-specific header & mobile fixes
   ============================================================ */

/* When on dashboard pages, header should sit above dash-topbar */
.dash-wrapper ~ * {}

/* Ensure hdr-dropdown is always visible above everything */
.hdr-user-wrap.open .hdr-dropdown {
    z-index: 9999 !important;
}

/* Fix main-nav on mobile for dashboard pages - must be below sidebar */
@media (max-width: 991px) {
    .main-nav { z-index: 300; }
    .dash-wrapper .header { z-index: 400; }
}

/* Prevent body scroll when sidebar is open on mobile */
body.sidebar-open { overflow: hidden; }

/* Dashboard pages: hide the site header on very small screens to save space */
@media (max-width: 480px) {
    .dash-wrapper + * {}
    /* Keep header visible but make it compact */
    .dash-wrapper ~ footer .footer-grid { grid-template-columns: 1fr; }
}

/* Fix footer on dashboard pages */
.dash-wrapper ~ footer { margin-top: 0; }

/* Responsive table on mobile for dashboard */
@media (max-width: 600px) {
    .dash-table-wrap { margin: 0 -14px; }
    .dash-table { font-size: .82rem; }
}
