* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

body {
    padding-top: 110px;
    font-family: 'Manshoor', sans-serif;
    background-color: #070512;
    color: #fff;
}

.navbar {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 92%;
    max-width: 1300px;
    background: rgba(20, 15, 35, 0.9);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    box-shadow: 0 14px 50px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.navbar.scrolled {
    top: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    background: rgba(15, 10, 25, 0.95);
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar.hide-nav {
    transform: translateY(-150%);
}

body[data-scroll-locked="true"] .navbar.hide-nav,
body.mobile-menu-open .navbar.hide-nav {
    transform: none;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
    font-size: 1.5rem;
    font-weight: var(--font-weight-display);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 2rem;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-mark {
    width: 56px;
    height: 56px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

.nav-container-inner {
    display: flex;
    flex-grow: 1;
    align-items: center;
    justify-content: space-between;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a.nav-item {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-weight: var(--font-weight-ui);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a.nav-item i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
    color: #a881ff;
}

.nav-links a.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.nav-links a.nav-item:hover i {
    transform: scale(1.1) rotate(-5deg);
    color: #F5A623;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-nav-link {
    position: relative;
    white-space: nowrap;
}

.cart-nav-badge {
    min-width: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.45rem;
    background: linear-gradient(135deg, #f5a623, #f97316);
    color: #111827;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(245, 166, 35, 0.25);
}

#auth-nav-links {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.profile-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.profile-trigger {
    border: none;
    background: rgba(255, 255, 255, 0.05);
}

.profile-trigger .profile-trigger-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-trigger .profile-trigger-caret {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-right: 4px;
}

.profile-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 210px;
    background: rgba(15, 10, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    border-radius: 16px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s ease;
    z-index: 2001;
}

.profile-dropdown.open .profile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0.85rem 0.9rem;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.92);
    transition: all 0.2s ease;
}

.profile-menu a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.profile-menu a.profile-menu-logout {
    color: #ff6b6b;
    background: rgba(255, 71, 87, 0.08);
    border: 1px solid rgba(255, 71, 87, 0.25);
}

.profile-menu a.profile-menu-logout:hover {
    background: rgba(255, 71, 87, 0.14);
    border-color: rgba(255, 71, 87, 0.35);
}

.btn-nav {
    padding: 0.6rem 1.5rem !important;
    border-radius: 50px !important;
    font-weight: var(--font-weight-ui) !important;
    font-size: 0.95rem !important;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-login {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff !important;
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-register {
    background: linear-gradient(135deg, #6C3FC5 0%, #8E54E9 100%) !important;
    color: #fff !important;
    border: none;
    box-shadow: 0 4px 15px rgba(108, 63, 197, 0.4);
}

.btn-register:hover {
    box-shadow: 0 6px 20px rgba(108, 63, 197, 0.6);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.points-badge {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: rgba(245, 166, 35, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    color: #fff;
    font-weight: var(--font-weight-heading);
    border: 1px solid rgba(245, 166, 35, 0.3);
    white-space: nowrap;
}

.points-badge .star-meter {
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    display: inline-block;
    flex-shrink: 0;
}

.points-badge .star-meter i {
    font-size: 1.15rem;
    line-height: 1.25rem;
}

.points-badge .star-outline {
    position: absolute;
    inset: 0;
    color: rgba(255, 255, 255, 0.6);
}

.points-badge .star-fill-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    width: 0%;
}

.points-badge .star-fill {
    color: #F5A623;
    filter: drop-shadow(0 0 4px rgba(245,166,35,0.6));
}

.points-badge .rank-name {
    font-weight: var(--font-weight-heading);
}

.points-badge .star-meter::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 10px);
    right: 50%;
    transform: translateX(50%);
    background: rgba(15, 10, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 2001;
}

.points-badge .star-meter:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(50%) translateY(2px);
}

.site-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 4, 12, 0.78);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
}

.site-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.site-modal {
    width: min(100%, 480px);
    background: linear-gradient(135deg, rgba(24, 18, 42, 0.96) 0%, rgba(14, 10, 26, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5), 0 0 30px rgba(108, 63, 197, 0.25);
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
}

.site-modal::before {
    content: "";
    position: absolute;
    inset: auto -20% 55% auto;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(245, 166, 35, 0.16) 0%, transparent 70%);
    pointer-events: none;
}

.site-modal-icon {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(108, 63, 197, 0.22), rgba(245, 166, 35, 0.2));
    color: #f5a623;
    font-size: 1.8rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.site-modal-title {
    font-size: 1.5rem;
    font-weight: var(--font-weight-heading);
    margin-bottom: 0.75rem;
    color: #fff;
}

.site-modal-text {
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.9;
    font-size: 0.98rem;
    margin-bottom: 1.5rem;
}

.site-modal-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.site-modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.site-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: rotate(90deg);
}

.site-modal-secondary {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff !important;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
    padding: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: #fff;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 1024px) {
    .navbar-container {
        padding: 0.8rem 1rem;
    }

    .logo { margin-left: 1rem; }
    .logo-mark { width: 48px; height: 48px; }
    .nav-links a.nav-item { padding: 0.5rem; font-size: 0.9rem; }
    .btn-nav { padding: 0.5rem 1rem !important; }
}

@media (max-width: 850px) {
    body { padding-top: 80px; }

    .navbar {
        top: 0;
        width: 100%;
        border-radius: 0;
        border: none;
        background: rgba(15, 10, 25, 0.95);
    }

    .navbar.hide-nav {
        transform: translateY(-100%);
    }

    .menu-toggle {
        display: flex;
    }

    .nav-container-inner {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(360px, calc(100vw - 24px));
        max-width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        background: rgba(20, 15, 35, 0.98);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        flex-direction: column;
        justify-content: flex-start;
        padding: 5.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
        transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.6);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        z-index: 1000;
    }

    .nav-container-inner.active {
        right: 0;
    }

    .nav-links {
        display: flex;
        position: static;
        inset: auto;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        padding: 0;
        margin: 0;
        background: transparent;
        box-shadow: none;
        border: 0;
        gap: 0.5rem;
    }

    .nav-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 1px solid rgba(255,255,255,0.1);
        gap: 0.75rem;
    }

    #auth-nav-links {
        flex-direction: column;
        width: 100%;
    }

    #auth-nav-links > * {
        width: 100%;
    }

    .nav-links a.nav-item, .btn-nav {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem;
        font-size: 1.05rem;
    }

    .profile-dropdown {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .profile-trigger {
        width: 100%;
        justify-content: space-between;
    }

    .profile-trigger .profile-trigger-name {
        flex: 1;
        max-width: none;
        text-align: right;
    }

    .points-badge {
        width: 100%;
        justify-content: center;
        margin-top: 0;
    }

    .cart-nav-link {
        justify-content: space-between;
    }


    .profile-menu {
        position: static;
        top: auto;
        left: auto;
        min-width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-radius: 14px;
        margin-top: 0.75rem;
        display: none;
    }

    .profile-menu a {
        justify-content: flex-start;
    }

    .profile-dropdown.open .profile-menu {
        display: block;
    }
}

