/* /css/header.css */

.site-header {
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    /* NEW: Add a smooth transition for the background change */
    transition: background-color 0.3s ease, border-bottom 0.3s ease, box-shadow 0.3s ease;
}

/* This is the new "scrolled" state */
.site-header.scrolled {
    background-color: rgba(255, 255, 255, 0.85); /* Semi-transparent white */
    backdrop-filter: blur(10px); /* The "glassmorphism" blur effect */
    -webkit-backdrop-filter: blur(10px); /* For Safari compatibility */
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px var(--shadow-color);
}

/* --- Updated Logo Styles --- */
.logo {
    /* The container itself has no direct styles now */
    display: flex;
    align-items: center;
}

.logo-link {
    /* This is the main link for the logo */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.2s ease;
}

.logo-link:hover {
    color: var(--secondary-color); /* Changes color on hover */
}

.logo-link .logo-icon {
    /* Styles for the SVG icon */
    width: 24px;
    height: 24px;
}

.logo-link span {
    /* Styles for the logo text */
    font-family: 'Poppins', var(--font-family); /* Use the new font */
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px; /* Tighten up the letter spacing */
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 0;
    color: var(--text-light-color);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

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

.nav-link.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
    font-weight: 600;
}

.search-container {
    width: 250px;
}

#searchInput {
    width: 100%;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(246, 173, 85, 0.2); /* Adjusted shadow to match amber */
}

.sort-container {
    margin-left: 1rem;
}

#sort-select {
    padding: 0.6rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    font-size: 0.9rem;
    color: var(--text-color);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}


/* --- NEW Modern Hamburger Menu --- */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 1010;
}

.hamburger-bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
    position: absolute;
    left: 0;
    /* Updated transition for more fluid animation stages */
    transition: transform 0.25s ease-in-out, opacity 0.25s ease, background-color 0.25s ease;
}

.hamburger-bar:nth-child(1) {
    top: 0;
}

.hamburger-bar:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-bar:nth-child(3) {
    bottom: 0;
}

/* --- Animation when .active class is added --- */

.hamburger-menu.active .hamburger-bar {
    /* The cross color now uses the theme's secondary (amber) color */
    background-color: var(--secondary-color);
}

/* Squeeze top bar towards center, then rotate */
.hamburger-menu.active .hamburger-bar:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

/* Fade out the middle bar */
.hamburger-menu.active .hamburger-bar:nth-child(2) {
    opacity: 0;
}

/* Squeeze bottom bar towards center, then rotate */
.hamburger-menu.active .hamburger-bar:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}


/* --- Live Search Dropdown Styles --- */
.search-container {
    position: relative; /* This is crucial for positioning the dropdown */
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 16px var(--shadow-color);
    z-index: 999;
    max-height: 400px;
    overflow-y: auto;

    /* Hidden by default */
    display: none;
}

.search-results-dropdown.visible {
    display: block;
}

.result-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover {
    background-color: var(--background-color);
    color: var(--secondary-color);
}

.result-item .category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-light-color);
    margin-left: 0.5rem;
}