/* UrbanNutMix Header Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* ── Global Reset ───────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

:root {
    --primary-color: #cf6e0c; /* Matches reference warm brand orange */
    --primary-hover: #a85604;
    --text-color: #1e293b;
    --text-light: #64748b;
    --bg-color: #ffffff;
    --bg-alt: #f8fafc;
    --border-color: #e2e8f0;
    --topbar-bg: #cf6e0c;
    --topbar-text: #ffffff;
    --font-family: 'Montserrat', sans-serif;
    --transition-speed: 0.3s;
    --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Base resets for header */
.unm-header-wrapper {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--bg-color);
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 900;
}

.unm-header-wrapper *, 
.unm-header-wrapper *::before, 
.unm-header-wrapper *::after {
    box-sizing: inherit;
}

/* --- TOPBAR --- */
.unm-topbar {
    background-color: var(--topbar-bg);
    color: var(--topbar-text);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px 15px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    animation: fadeInDown 0.5s ease;
}

/* --- MAIN HEADER --- */
.unm-main-header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 1000;          /* always above page content */
    transition: all var(--transition-speed) var(--transition-ease);
}

.unm-header-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;          /* explicit z-index on fixed element */
    box-shadow: var(--shadow-md);
    animation: slideDown 0.4s var(--transition-ease);
}

.unm-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

/* --- LOGO --- */
.unm-logo-link {
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
}

.unm-logo-img {
    height: 52px;
    width: auto;
    object-fit: contain;
    transition: transform var(--transition-speed) var(--transition-ease);
}

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

/* --- DESKTOP NAVIGATION --- */
.unm-nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

.unm-nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.unm-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #334155; /* Slate-700 for professional look */
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0 16px;
    height: 100%;
    letter-spacing: 0.05em;
    position: relative;
    transition: color var(--transition-speed) var(--transition-ease);
}

.unm-nav-link::after {
    content: '';
    position: absolute;
    bottom: 22px; /* Close below text, matching screenshot */
    left: 16px;   /* Match link padding bounds */
    right: 16px;
    height: 3px;
    background-color: #334155; /* Dark grey/black underline */
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform var(--transition-speed) var(--transition-ease);
}

.unm-nav-link:hover {
    color: var(--primary-color);
}

.unm-nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.unm-nav-link.active {
    color: var(--primary-color);
}

.unm-nav-link.active::after {
    transform: scaleX(1);
}

/* --- HEADER ACTIONS --- */
.unm-header-actions {
    display: flex;
    align-items: center;
    gap: 20px; /* Enhanced professional spacing */
}

.unm-action-btn {
    background: none;
    border: none;
    padding: 8px;
    color: #334155; /* Match navigation icon color */
    cursor: pointer;
    position: relative;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) var(--transition-ease);
    text-decoration: none;
}

.unm-action-btn:hover {
    background-color: transparent; /* No background grey circle on hover for a cleaner look */
    color: var(--primary-color);
    transform: translateY(-2px);
}

.unm-action-icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.unm-cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--bg-color);
    line-height: 1;
}

/* --- HAMBURGER MENU --- */
.unm-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1010;
}

.unm-hamburger span {
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all var(--transition-speed) var(--transition-ease);
}

/* Hamburger Active State */
.unm-hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.unm-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.unm-hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* --- MOBILE DRAWER (Premium Left Slider) --- */
.unm-mobile-drawer {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background-color: var(--bg-color);
    box-shadow: var(--shadow-lg);
    z-index: 1005;
    display: flex;
    flex-direction: column;
    transition: left var(--transition-speed) var(--transition-ease);
    padding: 0; /* Remove top/side paddings for layout alignment */
}

.unm-mobile-drawer.active {
    left: 0;
}

.unm-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1004;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed) var(--transition-ease);
}

.unm-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar header area styling */
.unm-drawer-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.unm-drawer-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.unm-drawer-avatar {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unm-drawer-user-info {
    display: flex;
    flex-direction: column;
}

.unm-user-welcome {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.unm-user-brand {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.unm-drawer-close {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.25s ease;
}

.unm-drawer-close:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Sidebar navigation links */
.unm-mobile-nav {
    list-style: none;
    padding: 16px 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-grow: 1;
}

.unm-mobile-item {
    margin: 0;
    padding: 0;
}

.unm-mobile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    border-left: 4px solid transparent;
    transition: all 0.25s ease;
}

.unm-mobile-link-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.unm-drawer-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--text-light);
    stroke-width: 2;
    transition: stroke 0.25s ease;
}

