/* ============================================
   HEADER: Navigation, search bar, scroll
   ============================================ */

/* Header/Navigation styling */
header {
    background: var(--theme-bg-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1030;
    width: 100%;
    transition: all 0.3s ease;
}

/* Reduce header height on desktop (~25% smaller) */
@media (min-width: 992px) {
    header .navbar-brand.d-lg-block {
        margin-bottom: 0 !important;
        margin-top: -0.25rem !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    header .navbar-brand.d-lg-block .img-fluid {
        width: 500px; /* Slightly larger than 375px, still compact */
    }

    header .collapse.navbar-collapse {
        margin-top: 0.5rem !important; /* Down from mt-3 */
    }

    .navbar-expand-lg .navbar-nav .nav-item .nav-link {
        padding: 10px 20px !important; /* Down from 15px vertical */
    }
}

/* Search Bar: Below Header */
.search-bar-container {
    background: var(--theme-bg-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    box-shadow: none;
    transition: all 0.3s ease;
}

.search-bar-container.open {
    padding: 1rem 0;
    max-height: 100px;
}

.search-bar-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem; /* Small gap from viewport edges */
}

.search-bar-form {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.search-bar-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.75rem 1.25rem;
    font-size: 16px;
    background: transparent;
}

.search-bar-input::placeholder {
    color: #999;
}

.search-bar-input:focus {
    outline: none;
}

.search-bar-button {
    background: #515b3a;
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-bar-button:hover {
    background: #3d4629;
}

.search-bar-button i {
    font-size: 1.1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-bar-wrapper {
        padding: 0 1.5rem; /* Slightly more padding on mobile */
    }

    .search-bar-input {
        font-size: 15px;
        padding: 0.65rem 1rem;
    }

    .search-bar-button {
        padding: 0.65rem 1.25rem;
    }
}

/* ============================================
   MOBILE HEADER SCROLL TRANSITION
   ============================================ */

/* Container Transition */
.mobile-header-transition {
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Scrolled state for the container */
.header-scrolled .mobile-header-transition {
    min-height: 70px !important; /* Slightly increased for text clarity */
    padding: 5px 0 !important;
    align-items: center !important;
}

.header-scrolled header {
   box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Hide default items when scrolled */
.header-scrolled .mobile-default-item {
    display: none !important;
}

/* Show scrolled items when scrolled */
.header-scrolled .mobile-scrolled-item {
    display: block !important;
    animation: fadeIn 0.4s forwards;
}

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