﻿/* Navbar CSS */
/* Fixed navbar that stays at top of viewport */
:root {
    --site-max-width: 1200px;
    --site-padding: 24px;
}
.navbar {
    background: transparent;
    border: none;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    opacity: 1;
    z-index: 1000
}

/* The nav box */
.nav-container {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 14, 12, 0.08);
    border-radius: 999px;
    box-shadow: 0 12px 34px rgba(15, 14, 12, 0.12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    max-width: var(--site-max-width);
    margin: 0 auto;
    width: calc(100% - 32px);
    padding: 0 var(--site-padding);
}

/* Keep the ClikSell brand at the physical left while allowing the
   navigation content itself to follow the Arabic reading direction. */
html[dir="rtl"] .nav-container {
    direction: ltr;
}

html[dir="rtl"] .nav-menu,
html[dir="rtl"] .nav-user {
    direction: rtl;
}

/* Mobile: full width, no rounding */
@media (max-width: 768px) {
    .nav-container {
        width: calc(100% - 24px);
        max-width: none;
        border-radius: 999px;
        padding: 0 16px;
    }
}

/* When scrolling - just reduce opacity by 30% */
.navbar.scrolled {
    opacity: 1;
}

    .navbar.scrolled .nav-container {
        background: rgba(255, 255, 255, 0.78);
        border-color: rgba(15, 14, 12, 0.1);
        box-shadow: 0 16px 40px rgba(15, 14, 12, 0.16);
    }

    .navbar.scrolled .nav-logo,
    .navbar.scrolled .nav-link,
    .navbar.scrolled .nav-dropdown-trigger {
        color: #0f0e0c;
    }

    .navbar.scrolled .nav-dropdown-caret {
        color: rgba(15, 14, 12, 0.55);
    }

    .navbar.scrolled .nav-language {
        box-shadow: none;
    }

/* ── Landing page hero transparent state ── */
body.lp-hero-transparent .navbar {
    background: transparent;
}

body.lp-hero-transparent .nav-container {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 14, 12, 0.08);
    box-shadow: 0 12px 34px rgba(15, 14, 12, 0.12);
}

body.lp-hero-transparent .nav-logo {
    color: #0f0e0c;
}

body.lp-hero-transparent .nav-link {
    color: #0f0e0c;
}

body.lp-hero-transparent .nav-link:hover {
    color: #0f0e0c;
    opacity: 1;
}

body.lp-hero-transparent .nav-dropdown-trigger {
    color: #0f0e0c;
}

body.lp-hero-transparent .nav-dropdown-caret {
    color: rgba(15, 14, 12, 0.55);
}

body.lp-hero-transparent .login-btn {
    background: #fff;
    color: #0f0e0c;
    border-color: #fff;
}

body.lp-hero-transparent .login-btn:hover {
    background: #fff;
    color: #0f0e0c;
}

body.lp-hero-transparent .nav-language,
body.lp-hero-transparent .mobile-language {
    background: #fff;
}

body.lp-hero-transparent .nav-language-link,
body.lp-hero-transparent .mobile-language .nav-language-link {
    color: #0f0e0c;
}

body.lp-hero-transparent .nav-language-link.is-active,
body.lp-hero-transparent .mobile-language .nav-language-link.is-active {
    background: #0f0e0c;
    color: #fff;
}

body.lp-hero-transparent .auth-section .btn-login {
    color: rgba(255, 255, 255, 0.82);
    border-color: rgba(255, 255, 255, 0.25);
}

body.lp-hero-transparent .auth-section .btn-login:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.lp-hero-transparent .auth-section .btn-register {
    background: rgba(255, 255, 255, 0.9);
    color: #0f0e0c;
    border-color: transparent;
}

body.lp-hero-transparent .auth-section .btn-register:hover {
    background: #fff;
}

body.lp-hero-transparent .lang-switcher button {
    color: rgba(255, 255, 255, 0.65);
}

body.lp-hero-transparent .lang-switcher button.active {
    color: #fff;
}

body.lp-hero-transparent .hamburger-btn {
    color: #fff;
}

