* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.nav-item {
    user-select: none;
    -webkit-user-select: none;
}

body {
    background: #fff;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ================= TOP BAR ================= */
.top-bar {
    background: #f6f1eb;
    padding: 4px 80px;
    font-size: 10px;
    color: #6b7280;
    display: flex;
    justify-content: flex-end;
    border-bottom: 1px solid #e5e7eb;
}

.top-bar span {
    border-left: 1px solid #d1d5db;
    padding-left: 16px;
}

/* ================= HEADER ================= */
.header {
    background: #f6f1eb;
    padding: 16px 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 1px;
}

/* Logo box */
.logo-box {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Logo image */
.logo-box img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    transform: rotate(-12deg);
    /* keeps image straight */
}

/* Logo text */
.logo-text {
    font-family: "Georgia", serif;
    font-size: 30px;
    font-weight: 700;
    color: #3a332d;
    line-height: 1;
}


/* Search */
.search-box {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 120px 10px 40px;
    border: 1px solid #d1c7bc;
    outline: none;
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    color: #9ca3af;
}

.search-box button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: #4a5d45;
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
}

.search-box button:hover {
    background: #3d4d38;
}

/* Header buttons */
.header-actions {
    display: flex;
    gap: 12px;
}

.btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid #4a5d45;
    background: white;
    color: #4a5d45;
    cursor: pointer;
}

.btn:hover {
    background: #4a5d45;
    color: white;
}

.btn.sell {
    background: #4a5d45;
    color: white;
}

.btn.sell:hover {
    background: #3d4d38;
}

/* ================= NAV ================= */
.nav {
    background: url('../images/nav.png') center/cover no-repeat;
    padding: 12px 80px;
    display: flex;
    gap: 30px;
    color: white;
    font-size: 14px;
    position: relative;
    /* ADD */
    z-index: 1000;
    /* ADD */
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.nav-item:hover {
    opacity: 0.8;
}

/* Hamburger */
.hamburger {
    display: none;
    font-size: 26px;
    cursor: pointer;
    color: #4a5d45;
    transition: transform 0.2s ease;
}

.nav-item svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    flex-shrink: 0;
}

.nav.active~.hamburger {
    transform: rotate(90deg);
}


/* ================= DROPDOWN ================= */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 220px;
    background: white;
    color: #292524;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-top: 2px solid #b34038;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.2s;
    z-index: 9999;
}

.sub-menu {
    z-index: 10000;
}

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

.dropdown-menu ul {
    list-style: none;
    padding: 8px 0;
}

.dropdown-menu li {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.dropdown-menu li:hover {
    background: #fafaf9;
    color: #b34038;
}

/* Sub menu */
.sub-menu {
    position: absolute;
    left: 100%;
    top: 0;
    width: 200px;
    background: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: 0.2s;
}

.dropdown-menu li:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.sub-menu li {
    padding: 10px 16px;
}

/* ================= RESPONSIVE ================= */

/* Tablet */
@media (max-width: 1024px) {

    .top-bar,
    .header,
    .nav {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* Mobile */
@media (max-width: 768px) {

    .top-bar {
        justify-content: center;
        padding: 6px 12px;
    }

    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 14px 16px;
    }

    .logo {
        justify-content: center;
    }

    .search-box {
        max-width: 100%;
    }

    .header-actions {
        justify-content: center;
    }

    .nav {
        flex-direction: column;
        gap: 16px;
        padding: 14px 16px;
        display: none;
        color: #292524;
    }


    .nav.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    #categoryDropdown {
        display: none;
    }

}

/* Desktop only hover */
/* ================= MOBILE DROPDOWN FIX ================= */
@media (max-width: 768px) {

    .dropdown-menu {
        position: static;
        width: 100%;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: rgba(255, 255, 255, 0.95);
    }

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

    .sub-menu {
        position: static;
        width: 100%;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding-left: 15px;
    }

    .has-sub.open>.sub-menu {
        display: block;
    }

}

/* ================= MOBILE MENU EXTRAS ================= */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {

    /* Hide header search & buttons */
    .search-box,
    .header-actions {
        display: none;
    }

    /* Show mobile-only items */
    .mobile-only {
        display: block;
    }

    .mobile-search {
        position: relative;
        margin-bottom: 12px;
    }

    .mobile-search input {
        width: 100%;
        padding: 10px 40px 10px 36px;
        border: 1px solid #d1c7bc;
    }

    .mobile-search svg {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 18px;
        color: #9ca3af;
    }

    .mobile-actions {
        display: flex;
        gap: 10px;
    }

    .mobile-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .sub-menu {
        display: none;
        padding-left: 16px;
    }

    .has-sub.open>.sub-menu {
        display: block;
    }
}

/* ================= CATEGORY POPUP ================= */

.category-btn {
    background: none;
    border: none;
    color: #292524;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
}

/* Popup container */
.category-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    z-index: 999999;
    display: none;
    flex-direction: column;
}

/* Header */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #4a5d45;
    color: white;
}

.popup-header button {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

/* Scrollable content */
.popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Lists */
.popup-content ul {
    list-style: none;
}

.popup-content li {
    padding: 14px 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

/* Hide sub lists initially */
.sub-list {
    display: none;
}
