/* ==========================================================================
   Navigation Drawer Sidebar
   Inline sidebar version of the navigation drawer menu.
   ========================================================================== */

/* Container */
.nav-drawer-sidebar {
    background: #fff;
    font-family: inherit;
}

/* Header */
.nav-drawer-sidebar__header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.nav-drawer-sidebar__header h3 {
    font-size: 22px;
    margin: 0;
}

.nav-drawer-sidebar__header h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-drawer-sidebar__header h3 a:hover {
    color: var(--h3_typography-color);
}

.nav-drawer-sidebar__header .view-all {
    color: #2c4551;
    text-transform: uppercase;
    font-size: 14px;
    margin-left: 7px;
    cursor: pointer;
    transition: all ease 0.35s;
}

.nav-drawer-sidebar__header .view-all::after {
    content: '\f0a9';
    margin-left: 7px;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    transition: all ease 0.35s;
}

.nav-drawer-sidebar__header .view-all:hover {
    color: #00a8e3;
}

/* Search */
.nav-drawer-sidebar__search {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

/* Scope radios above the input (only present when product search is enabled) */
.nav-drawer-sidebar__search-scope {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-bottom: 10px;
    font-size: 13px;
}

.nav-drawer-sidebar__search-scope-label {
    font-weight: 600;
    align-self: center;
}

.nav-drawer-sidebar__search-scope-option {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.nav-drawer-sidebar__search-scope-option input[type="radio"] {
    margin: 0 4px 0 0;
}

.nav-drawer-sidebar__search-input-wrap {
    position: relative;
}

.nav-drawer-sidebar__search-input-wrap::before {
    content: '\f002';
    color: var(--nav-drawer-search-icon-color, #00a8e3);
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 15px;
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    pointer-events: none;
}

.nav-drawer-sidebar__search-input {
    width: 100%;
    box-sizing: border-box;
    outline: 0 !important;
    padding: 5px 5px 5px 30px;
    font-size: var(--form_text_size);
    color: var(--form_text_color);
    border-width: var(--form_border_width-top) var(--form_border_width-right) var(--form_border_width-bottom) var(--form_border_width-left) !important;
    border-color: var(--form_border_color);
    border-radius: var(--form_border_radius) !important;
    border-style: solid;
}

/* Grouped search results (Categories / Products) */
.nav-drawer-sidebar__results-group + .nav-drawer-sidebar__results-group {
    margin-top: 18px;
}

.nav-drawer-sidebar__group-heading {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #888;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 4px;
}

/* Product result rows: title above SKU subline */
.nav-drawer-sidebar__product-item .nav-drawer-sidebar__text {
    display: flex;
    flex-direction: column;
}

.nav-drawer-sidebar__product-title {
    line-height: 1.3;
}

.nav-drawer-sidebar__product-sku {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.nav-drawer-sidebar__view-all-link {
    padding: 10px 0 4px;
    text-align: right;
}

.nav-drawer-sidebar__view-all-link a {
    color: #00a8e3;
    font-size: 13px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-drawer-sidebar__view-all-link a:hover {
    color: #2c4551;
}

/* Panels container */
.nav-drawer-sidebar__panels {
    position: relative;
    overflow: hidden;
    transition: min-height 0.3s ease;
}

/* Base panel - normal flow to establish container height */
.nav-drawer-sidebar__panel--base {
    padding: 20px;
    transition: opacity 0.3s ease;
}

/* Hide parent panel when a child overlay is active */
.nav-drawer-sidebar__panel:has(~ .nav-drawer-sidebar__panel--active) {
    opacity: 0;
}

/* Overlay panels - absolutely positioned on top of base */
.nav-drawer-sidebar__panel--overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 20px;
    box-sizing: border-box;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.nav-drawer-sidebar__panel--overlay.nav-drawer-sidebar__panel--active {
    transform: translateX(0);
}

/* Back button */
.nav-drawer-sidebar__back {
    margin-bottom: 10px;
}

.nav-drawer-sidebar__back-btn {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    padding: 5px 0;
    cursor: pointer;
    font-size: var(--nav_dropdown_font_size);
    color: #00a8e3;
    transition: color 0.2s ease;
}

.nav-drawer-sidebar__back-btn::before {
    content: '\f053';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 12px;
    margin-right: 8px;
}

.nav-drawer-sidebar__back-btn:hover {
    color: #2c4551;
}

/* Panel header (child panels) */
.nav-drawer-sidebar__panel-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.nav-drawer-sidebar__panel-header h4 {
    font-size: 18px;
    margin: 0;
}

.nav-drawer-sidebar__panel-header h4 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-drawer-sidebar__panel-header h4 a:hover {
    color: var(--h3_typography-color);
}

.nav-drawer-sidebar__panel-header .view-all {
    color: #2c4551;
    text-transform: uppercase;
    font-size: 13px;
    margin-left: 7px;
    cursor: pointer;
    transition: all ease 0.35s;
}

.nav-drawer-sidebar__panel-header .view-all::after {
    content: '\f0a9';
    margin-left: 7px;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    transition: all ease 0.35s;
}

.nav-drawer-sidebar__panel-header .view-all:hover {
    color: #00a8e3;
}

/* Menu list */
.nav-drawer-sidebar__menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Menu items */
.nav-drawer-sidebar__menu-item {
    margin: 0;
    padding: 10px 0!important;
    border-bottom: 1px solid #eee;
}

.nav-drawer-sidebar__menu-item:last-child {
    border-bottom: none;
}

/* Menu links */
.nav-drawer-sidebar__menu-link {
    display: flex!important;
    align-items: center;
    color: inherit;
    text-decoration: none;
    gap: 10px;
    transition: background-color 0.2s ease;
}

/* Thumbnail */
.nav-drawer-sidebar__thumbnail {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 50%;
}

/* Avada icon fallback (used when a menu item has an icon but no thumbnail) */
.nav-drawer-sidebar__icon {
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    font-size: 18px;
    line-height: 1;
}

/* Text */
.nav-drawer-sidebar__text {
    flex: 1;
    line-height: 1.4;
    font-size: var(--nav_dropdown_font_size);
}

/* Arrow for items with children */
.nav-drawer-sidebar__menu-item--has-children > a::after {
    font-family: "Font Awesome 5 Free";
    font-size: var(--nav_dropdown_font_size);
    font-weight: 900;
    content: "\f054";
    margin-left: auto;
    padding-left: 10px;
}

/* No results message */
.nav-drawer-sidebar__no-results {
    padding: 15px 0;
    color: #999;
    font-size: var(--nav_dropdown_font_size);
}

/* Cascade animation for menu items */
@keyframes sidebarCascadeDown {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-drawer-sidebar__panel .nav-drawer-sidebar__menu-item {
    animation: sidebarCascadeDown 0.4s ease-out;
    animation-fill-mode: both;
}

/* ==========================================================================
   Mobile toggle
   The full category list is hidden by default on small screens; the user
   taps the chevron button in the header to expand it. On desktop the button
   is hidden via CSS and the list is always visible.

   NOTE: the collapse breakpoint is configurable from the plugin settings
   ("Inline Sidebar Collapse Breakpoint"), so the viewport-gated rules — the
   @media (max-width) block that shows the toggle, lays out the header, and
   hides the search/panels in the collapsed state — are emitted dynamically by
   the plugin's output_dynamic_css() (default 640px), NOT hardcoded here. The
   rules below are breakpoint-independent (button appearance and the chevron
   icon) and stay in the static stylesheet.
   ========================================================================== */

/* Toggle button — hidden by default; revealed at the mobile breakpoint.
   !important is used on the display rule to defend against Avada's
   button-reset styles (which apply a generic display value with !important
   to <button> elements on some configurations).

   Touch reliability:
     - touch-action: manipulation removes the ~300ms click delay browsers
       impose for double-tap-zoom detection. Without it, rapid taps land
       inside the previous tap's ignore window and get dropped — visible
       to the user as "the button registers the tap visually but nothing
       happens, I have to tap 3-4 times".
     - 44x44 tap target meets Apple HIG / WCAG 2.1 AA minimum (44x44 CSS
       pixels) and substantially reduces missed taps from imprecise touches.
     - -webkit-tap-highlight-color suppresses the default mobile flash so
       our own :hover / :focus background colour is the only visual feedback,
       avoiding a "stuck highlight" appearance on iOS after a successful tap. */
.nav-drawer-sidebar__toggle {
    display: none !important;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #eee;
    border-radius: 4px;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: #2c4551;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.nav-drawer-sidebar__toggle:hover,
.nav-drawer-sidebar__toggle:focus {
    background-color: #f5f5f5;
    color: #00a8e3;
    border-color: #00a8e3;
    outline: none;
}

/* Icon — injected as a Font Awesome 5 Free Unicode glyph via ::before so
   we don't depend on the FA class-based CSS being loaded. Same approach
   as .nav-drawer-sidebar__back-btn::before. \f078 = chevron-down.

   pointer-events: none ensures touch / mouse events always target the
   parent <button>, never the icon span. Without this, iOS Safari can
   miss-route touches that land on the icon and the synthetic click
   never fires on the button (one source of the "tap registered visually
   but toggle didn't fire" symptom). */
.nav-drawer-sidebar__toggle-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    line-height: 1;
    transition: transform 0.2s ease;
    pointer-events: none;
}

.nav-drawer-sidebar__toggle-icon::before {
    content: '\f078';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 14px;
    line-height: 1;
    display: inline-block;
    pointer-events: none;
}

/* Rotated icon when expanded (chevron-down → chevron-up). */
.nav-drawer-sidebar__toggle[aria-expanded="true"] .nav-drawer-sidebar__toggle-icon {
    transform: rotate(180deg);
}

/* The viewport-gated rules that previously lived here in an
   @media (max-width: 640px) block are now emitted by the plugin's
   output_dynamic_css() using the configurable breakpoint. See the section
   comment above. */