@media (max-width: 768px) {
    .nav-container,
    body.lp-hero-transparent .nav-container,
    body.lp-hero-transparent .navbar.scrolled .nav-container {
        background: rgba(255, 255, 255, 0.72);
        border: 1px solid rgba(15, 14, 12, 0.08);
        box-shadow: 0 12px 34px rgba(15, 14, 12, 0.12);
    }

    .nav-logo,
    body.lp-hero-transparent .nav-logo,
    .mobile-toggle,
    body.lp-hero-transparent .mobile-toggle,
    body.lp-hero-transparent .navbar.scrolled .mobile-toggle {
        color: #0f0e0c;
    }

    .navbar.scrolled .mobile-toggle {
        color: #0f0e0c;
    }
}

/* Logo styling */
.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

    .nav-logo:hover {
        color: #007bff;
        text-decoration: none;
    }

/* Desktop menu */
.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: inherit;
    font-weight: 800;
}

.nav-dropdown-caret {
    font-size: 0.8rem;
    color: #94a3b8;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    padding: 8px;
    display: none;
    z-index: 1002;
}

.nav-dropdown-menu.is-open {
    display: block;
}

.nav-dropdown-link {
    display: block;
    color: #475569;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 800;
    white-space: nowrap;
}

.nav-dropdown-link:hover {
    background: #f8fafc;
    color: #0f172a;
    text-decoration: none;
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
}

/* Navigation links */
.nav-link {
    color: #666;
    text-decoration: none;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

    .nav-link:hover {
        background: #f8f9fa;
        color: #333;
        text-decoration: none;
        transform: translateY(-1px);
    }

/* User section */
.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-language,
.mobile-language {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #0f0e0c;
    background: #fff;
    border: 1px solid rgba(15, 14, 12, 0.08);
    border-radius: 999px;
    padding: 3px;
    box-shadow: 0 2px 10px rgba(15, 14, 12, 0.08);
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: 0;
}

.nav-language-link {
    color: #0f0e0c;
    text-decoration: none;
    border-radius: 999px;
    min-width: 32px;
    padding: 5px 9px;
    text-align: center;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-language-link:hover,
.nav-language-link.is-active {
    text-decoration: none;
}

.nav-language-link:hover {
    transform: translateY(-1px);
}

.nav-language-link.is-active {
    background: #0f0e0c;
    color: #fff;
    text-decoration: none;
}

.nav-language-sep {
    display: none;
}

@media (max-width: 480px) {
    .nav-user {
        gap: 10px;
    }
}

/* User dropdown */
.user-dropdown {
    position: relative;
}

.user-btn {
    background: none;
    border: none;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
    white-space: nowrap;
}

    .user-btn:hover {
        background: #f8f9fa;
        color: #333;
    }

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100%);
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 1001;
    overflow: hidden;
}