@media (max-width: 425px) {
    body {
        padding-top: 74px;
    }

    .navbar-container {
        padding: 0.7rem 0.9rem;
    }

    .logo {
        gap: 0.55rem;
        margin-left: 0.6rem;
        font-size: 1.05rem;
        min-width: 0;
    }

    .logo span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .logo-mark {
        width: 42px;
        height: 42px;
    }

    .menu-toggle {
        padding: 4px;
    }

    .nav-container-inner {
        width: calc(100vw - 12px);
        padding: 5rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    }

    .nav-links a.nav-item,
    .btn-nav {
        padding: 0.9rem;
        font-size: 1rem;
    }

    .points-badge {
        padding: 0.6rem 0.85rem;
        font-size: 0.92rem;
    }
}

@media (max-width: 375px) {
    .navbar-container {
        padding: 0.65rem 0.75rem;
    }

    .logo {
        margin-left: 0.45rem;
        font-size: 0.98rem;
    }

    .logo-mark {
        width: 38px;
        height: 38px;
    }

    .nav-container-inner {
        width: 100vw;
        padding-top: 4.85rem;
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }
}

@media (max-width: 320px) {
    .logo {
        gap: 0.45rem;
        font-size: 0.92rem;
    }

    .logo span {
        max-width: 9.5rem;
    }

    .nav-links a.nav-item,
    .btn-nav,
    .profile-menu a {
        padding: 0.85rem 0.8rem;
        font-size: 0.96rem;
    }
}
