/* WM Region Utility Bar Styles */

#wm-region-bar {
    background-color: #e5332a;
    color: #ffffff;
    width: 100%;
    height: 42px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

/* Adjust for Admin Bar */
body.admin-bar #wm-region-bar {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar #wm-region-bar {
        top: 46px;
    }
}

/* Shift body down to make space for the fixed utility bar */
body {
    margin-top: 42px !important;
}

/* Shift down common theme headers when the utility bar is present.
   We apply the top property to all common header selectors directly. 
   If they are fixed/sticky, they shift down. If they are static (in-flow), 
   the browser ignores the top property, avoiding any visual layout issues. */
body #masthead,
body .site-header,
body .header,
body #header,
body .navbar,
body .nav-container,
body .elementor-sticky {
    top: 42px !important;
}

body.admin-bar #masthead,
body.admin-bar .site-header,
body.admin-bar .header,
body.admin-bar #header,
body.admin-bar .navbar,
body.admin-bar .nav-container,
body.admin-bar .elementor-sticky {
    top: 74px !important; /* 32px admin bar + 42px utility bar */
}

@media screen and (max-width: 782px) {
    body.admin-bar #masthead,
    body.admin-bar .site-header,
    body.admin-bar .header,
    body.admin-bar #header,
    body.admin-bar .navbar,
    body.admin-bar .nav-container,
    body.admin-bar .elementor-sticky {
        top: 88px !important; /* 46px admin bar + 42px utility bar */
    }
}


.wm-region-bar-container {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

/* Layout Sections */
.wm-region-bar-left,
.wm-region-bar-right {
    display: flex;
    align-items: center;
    height: 100%;
}

.wm-region-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 15px;
    user-select: none;
}

/* Dropdown Menu Common Styles */
.wm-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.wm-dropdown-toggle {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    outline: none;
    transition: background-color 0.2s ease;
}

.wm-dropdown-toggle:hover,
.wm-dropdown-toggle:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

.wm-dropdown-toggle .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
}

.wm-arrow {
    font-size: 9px;
    opacity: 0.8;
    transition: transform 0.2s ease;
}

.wm-dropdown:hover .wm-arrow {
    transform: rotate(180deg);
}

.wm-dropdown-menu {
    position: absolute;
    top: 100%;
    background-color: #b92019; /* Slightly darker shade of red for contrast */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    max-height: 350px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 100000;
}

/* Alignment */
.wm-region-bar-left .wm-dropdown-menu {
    left: 0;
}

.wm-region-bar-right .wm-dropdown-menu {
    right: 0;
}

.wm-dropdown:hover .wm-dropdown-menu,
.wm-dropdown:focus-within .wm-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wm-dropdown-menu ul {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.wm-dropdown-menu li {
    margin: 0;
    padding: 0;
}

.wm-dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: #ffffff;
    text-decoration: none;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    text-align: left;
}

.wm-dropdown-menu a:hover,
.wm-dropdown-menu a:focus {
    background-color: rgba(255, 255, 255, 0.15);
    outline: none;
}

/* Scrollbar for Dropdowns */
.wm-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}
.wm-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}
.wm-dropdown-menu::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
.wm-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

/* Search Bar Styles */
.wm-search-form {
    margin: 0 10px;
    height: 100%;
    display: flex;
    align-items: center;
}

.wm-search-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    height: 32px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.wm-search-input {
    width: 0;
    opacity: 0;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    padding: 0;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, border-bottom 0.2s ease;
    border-bottom: 1px solid transparent;
}

.wm-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.wm-search-input.active {
    width: 160px;
    opacity: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.8);
    padding: 4px 6px 2px 6px;
    margin-right: 5px;
}

.wm-search-submit {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    outline: none;
    transition: background-color 0.2s ease;
}

.wm-search-submit:hover,
.wm-search-submit:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

.wm-search-submit .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
}

/* Subcategories styling in dropdown */
.wm-dropdown-menu li.wm-subcategory a {
    padding-left: 28px;
    font-size: 12px;
    opacity: 0.9;
}
