/* Q Syria - Core Application Stylesheet */

/* Custom Variables */
:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 20px -2px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px -5px rgba(0,0,0,0.12);
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --info-color: #3b82f6;
    --transition-speed: 0.3s;
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 70px; /* Space for mobile bottom nav */
}

/* Language direction styles */
body.lang-ar {
    direction: rtl;
    font-family: var(--font-arabic);
}

body.lang-en {
    direction: ltr;
    font-family: var(--font-english);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-speed);
}

button, input, select, textarea {
    font-family: inherit;
    font-size: 100%;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Core Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Premium Header styling */
header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    flex: 1;
}

.header-left {
    justify-content: flex-start;
    gap: 28px;
}

.header-right {
    justify-content: flex-end;
}

.header-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    text-decoration: none;
}

.header-icon-btn:hover {
    background: rgba(var(--primary-rgb), 0.08);
}

.header-icon-btn:hover .header-icon {
    color: var(--primary-color);
}

.header-icon {
    font-size: 1.25rem;
    color: var(--header-text-color, var(--text-primary));
    cursor: pointer;
    transition: color var(--transition-speed);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    flex: 2;
}

.logo-img {
    height: 42px;
    width: 42px;
    object-fit: contain;
    border-radius: 50%;
}

.app-title {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

/* Mobile Bottom Navigation */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.72rem;
    color: var(--text-secondary);
    gap: 4px;
    flex: 1;
    text-align: center;
}

.mobile-nav-item i {
    font-size: 1.3rem;
}

.mobile-nav-item.active {
    color: var(--primary-color);
    font-weight: 700;
}

/* Overlapping Circle Plus Button styling */
.mobile-nav-post-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    padding-bottom: 6px;
    flex: 1;
}

.mobile-nav-post {
    position: absolute;
    top: -24px;
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    color: white !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
    border: 4px solid var(--bg-card); /* Creates the overlay cutout effect */
    transition: transform 0.2s ease;
    z-index: 1010;
}

.mobile-nav-post:hover {
    transform: scale(1.05);
}

.mobile-nav-post i {
    font-size: 1.5rem;
}

.mobile-nav-post-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 26px; /* Pushes label below circle */
}

/* Sidebar Drawer Menu styles */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar-drawer {
    position: fixed;
    top: 0;
    right: -330px; /* Safe default off-screen position fallback */
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-card);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Coordinate-based sliding layout (RTL / LTR safe) */
.lang-ar .sidebar-drawer {
    right: -330px;
    left: auto;
    border-left: 1px solid var(--border-color);
}
.lang-en .sidebar-drawer {
    left: -330px;
    right: auto;
    border-right: 1px solid var(--border-color);
}

.lang-ar .sidebar-drawer.active {
    right: 0;
}
.lang-en .sidebar-drawer.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.sidebar-search-box {
    display: flex;
    align-items: center;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0 12px;
}

.sidebar-search-box input {
    border: none;
    background: transparent;
    padding: 8px 6px;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.sidebar-cat-list {
    list-style: none;
    padding: 12px 16px;
    overflow-y: auto;
}

.sidebar-cat-list li {
    margin-bottom: 8px; /* Spacing between fields */
}

.sidebar-cat-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-main); /* Light background for fields */
    border: 1px solid var(--border-color); /* Field boundary border */
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-speed) ease;
}

.sidebar-cat-list li a:hover {
    background: rgba(var(--primary-rgb), 0.05);
    border-color: var(--primary-color);
}

.sidebar-cat-list .arrow-icon {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Hero Section / Banner Sliders */
.hero-banner {
    position: relative;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    margin: 20px 0;
    height: 180px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--primary-rgb), 0.2));
}

@media (min-width: 768px) {
    .hero-banner {
        height: 300px;
    }
}

.banner-slide {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.banner-content {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 16px 24px;
    border-radius: var(--border-radius-sm);
    text-align: center;
    backdrop-filter: blur(4px);
    max-width: 90%;
}

.banner-content h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.banner-content p {
    font-size: 0.9rem;
}

/* Governorates Selector Scroll */
.gov-selector-wrapper {
    margin: 20px 0;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gov-list-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 4px 12px 4px;
    scrollbar-width: none; /* Firefox */
}

.gov-list-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.gov-chip {
    flex: 0 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed);
}

