/* ===========================
   Global Styles & Variables
   =========================== */
   :root {
    --primary-color: #312783;
    --secondary-color: #5B8DEE;
    --text-dark: #1a1a1a;
    --text-light: #666;
    --border-color: #e0e0e0;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --discount-bg: #C8A2C8;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    color: var(--text-dark);
    background-color: #fafafa;
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 70px;
}

/* English Font */
body.lang-en {
    font-family: 'Inter', sans-serif;
}

/* Arabic Numbers */
.ar-number {
    font-family: 'Cairo', sans-serif !important;
}

/* English Numbers */
body.lang-en .ar-number {
    font-family: 'Inter', sans-serif !important;
}

/* Container */
.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Links */
a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
}

/* Buttons */
button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Utilities */
.text-primary {
    color: var(--primary-color);
}

/* ===========================
   Top Discount Banner
   =========================== */
.top-banner {
    background: var(--discount-bg);
    padding: 12px 0;
    position: relative;
    z-index: 100;
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    position: relative;
}

.banner-close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--white);
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition);
}

.banner-close:hover {
    background: rgba(255,255,255,0.2);
}

.banner-text {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-size: 15px;
}

.discount-icon {
    width: 28px;
    height: 28px;
    background: var(--danger);
    border-radius: 50%;
    padding: 5px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.discount-text strong {
    font-weight: 700;
    background: var(--white);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    margin: 0 5px;
}

.banner-cta {
    background: var(--white);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.banner-cta:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

/* ===========================
   Header - FIXED
   =========================== */
.main-header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 99;
}

/* Header Top */
.header-top {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-top-content {
    display: flex;
    align-items: center;
    gap: 25px;
}

/* Logo - SMALLER */
.logo img {
    height: 38px;
    width: auto;
}

/* Search Bar - FIXED */
.search-bar {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 11px 45px 11px 18px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    background: #f5f5f5;
}

/* For English - Icon on left */
body.lang-en .search-input {
    padding: 11px 18px 11px 45px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px;
    color: #666;
    border-radius: 6px;
    transition: var(--transition);
}

/* For English - Icon on left */
body.lang-en .search-btn {
    right: auto;
    left: 8px;
}

.search-btn:hover {
    background: rgba(49, 39, 131, 0.1);
    color: var(--primary-color);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    transition: var(--transition);
}

.language-toggle:hover {
    border-color: var(--primary-color);
    background: var(--bg-light);
}

.flag-icon {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}

.auth-link {
    font-size: 13px;
    color: var(--text-dark);
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 6px;
    transition: var(--transition);
}

.auth-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

/* Post Ad Button - SMALLER */
.btn-post-ad {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.btn-post-ad:hover {
    background: #25195f;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-post-ad svg {
    width: 18px;
    height: 18px;
}

/* ===========================
   Main Navigation - BOLD FONT
   =========================== */
.main-nav {
    background: var(--white);
}

.nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-list::-webkit-scrollbar {
    display: none;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
    background: var(--bg-light);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 3px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.badge-new {
    background: #FF5722;
    color: var(--white);
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* ===========================
   Mega Menu - COMPLETELY FIXED
   =========================== */
.has-megamenu {
    position: static;
}

.mega-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--white);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 0 0 12px 12px;
    padding: 40px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    pointer-events: none;
}

.has-megamenu:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

.mega-menu-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
}

.mega-menu-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.mega-menu-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--bg-light);
}

.mega-menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mega-menu-list li a {
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: block;
    padding: 8px 0;
}

.mega-menu-list li a:hover {
    color: var(--primary-color);
    padding-right: 12px;
}

/* For LTR */
body.lang-en .mega-menu-list li a:hover {
    padding-right: 0;
    padding-left: 12px;
}

