/*
 * Header Module – Complete Styles (mobile‑responsive)
 * -------------------------------------------------
 * 1. Container & Reset
 * 2. Above‑Header
 * 3. Main Header
 * 4. Search Toggle Dropdown
 * 5. Below‑Header
 * 6. Mobile Bottom Nav
 * 7. Responsive Queries
 *
 * Account popup styles are in modules/account-popup/account-popup.css
 */

/* ==================================================================
   1. Container & Basic Reset
   ================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================================================================
   2. Above‑Header
   ================================================================== */
.eflour-above-header {
    background: #f5f5f5;
    border-bottom: 1px solid #e5e5e5;
    font-size: 0.75rem;
    padding: 6px 0;
}
.above-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
}
.above-header-inner a {
    color: #333;
    text-decoration: none;
}
.above-header-inner a:hover {
    color: #c59b27;
}

/* ==================================================================
   3. Main Header
   ================================================================== */
.eflour-main-header {
    background: #fff;
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
}
.main-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Logo */
.site-logo img {
    max-height: 42px;
    width: auto;
}

/* Search Bar (desktop) */
.header-search.desktop-search {
    flex: 1;
    max-width: 750px;
    margin: 0 30px;
}
.search-form-inner {
    display: flex;
    align-items: center;
    border: 2px solid #c59b27;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    width: 100%;
}

/* Search toggle button (three lines) */
.search-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
    justify-content: center;
    height: 100%;
    transition: background 0.2s;
}
.search-toggle-btn:hover {
    background: #f0f0f0;
}
.search-toggle-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: #555;
    border-radius: 2px;
}

/* Search input */
.search-form-inner input[type="search"] {
    flex: 1;
    border: none;
    padding: 10px 15px;
    font-size: 0.95rem;
    outline: none;
    min-width: 150px;
}

/* -------------------- MODIFIED SEARCH SUBMIT BUTTON -------------------- */
/* No background, just a gold icon with a scale‑up hover */
.search-form-inner button[type="submit"] {
    background: transparent;          /* no background */
    color: #c59b27;                   /* gold icon */
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s, transform 0.2s;
}
.search-form-inner button[type="submit"]:hover {
    color: #a6821f;                   /* darker gold */
    transform: scale(1.2);            /* grow slightly */
}
/* -------------------------------------------------------------------- */

/* User Icons */
.header-icons {
    display: flex;
    align-items: center;
    gap: 18px;
}
.icon-link {
    color: #333;
    font-size: 1.4rem;
    position: relative;
    text-decoration: none;
    transition: color 0.2s;
}
.icon-link:hover {
    color: #c59b27;
}
.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #dd1e31;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    line-height: 20px;
    text-align: center;
    font-weight: 700;
}

/* Mobile toggles (hidden by default) */
.mobile-menu-toggle,
.mobile-search-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #333;
    cursor: pointer;
}

/* Mobile search dropdown */
.mobile-search-form {
    padding: 15px 0 0;
    display: none;
}
.mobile-search-form form {
    display: flex;
    border: 2px solid #c59b27;
    border-radius: 4px;
    overflow: hidden;
}
.mobile-search-form input {
    flex: 1;
    border: none;
    padding: 10px 15px;
    background: #fff;
    font-size: 0.9rem;
}
.mobile-search-form button {
    background: #c59b27;
    color: #fff;
    border: none;
    padding: 0 20px;
    cursor: pointer;
}

/* ==================================================================
   4. Search Toggle Dropdown
   ================================================================== */
.search-toggle-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    z-index: 998;
    padding: 30px 0;
    border-top: 2px solid #c59b27;
}
.search-toggle-dropdown.open {
    display: block;
}
.dropdown-grid {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}
.dropdown-col {
    flex: 1;
    min-width: 200px;
}
.dropdown-col h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1b3022;
    border-bottom: 2px solid #4caf50;
    padding-bottom: 8px;
}
.dropdown-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dropdown-col ul li {
    margin-bottom: 8px;
}
.dropdown-col ul li a {
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
}
.dropdown-col ul li a:hover {
    color: #c59b27;
    background: #f9f9f9;
    padding-left: 8px;
}

/* ==================================================================
   5. Below‑Header
   ================================================================== */
.eflour-below-header {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
}
.desktop-categories {
    display: block;
}
.categories-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    align-items: center;
}
.categories-menu li a {
    display: block;
    padding: 12px 18px;
    color: #333;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}
.categories-menu li a:hover {
    color: #c59b27;
    border-bottom-color: #c59b27;
}
.hamburger-item {
    display: flex;
    align-items: center;
}

/* ==================================================================
   6. Mobile Bottom Navigation (app‑style)
   ================================================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    justify-content: space-around;
    padding: 6px 0 8px;
    z-index: 1000;
}
.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #777;
    text-decoration: none;
    font-size: 0.68rem;
    position: relative;
}
.mobile-bottom-nav .nav-item.active {
    color: #c59b27;
}
.cart-nav-item .cart-count-mobile {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #dd1e31;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.6rem;
    line-height: 18px;
    text-align: center;
    font-weight: 700;
}

/* ==================================================================
   7. Responsive Breakpoints
   ================================================================== */
@media (min-width: 992px) {
    .mobile-menu-toggle,
    .mobile-search-toggle,
    .mobile-search-form,
    .mobile-bottom-nav {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .eflour-above-header {
        font-size: 0.65rem;
        padding: 4px 0;
    }
    .site-logo img {
        max-height: 32px;
    }
    .header-search.desktop-search {
        max-width: 400px;
        margin: 0 15px;
    }
    .header-search input[type="search"] {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    .search-form-inner button[type="submit"] {
        padding: 0 15px;
        font-size: 1rem;
    }
    .header-icons {
        gap: 12px;
    }
    .icon-link {
        font-size: 1.2rem;
    }
    .categories-menu li a {
        padding: 8px 12px;
        font-size: 0.78rem;
    }
}

@media (max-width: 767px) {
    .eflour-above-header {
        display: none;
    }
    .site-logo {
        display: none;
    }
    .header-search.desktop-search {
        display: none;
    }
    .mobile-menu-toggle,
    .mobile-search-toggle {
        display: block;
    }
    .main-header-inner {
        gap: 10px;
    }
    .mobile-bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: 70px; /* space for bottom nav */
    }
    .dropdown-grid {
        flex-direction: column;
    }
}