.gov-chip:hover, .gov-chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(var(--primary-rgb), 0.2);
}

/* Categories List Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 16px;
    }
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.category-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.category-card span {
    font-size: 0.75rem;
    font-weight: 600;
}

.category-card:hover, .category-card.active {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.03);
    transform: scale(1.03);
}

/* Ad Listings Grid & Card styling */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

@media (min-width: 576px) {
    .ads-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .ads-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.ad-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed);
}

.ad-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.ad-card-badge {
    position: absolute;
    top: 12px;
    z-index: 5;
    padding: 4px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}

.lang-ar .ad-card-badge { left: 12px; }
.lang-en .ad-card-badge { right: 12px; }

.badge-sale { background: var(--success-color); }
.badge-rent { background: var(--info-color); }
.badge-auction { background: var(--danger-color); }
.badge-charity { background: #ec4899; }
.badge-job { background: #8b5cf6; }
.badge-service { background: #f59e0b; }
.badge-featured {
    background: var(--secondary-color);
    color: #000;
    font-weight: bold;
    top: auto;
    bottom: 12px;
}
.lang-ar .badge-featured { right: 12px; }
.lang-en .badge-featured { left: 12px; }

.ad-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #e2e8f0;
}

.ad-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ad-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ad-card-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.ad-card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

/* Detail View Styles */
.ad-detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 20px 0;
}

@media (min-width: 992px) {
    .ad-detail-layout {
        grid-template-columns: 2fr 1fr;
    }
}

.image-gallery {
    background: #000;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    position: relative;
    height: 250px;
}

@media (min-width: 768px) {
    .image-gallery {
        height: 400px;
    }
}

.gallery-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.detail-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.contact-section {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--border-color);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Smart Search Box - Hidden by default, shown only via JS toggle */
.search-container {
    display: none;  /* Truly hidden — JS adds .active to show */
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
    padding: 16px;
    margin-top: 10px;
    animation: searchSlideIn 0.3s ease;
}

@keyframes searchSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.search-container.active {
    display: block;  /* Shown when JS adds .active class */
}

.search-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 768px) {
    .search-form {
        grid-template-columns: 2fr 1fr 1fr 1fr 100px;
    }
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-main);
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    width: 100%;
    max-width: 500px;
    padding: 24px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideUp var(--transition-speed) ease;
}

@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.close-btn {
    border: none;
    background: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

/* Auction Bidding Widget */
.auction-box {
    border: 2px solid var(--danger-color);
    background: rgba(239, 68, 68, 0.02);
}

.countdown-timer {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.time-unit {
    background: #000;
    color: white;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    min-width: 50px;
    text-align: center;
}

.time-label {
    font-size: 0.65rem;
    display: block;
    color: var(--text-light);
}

/* Admin Dashboard layout */
.admin-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media (min-width: 992px) {
    .admin-container {
        grid-template-columns: 260px 1fr;
    }
}

.admin-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
}

.admin-sidebar-link.active {
    background: var(--primary-color);
    color: white;
}

.admin-sidebar-link:not(.active):hover {
    background: var(--bg-main);
}

.admin-card-stats {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 576px) {
    .admin-card-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Admin Data Tables */
.table-responsive {
    overflow-x: auto;
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.lang-en .table {
    text-align: left;
}

.table th, .table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: #f1f5f9;
    font-weight: 600;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #334155;
    color: white;
    padding: 12px 24px;
    border-radius: 40px;
    z-index: 3000;
    box-shadow: var(--shadow-lg);
    font-weight: 500;
    display: none;
}
.toast.success { background: var(--success-color); }
.toast.error { background: var(--danger-color); }

/* Auction listing card specific layouts */
.ad-card-auction-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border-radius: var(--border-radius-sm);
    padding: 6px 10px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.auction-card-timer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
}

.auction-card-timer i {
    font-size: 0.9rem;
}

.auction-card-bids {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    color: var(--primary-color);
}

.auction-card-bids i {
    font-size: 0.85rem;
}

/* Side Banners */
.side-banner {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-md);
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    display: block;
}

.side-banner .banner-content {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.65);
    color: white;
    padding: 12px 18px;
    border-radius: var(--border-radius-sm);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    max-width: 90%;
    width: calc(100% - 24px);
    box-sizing: border-box;
}

