* {
    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;
}

/* ================= STICKY CONTAINER ================= */
.sticky-nav-container {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ================= 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;
}

/* Scroll for laptop/desktop view with flyout support */
@media (min-width: 1025px) {
    .dropdown-menu {
        max-height: 480px;
        overflow-y: auto;
        overflow-x: hidden;
        width: 440px;
        /* 220px categories + 220px sub-menu space to prevent clipping */
    }

    .dropdown-menu>ul {
        width: 220px;
        border-right: 1px solid #f1f1f1;
    }
}

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

/* ================= NOTIFICATIONS ================= */
.notification-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    cursor: pointer;
}

.notification-bell {
    font-size: 20px;
    color: #4a5d45;
    position: relative;
    transition: transform 0.2s ease;
}

.notification-bell:hover {
    transform: scale(1.1);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #b34038;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 2px solid #f6f1eb;
}

.notification-menu {
    width: 320px;
    right: 0;
    left: auto;
    padding: 0;
    overflow: hidden;
}

.notification-header {
    padding: 12px 16px;
    background: #4a5d45;
    color: white;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.mark-all-read {
    font-size: 11px;
    font-weight: normal;
    cursor: pointer;
    opacity: 0.9;
}

.mark-all-read:hover {
    text-decoration: underline;
    opacity: 1;
}

.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.no-notifications {
    padding: 30px 15px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    gap: 12px;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #fafaf9;
}

.notification-item.unread {
    background: #fff8f1;
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #4a5d45;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #292524;
}

.notification-time {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.notification-footer {
    padding: 10px;
    text-align: center;
    border-top: 1px solid #f1f1f1;
    background: #fff;
}

.notification-footer a {
    font-size: 13px;
    color: #4a5d45;
    font-weight: 500;
}

.notification-footer a:hover {
    text-decoration: underline;
}


.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-search button {
        position: absolute;
        right: 0;
        top: 0;
        height: 100%;
        background: #4a5d45;
        color: white;
        border: none;
        padding: 0 10px;
    }

    .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;
}

/* ================= OVERRIDE FOR MOBILE NOTIFICATIONS ================= */
@media (max-width: 768px) {
    .notification-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 9999998;
        backdrop-filter: blur(5px);
    }

    /* Target by ID to ensure highest specificity against other dropdown styles */
    #notificationMenu.dropdown-menu {
        position: fixed !important;
        width: 92% !important;
        max-width: 400px !important;
        left: 50% !important;
        top: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) scale(0.9) !important;
        box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5) !important;
        border: none !important;
        border-radius: 20px !important;
        visibility: hidden !important;
        opacity: 0 !important;
        transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease !important;
        display: block !important;
        z-index: 99999999 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        background: white !important;
    }

    #notificationDropdown.open #notificationMenu.dropdown-menu {
        visibility: visible !important;
        opacity: 1 !important;
        transform: translate(-50%, -50%) scale(1) !important;
    }

    .notification-header {
        border-radius: 20px 20px 0 0;
        padding: 18px 20px !important;
        background: #4a5d45 !important;
        color: white !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        font-size: 16px !important;
        gap: 10px !important;
    }

    .notification-header .mark-all-read {
        font-size: 12px !important;
        color: rgba(255, 255, 255, 0.9) !important;
        white-space: nowrap !important;
    }

    .notification-footer {
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
        padding: 15px !important;
        background: #fff !important;
    }

    .header {
        position: relative;
        z-index: 1001;
        padding: 12px 16px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }

    .logo {
        order: 1 !important;
    }

    .logo-text {
        font-size: 24px !important;
    }

    .notification-wrapper {
        order: 2 !important;
        margin-left: auto !important;
        margin-right: 15px !important;
    }

    .hamburger {
        order: 3 !important;
        position: static !important;
    }
}