.mega-menu-promo {
    background: linear-gradient(135deg, var(--primary-color) 0%, #25195f 100%);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
}

.promo-link {
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.promo-link:hover {
    color: var(--white);
    gap: 14px;
}

/* ===========================
   Footer - COMPLETE REDESIGN
   =========================== */
.main-footer {
    background: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 0;
    margin-top: 80px;
}

/* Footer Top */
.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 80px;
    padding-bottom: 50px;
    border-bottom: 1px solid var(--border-color);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-logo {
    width: 120px;
    height: auto;
    margin-bottom: 10px;
}

.footer-description {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.8;
    margin: 0;
}

.footer-app-section {
    margin-top: 20px;
}

.footer-app-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.footer-app-badges {
    display: flex;
    gap: 12px;
    align-items: center;
}

.footer-app-badge img {
    height: 40px;
    width: auto;
    transition: var(--transition);
}

.footer-app-badge:hover img {
    transform: scale(1.05);
}

/* Footer Support */
.footer-support {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-support-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.footer-support-text {
    color: var(--text-light);
    font-size: 14px;
    margin: 0;
}

.footer-contact-methods {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 10px;
}

.contact-method {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.contact-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 18px;
    flex-shrink: 0;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.contact-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.contact-value {
    font-size: 15px;
    color: var(--text-dark);
    font-weight: 600;
    transition: var(--transition);
}

.contact-value:hover {
    color: var(--primary-color);
}

/* Footer Links Section */
.footer-links-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
    padding: 50px 0;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-column-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.footer-links-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links-list li a {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: block;
}

.footer-links-list li a:hover {
    color: var(--primary-color);
    padding-right: 5px;
}

body.lang-en .footer-links-list li a:hover {
    padding-right: 0;
    padding-left: 5px;
}

/* Footer Bottom */
.footer-bottom {
    background: #fafafa;
    padding: 25px 0;
    border-top: 1px solid var(--border-color);
}

.footer-bottom-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-copyright {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
}

.footer-social {
    display: flex;
    gap: 12px;
    align-items: center;
}

.social-link {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-size: 16px;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

/* ===========================
   Mobile Bottom Navigation
   =========================== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    display: none;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: var(--text-light);
    font-size: 11px;
    font-weight: 600;
    transition: var(--transition);
    flex: 1;
    text-align: center;
}

.mobile-bottom-nav .nav-item i {
    font-size: 20px;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--primary-color);
}

.mobile-bottom-nav .nav-item-post {
    background: var(--primary-color);
    color: var(--white);
    border-radius: 12px;
    padding: 10px 15px;
    margin: 0 5px;
}

.mobile-bottom-nav .nav-item-post i {
    font-size: 22px;
}

/* ===========================
   Responsive Design
   =========================== */

/* Tablets */
@media (max-width: 991px) {
    .container-fluid {
        padding: 0 15px;
    }

    /* Header */
    .header-top-content {
        gap: 15px;
    }

    .logo img {
        height: 32px;
    }

    .search-bar {
        max-width: 400px;
    }

    .header-actions {
        gap: 8px;
    }

    .auth-link {
        display: none;
    }

    .btn-post-ad span {
        display: none;
    }

    .btn-post-ad {
        padding: 10px;
        border-radius: 50%;
        width: 42px;
        height: 42px;
        justify-content: center;
    }

    /* Navigation */
    .nav-link {
        padding: 12px 14px;
        font-size: 13px;
    }

    /* Footer */
    .footer-top {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-links-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    /* Header */
    .header-top {
        padding: 10px 0;
    }

    .header-top-content {
        flex-wrap: wrap;
        gap: 10px;
    }

    .logo {
        order: 1;
        flex: 0 0 auto;
    }

    .logo img {
        height: 28px;
    }

    .header-actions {
        order: 2;
        margin-right: auto;
        gap: 5px;
    }

    .language-toggle {
        padding: 6px 10px;
        font-size: 11px;
    }

    .flag-icon {
        width: 18px;
        height: 14px;
    }

    .btn-post-ad {
        width: 38px;
        height: 38px;
        padding: 8px;
    }

    .btn-post-ad svg {
        width: 16px;
        height: 16px;
    }

    .search-bar {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
    }

    .search-input {
        padding: 10px 40px 10px 14px;
        font-size: 13px;
    }

    /* Navigation - Scrollable */
    .main-nav {
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .nav-list {
        gap: 0;
    }

    .nav-link {
        padding: 12px 12px;
        font-size: 12px;
    }

    .badge-new {
        font-size: 8px;
        padding: 2px 6px;
    }

    /* Mega Menu - Disable on Mobile */
    .mega-menu {
        display: none !important;
    }

    /* Banner */
    .banner-content {
        flex-direction: column;
        gap: 10px;
        padding: 5px 0;
    }

    .banner-text {
        font-size: 12px;
        text-align: center;
    }

    .banner-close {
        top: 10px;
        right: 10px;
        transform: none;
    }

    /* Footer */
    .main-footer {
        padding: 40px 0 0;
        margin-top: 40px;
    }

    .footer-top {
        gap: 30px;
        padding-bottom: 30px;
    }

    .footer-logo {
        width: 100px;
    }

    .footer-links-section {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 30px 0;
    }

    .footer-bottom-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .footer-copyright {
        font-size: 12px;
    }

    .footer-social {
        gap: 8px;
    }

    .social-link {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    /* Mobile Bottom Nav - Show */
    .mobile-bottom-nav {
        display: flex;
    }

    body {
        padding-bottom: 70px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .logo img {
        height: 24px;
    }

    .search-input {
        font-size: 12px;
        padding: 9px 38px 9px 12px;
    }

    .nav-link {
        padding: 10px 10px;
        font-size: 11px;
    }

    .banner-text {
        font-size: 11px;
    }

    .banner-cta {
        font-size: 12px;
        padding: 6px 16px;
    }

    .footer-app-badge img {
        height: 35px;
    }

    .contact-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .contact-value {
        font-size: 14px;
    }
}