.side-banner .banner-content h2 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Float fixed in empty margins on large screens (min-width: 1560px) */
@media (min-width: 1560px) {
    .side-banner.left {
        position: fixed;
        left: calc((100vw - 1200px) / 2 - 160px - 20px);
        top: 150px;
        width: 160px;
        height: 600px;
        z-index: 99;
        display: block;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .side-banner.right {
        position: fixed;
        right: calc((100vw - 1200px) / 2 - 160px - 20px);
        top: 150px;
        width: 160px;
        height: 600px;
        z-index: 99;
        display: block;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .side-banner:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
    }
    .side-banners-container {
        display: block;
        height: 0;
        margin: 0;
        padding: 0;
    }
}

/* Medium screen adjustments (between 1400px and 1559px) */
@media (min-width: 1400px) and (max-width: 1559px) {
    .side-banner.left {
        position: fixed;
        left: calc((100vw - 1200px) / 2 - 100px - 10px);
        top: 150px;
        width: 100px;
        height: 450px;
        z-index: 99;
        display: block;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .side-banner.right {
        position: fixed;
        right: calc((100vw - 1200px) / 2 - 100px - 10px);
        top: 150px;
        width: 100px;
        height: 450px;
        z-index: 99;
        display: block;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .side-banner:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
    }
    .side-banner .banner-content h2 {
        font-size: 0.95rem;
    }
    .side-banner .banner-content {
        padding: 8px 12px;
    }
    .side-banner .banner-content .btn-primary {
        display: none !important; /* Hide button on narrower columns */
    }
    .side-banners-container {
        display: block;
        height: 0;
        margin: 0;
        padding: 0;
    }
}

/* Hide on screens smaller than 1400px as there is no empty margin space */
@media (max-width: 1399px) {
    .side-banner.left,
    .side-banner.right {
        display: none;
    }
    .side-banners-container {
        display: none;
    }
}

/* Hide mobile bottom navigation bar on desktop */
@media (min-width: 768px) {
    .mobile-nav, .mobile-nav-curved-wrapper {
        display: none !important;
    }
}

/* ==========================================================================
   HOMEPAGE PREMIUM REDESIGN STYLES (Rafeeq + Mazaad Qatar Merge)
   ========================================================================== */

/* 1. Header Overrides on Homepage */
body.homepage-mode header {
    background: transparent !important;
    border-bottom: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 101;
}

body.homepage-mode header * {
    color: #ffffff !important;
}

/* Header Elements Styling */
.header-left-points {
    display: flex;
    align-items: center;
}

.user-points-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff !important;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.user-points-badge i {
    color: #f6b020 !important; /* Gold Star */
}

.user-points-badge .points-lbl {
    font-size: 0.7rem;
    opacity: 0.9;
    font-weight: 400;
}

.header-login-link {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.header-center-location {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
}

.header-center-location .loc-title {
    font-size: 0.65rem;
    opacity: 0.8;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.header-center-location .loc-name {
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-center-location .loc-arrow {
    font-size: 0.65rem;
    margin-top: 2px;
    transition: transform 0.2s ease;
}

.header-center-location:hover .loc-arrow {
    transform: translateY(2px);
}

/* 2. Top Hero Section Wrapper */
.homepage-hero-wrapper {
    background: linear-gradient(135deg, #a11b5e, #7c0b43);
    margin-left: -16px;
    margin-right: -16px;
    margin-top: 0; /* Reset negative margin as main padding is handled dynamically */
    padding: 100px 16px 120px 16px; /* Increased padding to expand height and show banner art */
    min-height: 250px; /* Enforce a spacious height for banner images */
    position: relative;
    box-sizing: border-box;
}

/* 3. Rounded Pill Search Bar */
.hero-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 20px auto;
    position: relative;
    z-index: 10;
}

.search-fav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    outline: none;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

.search-fav-btn i {
    font-size: 1.25rem;
    color: #1e293b;
    transition: color 0.2s ease;
}

.search-fav-btn:hover {
    transform: scale(1.05);
}

.hero-search-box-wrapper {
    flex-grow: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.hero-search-box-wrapper input {
    width: 100%;
    background: #ffffff;
    border: none;
    outline: none;
    border-radius: 30px;
    padding: 14px 18px;
    font-size: 0.9rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

/* Align search icons inside input */
body.lang-ar .hero-search-box-wrapper input {
    padding-right: 44px;
    padding-left: 50px;
}
body.lang-en .hero-search-box-wrapper input {
    padding-left: 44px;
    padding-right: 50px;
}

.search-box-icon {
    position: absolute;
    color: #94a3b8;
    font-size: 1.1rem;
    pointer-events: none;
}
body.lang-ar .search-box-icon { right: 16px; }
body.lang-en .search-box-icon { left: 16px; }

.search-filter-toggle {
    position: absolute;
    background: none;
    border: none;
    outline: none;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
}
body.lang-ar .search-filter-toggle { left: 12px; }
body.lang-en .search-filter-toggle { right: 12px; }

.search-filter-toggle:hover {
    color: #a11b5e;
}

/* Advanced Search Dropdown Card */
.advanced-search-dropdown {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-color);
    padding: 20px;
    max-width: 600px;
    margin: -10px auto 20px auto;
    position: relative;
    z-index: 11;
    box-sizing: border-box;
    animation: searchSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 576px) {
    .form-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.advanced-search-dropdown label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
    display: block;
}

/* 4. Hero Wave Divider */
.hero-wave-divider {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 40px;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
}

.hero-wave-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 100%;
    transform: rotateY(180deg);
}

/* Fallback default welcome slide */
.hero-banner .fallback-slide {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 20px !important;
}

.post-ad-hero-btn {
    transition: transform 0.2s ease;
}
.post-ad-hero-btn:hover {
    transform: translateY(-2px);
}

/* 5. 3D Category Card Styling */
.categories-section-wrapper {
    margin-bottom: 24px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important; /* Changed from 4 to 3 columns for mobile compatibility */
    gap: 12px 8px !important;
}

@media (min-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 18px 12px !important;
    }
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.category-icon-bg {
    width: 82px;
    height: 82px;
    background: #ffffff;
    border-radius: 26px;
    padding: 0 !important; /* Remove padding so images cover full container */
    overflow: hidden; /* Prevent corner overflow */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, border-color 0.2s ease;
}

.category-card:hover .category-icon-bg {
    transform: translateY(-5px) scale(1.04);
    box-shadow: 0 8px 20px rgba(161, 27, 94, 0.15);
    border-color: var(--primary-color);
}

.category-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Cover the entire icon area */
    margin-bottom: 0 !important;
}

.category-card i {
    font-size: 2.1rem !important; /* Enlarged icon font size */
    color: var(--primary-color) !important;
}

.category-card-name {
    font-size: 0.85rem !important; /* Enlarged card name font size */
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    text-align: center;
    margin-top: 4px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.new-cat-badge {
    position: absolute;
    top: -6px;
    z-index: 5;
    background: #a11b5e;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}
body.lang-ar .new-cat-badge { right: -2px; }
body.lang-en .new-cat-badge { left: -2px; }

/* 6. VIP Carousel Horizontal Swipe Section */
.vip-carousel-scroll {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding: 8px 4px 16px 4px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}

.vip-carousel-scroll::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.vip-carousel-card {
    flex-shrink: 0;
    width: 200px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
}

.vip-carousel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.vip-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.vip-card-img-wrapper {
    height: 120px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.vip-card-auction-badge {
    position: absolute;
    bottom: 8px;
    background: rgba(161, 27, 94, 0.85);
    color: white;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
}
body.lang-ar .vip-card-auction-badge { right: 8px; }
body.lang-en .vip-card-auction-badge { left: 8px; }

.vip-card-body {
    padding: 12px;
}

.vip-card-price {
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 800;
    display: block;
    margin-bottom: 4px;
}

.vip-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
}

.vip-card-meta {
    display: flex;
    align-items: center;
    font-size: 0.72rem;
    color: var(--text-secondary);
    gap: 4px;
}

/* Card Favorite Overlay Button */
.ad-card-fav-icon {
    position: absolute;
    top: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    outline: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease, background 0.2s ease;
}
body.lang-ar .ad-card-fav-icon { left: 8px; }
body.lang-en .ad-card-fav-icon { right: 8px; }

.ad-card-fav-icon:hover {
    transform: scale(1.1);
    background: #ffffff;
}

/* Wrapper adjustments to make ad list elements link separately */
.ad-card {
    position: relative;
}

.ad-card-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* 7. Floating Chatbot Styles */
.chatbot-floating-widget {
    position: fixed;
    bottom: 85px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a11b5e, #7c0b43);
    box-shadow: 0 8px 24px rgba(161, 27, 94, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.2s ease;
}
body.lang-ar .chatbot-floating-widget { left: 16px; }
body.lang-en .chatbot-floating-widget { right: 16px; }

.chatbot-floating-widget:hover {
    transform: scale(1.08) rotate(5deg);
}

.chatbot-pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #a11b5e;
    animation: botPulse 1.8s infinite;
    pointer-events: none;
    box-sizing: border-box;
}

@keyframes botPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { opacity: 0.4; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Interactive Chatbot Modal Window */
.chatbot-modal {
    position: fixed;
    bottom: 150px;
    width: 320px;
    height: 420px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: botSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
body.lang-ar .chatbot-modal { left: 16px; }
body.lang-en .chatbot-modal { right: 16px; }

@keyframes botSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.chatbot-modal-header {
    background: linear-gradient(135deg, #a11b5e, #7c0b43);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bot-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.chatbot-messages-body {
    flex-grow: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bot-msg {
    display: flex;
    width: 100%;
}

.bot-msg.msg-received { justify-content: flex-start; }
.bot-msg.msg-sent { justify-content: flex-end; }

.bot-msg .msg-content {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.82rem;
    line-height: 1.4;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.msg-received .msg-content {
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

.msg-sent .msg-content {
    background: #a11b5e;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.bot-suggestions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.bot-suggestions button {
    background: #ffffff;
    border: 1px solid rgba(161, 27, 94, 0.2);
    color: #a11b5e;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 16px;
    cursor: pointer;
    text-align: right;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
body.lang-en .bot-suggestions button { text-align: left; }

.bot-suggestions button:hover {
    background: rgba(161, 27, 94, 0.05);
    transform: translateX(-2px);
}

.chatbot-input-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    background: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-input-footer input {
    flex-grow: 1;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.8rem;
    outline: none;
}

.chatbot-input-footer button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #a11b5e;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

/* 8. Floating Curved Mobile Navigation Bar */
.mobile-nav-curved-wrapper {
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    z-index: 999;
    box-sizing: border-box;
}

.mobile-nav-curved {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 16px;
    height: 60px;
    box-sizing: border-box;
    position: relative;
}

.mobile-nav-curved .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    width: 50px;
    height: 100%;
    color: #94a3b8;
    transition: color 0.3s ease;
}

.mobile-nav-curved .mobile-nav-item i {
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.nav-label {
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 4px;
    opacity: 0.8;
}

/* Capsule Pill Active State Style */
.active-pill {
    position: absolute;
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    top: -18px; /* Lift active item */
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
}

.icon-active {
    color: #a11b5e !important;
    font-size: 1.15rem !important;
}

.mobile-nav-curved .mobile-nav-item.active {
    color: #a11b5e;
}

.mobile-nav-curved .mobile-nav-item.active .active-pill {
    transform: scale(1);
}

.mobile-nav-curved .mobile-nav-item.active .icon-inactive,
.mobile-nav-curved .mobile-nav-item.active .brand-char-inactive {
    opacity: 0;
}

.mobile-nav-curved .mobile-nav-item.active .nav-label {
    transform: translateY(12px); /* Shift label down slightly when active */
    color: #a11b5e;
    opacity: 1;
}

/* Center Action Badge indicator (My Cart Red Circle) */
.cart-badge-indicator {
    position: absolute;
    top: -4px;
    right: 4px;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    z-index: 10;
}

/* Brand logo characters */
.brand-char-inactive {
    font-size: 1.35rem;
    font-weight: 900;
    font-family: var(--font-english);
    color: #94a3b8;
}

.brand-char-active {
    font-size: 1.25rem;
    font-weight: 900;
    font-family: var(--font-english);
    color: #a11b5e;
}

/* Governorate Circular Cards Style */
.gov-card-item {
    transition: transform 0.2s ease;
}

.gov-card-item:hover .gov-card-icon-bg {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08) !important;
    border-color: var(--primary-color) !important;
}

.gov-card-item.active .gov-card-icon-bg {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 6px 14px rgba(161, 27, 94, 0.25) !important;
}

.gov-card-item.active .gov-card-icon-bg i {
    color: #ffffff !important;
}

.gov-card-item.active .gov-card-name {
    color: var(--primary-color) !important;
}