.user-dropdown:hover .dropdown-content {
    display: block;
    animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-content a,
.logout-btn {
    display: block;
    padding: 12px 16px;
    color: #666;
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    border-bottom: 1px solid #f8f9fa;
}

    .dropdown-content a:last-child,
    .logout-btn:last-child {
        border-bottom: none;
    }

    .dropdown-content a:hover,
    .logout-btn:hover {
        background: #f8f9fa;
        color: #333;
    }

/* Login/Signup buttons */
.login-btn {
    background: #fff;
    color: #0f0e0c;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #fff;
    box-shadow: 0 2px 10px rgba(15, 14, 12, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-weight: 500;
    white-space: nowrap;
}

    .login-btn:hover {
        background: #fff;
        color: #0f0e0c;
        text-decoration: none;
        transform: translateY(-2px) scale(1.04);
        box-shadow: 0 8px 18px rgba(15, 14, 12, 0.14);
    }

@media (max-width: 768px) {
    .nav-user > .nav-language {
        display: none;
    }

    .login-btn {
        display: none;
    }
}

.signup-btn {
    background: #0f0e0c;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 2px solid #0f0e0c;
}

    .signup-btn:hover {
        background: #0f0e0c;
        border-color: #0f0e0c;
        color: white;
        text-decoration: none;
        transform: translateY(-1px);
    }

@media (max-width: 768px) {
    .signup-btn {
        display: none;
    }
}

/* Signed-in account controls (public shell) */
.nav-logout-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: transparent;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-logout-btn:hover {
    background: #fff;
    color: #0f0e0c;
    text-decoration: none;
    transform: translateY(-2px);
}

/* The navbar goes solid/light once scrolled, so the outline has to follow it. */
.navbar.scrolled .nav-logout-btn,
body:not(.lp-hero-transparent) .nav-logout-btn {
    border-color: rgba(15, 14, 12, 0.25);
    color: #0f0e0c;
}

.navbar.scrolled .nav-logout-btn:hover,
body:not(.lp-hero-transparent) .nav-logout-btn:hover {
    background: #0f0e0c;
    color: #fff;
    border-color: #0f0e0c;
}

@media (max-width: 768px) {
    .nav-logout-btn {
        display: none;
    }
}

/* Mobile menu account block — the only place a phone can sign out of the public shell */
.mobile-account {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid rgba(15, 14, 12, 0.1);
}

.mobile-account-id {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 2px;
}

.mobile-account-av {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #0f0e0c;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.mobile-account-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f0e0c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    margin-top: 4px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(185, 28, 28, 0.25);
    background: rgba(185, 28, 28, 0.06);
    color: #b91c1c;
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    transition: background 0.2s ease, color 0.2s ease;
}

.mobile-logout-btn:hover {
    background: #b91c1c;
    color: #fff;
    text-decoration: none;
}

/* Mobile toggle button */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
    color: #0f0e0c;
}

    .mobile-toggle:hover {
        background: rgba(255, 255, 255, 0.12);
    }

@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
}

/* Mobile menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 88px;
    left: 16px;
    right: 16px;
    z-index: 1001;
    background: #fff;
    border: 1px solid rgba(15, 14, 12, 0.08);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15, 14, 12, 0.24);
    padding: 12px;
}

.mobile-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    color: #0f0e0c;
    background: #f8f9fa;
    border: none;
    border-radius: 12px;
    text-align: left;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.mobile-dropdown-menu {
    display: none;
    padding: 6px 0 0;
}

.mobile-dropdown-menu.is-open {
    display: grid;
    gap: 6px;
}

.mobile-dropdown-menu a:last-child {
    border-bottom: none;
}

.mobile-menu-link,
.mobile-dropdown-menu a,
.mobile-logout {
    display: flex;
    align-items: center;
    min-height: 48px;
    width: 100%;
    padding: 0 14px;
    color: #0f0e0c;
    text-decoration: none;
    background: #f8f9fa;
    border: none;
    border-radius: 12px;
    text-align: left;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.mobile-menu-link:hover,
.mobile-dropdown-menu a:hover,
.mobile-dropdown-toggle:hover,
.mobile-logout:hover {
    background: #eef1f4;
    color: #0f0e0c;
    text-decoration: none;
    transform: translateY(-1px);
}

.mobile-menu .mobile-language {
    align-self: flex-start;
    margin-bottom: 4px;
    padding: 3px;
    border-bottom: none;
}

.mobile-auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 2px;
}

.mobile-login-btn,
.mobile-signup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 12px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-login-btn {
    background: #fff;
    color: #0f0e0c;
    border: 1px solid rgba(15, 14, 12, 0.12);
}

.mobile-signup-btn {
    background: #0f0e0c;
    color: #fff;
    border: 1px solid #0f0e0c;
}

.mobile-login-btn:hover,
.mobile-signup-btn:hover {
    text-decoration: none;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 18px rgba(15, 14, 12, 0.14);
}

.mobile-login-btn:hover {
    color: #0f0e0c;
}

.mobile-signup-btn:hover {
    color: #fff;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 12px;
    }

    .nav-logo {
        font-size: 1.3rem;
    }

    .mobile-menu {
        left: 12px;
        right: 12px;
        padding: 12px;
    }
}

@media (max-width: 350px) {
    .nav-container {
        padding: 0 8px;
    }

    .nav-logo {
        font-size: 1.2rem;
    }
}