.unm-mobile-link:hover {
    background-color: var(--bg-alt);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.unm-mobile-link:hover .unm-drawer-icon {
    stroke: var(--primary-color);
}

.unm-mobile-link.active {
    background-color: rgba(207, 110, 12, 0.08);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.unm-mobile-link.active .unm-drawer-icon {
    stroke: var(--primary-color);
}

.unm-mobile-drawer-footer {
    border-top: 1px solid var(--border-color);
    padding: 20px;
    background-color: var(--bg-alt);
    margin-top: auto;
}

.unm-mobile-contact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.unm-contact-label-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.unm-contact-item-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.unm-contact-item-link svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.unm-contact-item-link:hover {
    color: var(--primary-color);
}

/* --- SEARCH BAR OVERLAY --- */
.unm-search-overlay {
    position: fixed;
    top: -120px;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    box-shadow: var(--shadow-md);
    z-index: 1009;
    padding: 20px 24px;
    transition: top var(--transition-speed) var(--transition-ease);
}

.unm-search-overlay.active {
    top: 0;
}

.unm-search-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.unm-search-input {
    flex-grow: 1;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-speed) var(--transition-ease);
}

.unm-search-input:focus {
    border-color: var(--primary-color);
}

.unm-search-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed) var(--transition-ease);
}

.unm-search-close:hover {
    background-color: var(--bg-alt);
    color: var(--primary-color);
}

/* --- KEYFRAME ANIMATIONS --- */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

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

/* --- MOBILE INLINE SEARCH BAR (Default hidden) --- */
.unm-header-search-bar-inline {
    display: none;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
    .unm-nav-menu {
        display: none;
    }
    
    .unm-hamburger {
        display: flex;
    }
    
    .unm-container {
        height: 70px;
        padding: 0 16px;
    }
    
    .unm-logo-img {
        height: 38px;
    }

    /* Hide desktop search button and show inline search bar */
    #unmSearchBtn {
        display: none !important;
    }

    .unm-header-search-bar-inline {
        display: block;
        flex: 1;
        margin: 0 12px;
        max-width: 320px;
    }

    .unm-search-form-inline {
        position: relative;
        width: 100%;
        display: flex;
        align-items: center;
    }

    .unm-search-input-field-inline {
        width: 100%;
        height: 36px;
        background-color: #f1f5f9;
        border: 1.5px solid #e2e8f0;
        border-radius: 18px;
        padding: 0 12px 0 34px;
        font-size: 0.78rem;
        font-family: inherit;
        color: var(--text-color);
        outline: none;
        transition: all 0.3s ease;
    }

    .unm-search-input-field-inline:focus {
        background-color: #ffffff;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(207, 110, 12, 0.12);
    }

    .unm-search-submit-btn-inline {
        position: absolute;
        left: 12px;
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #64748b;
    }

    .unm-search-submit-icon-inline {
        width: 15px;
        height: 15px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.5;
    }

    .unm-search-input-field-inline:focus + .unm-search-submit-btn-inline {
        color: var(--primary-color);
    }
}

@media (max-width: 640px) {
    .unm-topbar {
        font-size: 0.72rem;
        padding: 6px 12px;
        letter-spacing: 0.03em;
    }
    
    .unm-container {
        padding: 0 10px;
        height: 60px;
    }

    .unm-logo-img {
        height: 32px;
    }
    
    .unm-header-actions {
        gap: 6px;
    }

    .unm-action-btn {
        padding: 6px;
    }

    .unm-action-icon {
        width: 20px;
        height: 20px;
    }

    .unm-cart-badge {
        height: 16px;
        width: 16px;
        font-size: 0.6rem;
        top: -1px;
        right: -1px;
    }

    .unm-header-search-bar-inline {
        margin: 0 8px;
        max-width: 200px;
    }

    .unm-search-input-field-inline {
        height: 32px;
        padding-left: 28px;
        font-size: 0.72rem;
    }

    .unm-search-submit-btn-inline {
        left: 10px;
    }

    .unm-mobile-drawer {
        width: 280px;
        left: -280px;
    }

    .unm-mobile-drawer.active {
        left: 0;
    }
}

@media (max-width: 360px) {
    .unm-header-search-bar-inline {
        max-width: 150px;
    }
    .unm-logo-img {
        height: 28px;
    }
}
