/* Elgora Custom Header Styles */

.elgora-header {
    background: #fff;
    padding: 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    transition: transform 0.3s ease-in-out, background 0.3s ease;
    z-index: 1000;
    width: 100%;
    position: relative;
    top: 0;
}

.elgora-header.is-sticky {
    position: fixed;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.elgora-header.header-hidden {
    transform: translateY(-100%);
}

.elgora-header.header-visible {
    transform: translateY(0);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Nav Sections */
.header-desktop-nav {
    display: flex;
    gap: 25px;
}

.header-desktop-nav a {
    text-decoration: none;
    color: #888;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.header-desktop-nav a:hover,
.header-desktop-nav a.active {
    color: #000;
    font-weight: 700;
}

/* Logo */
.header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-logo img {
    height: 32px;
    /* Adjust based on actual logo */
    width: auto;
    display: block;
}

/* Actions/Icons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-actions a,
.header-actions .menu-toggle {
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.header-actions svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.5px;
}

/* Mobile Specifics */
.header-mobile-category {
    display: none;
    position: relative;
    cursor: pointer;
}

.category-current {
    display: flex;
    font-weight: 600;
    font-size: 16px;
    color: #000;
    align-items: center;
    gap: 4px;
}

.category-dropdown {
    position: absolute;
    top: 100%;
    text-align: start;
    left: 0;
    background: #fff;
    min-width: 120px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    margin-top: 10px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    border-radius: 4px;
    overflow: hidden;
}

.header-mobile-category.is-open .category-dropdown {
    display: flex;
}

.category-dropdown a {
    padding: 12px 10px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    border-bottom: 1px solid #f9f9f9;
}

.category-dropdown a:last-child {
    border-bottom: none;
}

.category-dropdown a.active {
    background: #fcfcfc;
    color: #000;
    font-weight: 700;
}

.header-mobile-category svg {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    transition: transform 0.3s ease;
}

.header-mobile-category.is-open .category-current svg {
    transform: rotate(180deg);
}

/* Mobile Actions Wrapper & Dropdown */
.mobile-actions-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.mobile-actions-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    min-width: 150px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    margin-top: 10px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    border-radius: 4px;
    overflow: hidden;
    padding: 5px;
}

.mobile-actions-wrapper.is-open .mobile-actions-dropdown {
    display: flex;
    gap: 5px;
}

.mobile-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    border-bottom: 1px solid #f9f9f9;
    transition: background 0.2s ease, color 0.2s ease;
}

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

.mobile-action-item:hover {
    background: #fcfcfc;
    color: #000;
}

.mobile-action-item svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.5px;
}

.mobile-only {
    display: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .header-desktop-nav {
        display: none;
    }

    .header-mobile-category {
        display: flex;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex;
    }

    .header-logo {
        position: static;
        transform: none;
    }

    .header-container {
        justify-content: space-between;
    }
}

/* --- Top Bar & Bottom Bar Extensions --- */

.elgora-top-bar {
    background-color: #f5f5f5;
    height: 45px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 64px;
    box-sizing: border-box;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
}

.country-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.country-selector svg {
    border-radius: 50%;
}

.country-selector .divider {
    height: 20px;
    width: 1px;
    background-color: #d9d9d9;
    margin: 0 4px;
}

.country-selector .help-link {
    color: #808080;
    font-size: 12px;
    text-decoration: none;
}

.elgora-bottom-bar {
    background-color: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 8px 55px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.bottom-bar-container {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
}

.items-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.items-nav a {
    text-decoration: none;
    color: #808080;
    font-size: 14px;
    font-weight: 500;
    padding: 8px;
    transition: color 0.2s;
}

.items-nav a:hover {
    color: #222;
}

.header-search {
    display: flex;
    align-items: center;
}

.search-pill {
    background-color: #d9d9d9;
    border-radius: 9999px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 244px;
    box-sizing: border-box;
    cursor: text;
}

.search-pill span {
    color: #707072;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 1025px) {
    .elgora-header .header-container {
        padding: 12px 64px;
        max-width: none;
    }
}

@media (max-width: 1024px) {
    .elgora-top-bar {
        padding: 0 20px;
    }

    .elgora-bottom-bar {
        padding: 8px 20px;
    }

    .header-items-wrapper {
        position: relative;
        cursor: pointer;
        display: flex;
        flex-direction: column;
    }

    .items-current {
        font-weight: 600;
        font-size: 16px;
        color: #000;
        align-items: center;
        gap: 4px;
        display: flex;
    }

    .items-current svg {
        width: 16px;
        height: 16px;
        margin-top: 2px;
        transition: transform 0.3s ease;
    }

    .header-items-wrapper.is-open .items-current svg {
        transform: rotate(180deg);
    }

    .items-nav {
        position: absolute;
        top: 100%;
        left: 0;
        background: #fff;
        min-width: 160px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        border: 1px solid #eee;
        margin-top: 15px;
        display: none !important;
        flex-direction: column;
        z-index: 1000;
        border-radius: 4px;
        overflow: hidden;
        padding: 0;
        max-height: 300px;
        overflow-y: auto;
    }

    .header-items-wrapper.is-open .items-nav {
        display: flex !important;
    }

    .items-nav a {
        padding: 12px 15px;
        text-decoration: none;
        color: #666;
        font-size: 14px;
        border-bottom: 1px solid #f9f9f9;
        width: 100%;
        box-sizing: border-box;
    }

    .search-pill {
        width: auto;
        padding: 8px;
        /* Make it more square-like on mobile if there is less space */
    }

    .search-pill span {
        display: none;
        /* Hide placeholder text on mobile to save space */
    }
}
