@import "./global.css";

/* ================= NAVBAR BASE ================= */
.navbar {
    --navbar-height: 72px;
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000; /* 🔥 raised */
    height: var(--navbar-height);
}

/* inner container */
.navbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 16px;
}

/* ================= LOGO ================= */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 52px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-size: 1.45rem;
    font-weight: 700;
    color: #8b4513;
}

.brand-name span {
    color: #bfa14a;
}

.tagline {
    font-size: 0.85rem;
    color: #e74c3c;
    font-weight: 600;
    margin-top: 2px;
}

/* ================= RIGHT GROUP ================= */
.right-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

/* primary nav */
.primary-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.primary-nav a {
    padding: 6px 10px;
    text-decoration: none;
    color: #222;
    font-weight: 500;
    font-family: 'Segoe UI', Arial, sans-serif;
    transition: color 0.2s ease;
}

.primary-nav a:hover {
    color: #d97c2b;
}

/* ================= ACTIONS ================= */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* cart */
.cart-link {
    position: relative;
    padding: 6px;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #2962ff;
    color: #fff;
    font-size: 0.7rem;
    border-radius: 999px;
    padding: 2px 6px;
}

/* ================= USER DROPDOWN ================= */
.user-dropdown {
    position: relative; /* REQUIRED */
}

.user-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
}

.user-toggle i {
    font-size: 1.3rem;
}

/* dropdown menu */
.dropdown-content {
    position: absolute;
    top: calc(100% + 8px); /* 🔥 FIX */
    right: 0;
    min-width: 180px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 14px 32px rgba(0,0,0,0.18);
    display: none;
    z-index: 3000; /* 🔥 ABOVE NAV */
    overflow: hidden;
}

.dropdown-content a {
    display: block;
    padding: 10px 14px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.dropdown-content a:hover {
    background: #f8fafc;
}

/* open state */
.user-dropdown.open .dropdown-content {
    display: block;
}

/* ================= HAMBURGER ================= */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
}

/* ================= MOBILE ================= */
@media (max-width: 900px) {

    .nav-toggle {
        display: block;
    }

    .primary-nav {
        display: none;
    }

    .navbar.nav-open .primary-nav {
        display: flex;
        position: absolute;
        top: var(--navbar-height);
        left: 0;
        width: 100%;
        flex-direction: column;
        background: #fff;
        padding: 12px 1.25rem;
        gap: 8px;
        box-shadow: 0 12px 30px rgba(0,0,0,0.12);
        z-index: 1500;
    }
}

@media (max-width: 420px) {
    .brand-name {
        font-size: 1.25rem;
    }
}
