/*
 * Frontend Styles for Dizi Mega Menu
 * Version: 1.0.0
 */

/* =========================================================
   1. Container & Base Structure
   ========================================================= */

/* The <ul> wrapper that holds all menu items */
.dmm-mega-menu-container {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

/* Each top-level <li> must be position:relative so dropdown is anchored to it.
   We do NOT use position:static because that causes hover flicker. */
.dmm-mega-menu-container > li {
    position: relative;
}

/* =========================================================
   2. Mega Menu Dropdown — Hidden State
   Using visibility+opacity (not display:none) to allow CSS transitions.
   pointer-events:none prevents invisible dropdown from blocking mouse.
   ========================================================= */
.dmm-mega-menu-wrapper {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 900px; /* Increased to make mega menu wider */
    width: max-content;
    max-width: 100vw;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border-top: 3px solid #2271b1;
    border-radius: 0 0 6px 6px;
    z-index: 99999;

    /* Hidden by default — smooth transition */
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
    pointer-events: none;
    box-sizing: border-box;
}

/* =========================================================
   3. Mega Menu Dropdown — Hover/Active State
   "visibility: 0s" delay removed on show so it appears instantly.
   ========================================================= */
@media (min-width: 769px) {
    li.dmm-has-mega-menu:hover > .dmm-mega-menu-wrapper,
    li.dmm-has-mega-menu.dmm-keyboard-focus > .dmm-mega-menu-wrapper {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0s;
        pointer-events: auto;
}
}

/* Remove underline from ALL links inside the mega menu */
.dmm-mega-menu-wrapper a {
    text-decoration: none !important;
}

/* =========================================================
   4. Dropdown Caret Arrow on Parent Link
   ========================================================= */
/* We no longer rely solely on the theme to render arrows. The walker adds 'menu-item-has-children' 
   class, and we define a custom FontAwesome dropdown caret below for guaranteed compatibility. */
html body .dmm-mega-menu-container > li.dmm-has-mega-menu > a::after {
    content: "\f107" !important;
    font-family: "Font Awesome 5 Free", "FontAwesome", sans-serif !important;
    font-weight: 900 !important;
    margin-left: 6px !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* =========================================================
   5. Inner Grid System
   ========================================================= */
.dmm-mega-menu-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 25px 30px;
}

.dmm-row-frontend {
    display: flex;
    flex-wrap: wrap;
    margin-left: -12px;
    margin-right: -12px;
    margin-bottom: 15px;
}
.dmm-row-frontend:last-child {
    margin-bottom: 0;
}

.dmm-column-frontend {
    padding: 0 12px;
    box-sizing: border-box;
    min-width: 0;
}

/* Grid column widths — based on number of columns in row */
.dmm-col-12 { flex: 0 0 100%;    max-width: 100%; }
.dmm-col-6  { flex: 0 0 50%;     max-width: 50%; }
.dmm-col-4  { flex: 0 0 33.333%; max-width: 33.333%; }
.dmm-col-3  { flex: 0 0 25%;     max-width: 25%; }
.dmm-col-2  { flex: 0 0 16.666%; max-width: 16.666%; }

/* =========================================================
   6. Component Styles
   ========================================================= */
.dmm-item-frontend {
    margin-bottom: 8px;
}

/* Custom Link */
.dmm-custom-link {
    display: block;
    padding: 7px 0;
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.2s ease, padding-left 0.2s ease;
    border-bottom: 1px solid transparent;
}
.dmm-custom-link:hover {
    padding-left: 5px;
}

/* Highlighted Link component */
.dmm-highlight-link {
    font-weight: 700;
}
.dmm-highlight-link:hover {
    transform: translateY(-1px);
}

/* Column Title component */
.dmm-mega-menu-wrapper .dmm-title {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

/* =========================================================
   7. WooCommerce Product Card
   ========================================================= */
.dmm-woo-product-card {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #f0f0f0;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.dmm-woo-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.dmm-woo-product-card img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
    display: block;
}
.dmm-woo-title {
    margin: 0 0 8px 0;
    font-size: 13px;
    line-height: 1.4;
}
.dmm-woo-title a {
    text-decoration: none;
}
.dmm-woo-title a:hover {
}
.dmm-woo-price {
    font-weight: 700;
    color: #2271b1;
    margin-bottom: 10px;
    font-size: 14px;
}
.dmm-woo-product-card .add_to_cart_button {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    padding: 7px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
}
.dmm-woo-product-card .add_to_cart_button:hover {
    background: #135e96;
}

/* WooCommerce Shortcode Grid inside Mega Menu */
.dmm-woo-grid-container .woocommerce ul.products,
.dmm-woo-cat-grid-container .woocommerce ul.products,
.dmm-woo-grid-container ul.products,
.dmm-woo-cat-grid-container ul.products {
    display: flex !important;
    flex-wrap: wrap !important;
    margin: 0 -8px !important;
    list-style: none !important;
    padding: 0 !important;
    width: 100% !important;
}
.dmm-woo-grid-container .woocommerce ul.products li.product,
.dmm-woo-cat-grid-container .woocommerce ul.products li.product,
.dmm-woo-grid-container ul.products li.product,
.dmm-woo-cat-grid-container ul.products li.product {
    margin: 0 8px 16px !important;
    width: calc(25% - 16px) !important; /* Default fallback to 4 columns */
    box-sizing: border-box !important;
    float: none !important;
    display: list-item !important;
}

/* Columns specific overrides */
.dmm-woo-grid-container .woocommerce.columns-1 ul.products li.product,
.dmm-woo-grid-container ul.products.columns-1 li.product,
.dmm-woo-cat-grid-container .woocommerce.columns-1 ul.products li.product,
.dmm-woo-cat-grid-container ul.products.columns-1 li.product {
    width: calc(100% - 16px) !important;
}
.dmm-woo-grid-container .woocommerce.columns-2 ul.products li.product,
.dmm-woo-grid-container ul.products.columns-2 li.product,
.dmm-woo-cat-grid-container .woocommerce.columns-2 ul.products li.product,
.dmm-woo-cat-grid-container ul.products.columns-2 li.product {
    width: calc(50% - 16px) !important;
}
.dmm-woo-grid-container .woocommerce.columns-3 ul.products li.product,
.dmm-woo-grid-container ul.products.columns-3 li.product,
.dmm-woo-cat-grid-container .woocommerce.columns-3 ul.products li.product,
.dmm-woo-cat-grid-container ul.products.columns-3 li.product {
    width: calc(33.333% - 16px) !important;
}
.dmm-woo-grid-container .woocommerce.columns-4 ul.products li.product,
.dmm-woo-grid-container ul.products.columns-4 li.product,
.dmm-woo-cat-grid-container .woocommerce.columns-4 ul.products li.product,
.dmm-woo-cat-grid-container ul.products.columns-4 li.product {
    width: calc(25% - 16px) !important;
}

/* =========================================================
   8. Icon Component
   ========================================================= */
.dmm-custom-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.dmm-custom-icon-wrapper svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}
.dmm-anim-spin i,  .dmm-anim-spin svg  { animation: dmm-spin 2s linear infinite; }
.dmm-anim-pulse i, .dmm-anim-pulse svg { animation: dmm-pulse 1.5s ease-in-out infinite; }
.dmm-anim-bounce i,.dmm-anim-bounce svg{ animation: dmm-bounce 2s infinite; }
@keyframes dmm-spin   { 100% { transform: rotate(360deg); } }
@keyframes dmm-pulse  { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes dmm-bounce { 0%,20%,50%,80%,100% { transform: translateY(0); } 40% { transform: translateY(-12px); } 60% { transform: translateY(-6px); } }

/* =========================================================
   9. Responsive Visibility
   ========================================================= */
@media (min-width: 1025px) { .dmm-hide-desktop { display: none !important; } }
@media (min-width: 769px) and (max-width: 1024px) { .dmm-hide-tablet { display: none !important; } }
@media (max-width: 768px) { .dmm-hide-mobile  { display: none !important; } }

/* =========================================================
   10. Sub-Menu (Standard Flyout for non-mega items)
   ========================================================= */
.dmm-mega-menu-container li {
    position: relative;
}
.dmm-mega-menu-container ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-top: 2px solid #2271b1;
    border-radius: 0 0 4px 4px;
    z-index: 99999;
    visibility: hidden;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
    padding: 8px 0;
    margin: 0;
    list-style: none;
    pointer-events: none;
    box-sizing: border-box;
}
.dmm-mega-menu-container li:hover > ul.sub-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
    pointer-events: auto;
}
.dmm-mega-menu-container ul.sub-menu li a {
    display: block;
    padding: 9px 18px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.dmm-mega-menu-container ul.sub-menu li:hover > a {
    background: #f5f8ff;
    color: #2271b1;
}
/* Nested flyout */
.dmm-mega-menu-container ul.sub-menu ul.sub-menu {
    top: 0;
    left: 100%;
}

/* =========================================================
   11. Full-Width Dropdown
   ========================================================= */
.dmm-full-width-dropdowns li.dmm-has-mega-menu {
    position: static !important;
}
.dmm-full-width-dropdowns .dmm-mega-menu-wrapper {
    /* JS calculates left and width dynamically */
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}
@media (min-width: 769px) {
    .dmm-full-width-dropdowns li.dmm-has-mega-menu:hover > .dmm-mega-menu-wrapper {
        transform: translateY(0);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0s;
    }
}

/* =========================================================
   12. Dropdown Animations (applied via class on wrapper)
   ========================================================= */
@media (min-width: 769px) {
    li.dmm-has-mega-menu:hover > .dmm-dropdown-anim-fade_in    { animation: dmm-anim-fade-in    var(--dmm-anim-speed, 300ms) ease both; }
    li.dmm-has-mega-menu:hover > .dmm-dropdown-anim-fade_up    { animation: dmm-anim-fade-up    var(--dmm-anim-speed, 300ms) ease both; }
    li.dmm-has-mega-menu:hover > .dmm-dropdown-anim-zoom_in    { animation: dmm-anim-zoom-in    var(--dmm-anim-speed, 300ms) ease both; }
    li.dmm-has-mega-menu:hover > .dmm-dropdown-anim-slide_down { animation: dmm-anim-slide-down var(--dmm-anim-speed, 300ms) ease both; }
    li.dmm-has-mega-menu:hover > .dmm-dropdown-anim-slide_left { animation: dmm-anim-slide-left var(--dmm-anim-speed, 300ms) ease both; }
    li.dmm-has-mega-menu:hover > .dmm-dropdown-anim-slide_right{ animation: dmm-anim-slide-right var(--dmm-anim-speed, 300ms) ease both; }
    li.dmm-has-mega-menu:hover > .dmm-dropdown-anim-rotate     { animation: dmm-anim-rotate     var(--dmm-anim-speed, 300ms) ease both; }
    li.dmm-has-mega-menu:hover > .dmm-dropdown-anim-bounce     { animation: dmm-anim-bounce-in  var(--dmm-anim-speed, 400ms) cubic-bezier(0.175, 0.885, 0.32, 1.275) both; }
}

@keyframes dmm-anim-fade-in    { from { opacity: 0; }                               to { opacity: 1; } }
@keyframes dmm-anim-fade-up    { from { opacity: 0; transform: translateY(15px); }  to { opacity: 1; transform: translateY(0); } }
@keyframes dmm-anim-zoom-in    { from { opacity: 0; transform: scale(0.95); }       to { opacity: 1; transform: scale(1); } }
@keyframes dmm-anim-slide-down { from { opacity: 0; transform: scaleY(0); }         to { opacity: 1; transform: scaleY(1); } }
@keyframes dmm-anim-slide-left { from { opacity: 0; transform: translateX(20px); }  to { opacity: 1; transform: translateX(0); } }
@keyframes dmm-anim-slide_right{ from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes dmm-anim-rotate     { from { opacity: 0; transform: rotateX(-12deg); }   to { opacity: 1; transform: rotateX(0); } }
@keyframes dmm-anim-bounce-in  { 0% { opacity:0; transform: scale(0.9); } 60% { opacity:1; transform: scale(1.03); } 100% { transform: scale(1); } }

/* =========================================================
   13. Advanced Positioning Modes
   ========================================================= */

/* ------- Sticky Mode ------- */
/* .dmm-nav-sticky is added by JS to the nav wrapper on scroll */
.dmm-nav-sticky-wrapper {
    /* Reserve space so page doesn't jump when wrapper becomes fixed */
}
.dmm-nav-sticky-wrapper.is-stuck {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    background: #fff;
    box-shadow: 0 2px 15px rgba(0,0,0,0.10);
    animation: dmm-slide-down 0.25s ease;
}
@keyframes dmm-slide-down {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}
/* Placeholder keeps the page height when wrapper is fixed */
.dmm-sticky-placeholder {
    display: none;
}
.dmm-sticky-placeholder.is-visible {
    display: block;
}

/* ------- Floating (Pill) Mode ------- */
/* .dmm-pos-floating is added by JS to a wrapper div it creates */
.dmm-floating-wrapper {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.13);
    z-index: 999999;
    padding: 0 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: box-shadow 0.2s ease;
}
.dmm-floating-wrapper:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
/* Hide the original nav element when floating wrapper is active */
.dmm-floating-source-hidden {
    visibility: hidden;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}
/* Make sure the UL inside the floating wrapper is visible */
.dmm-floating-wrapper .dmm-mega-menu-container {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Vertical menu (shortcode) */
.dmm-mode-vertical {
    width: 100%;
    max-width: 280px;
}
.dmm-mode-vertical ul.dmm-mega-menu-container {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #f9f9f9;
    border-radius: 6px;
}
.dmm-mode-vertical ul.dmm-mega-menu-container > li {
    position: relative;
    display: block;
}
.dmm-mode-vertical ul.dmm-mega-menu-container > li > a {
    display: block;
    padding: 11px 18px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}
.dmm-mode-vertical .dmm-mega-menu-wrapper {
    top: 0;
    left: 100%;
    width: 700px;
    max-width: calc(100vw - 300px);
    transform: translateX(8px);
}
@media (min-width: 769px) {
    .dmm-mode-vertical li.dmm-has-mega-menu:hover > .dmm-mega-menu-wrapper {
        transform: translateX(0);
    }
}
.dmm-mode-vertical li.dmm-has-mega-menu > a::after {
    content: "›";
    float: right;
    font-size: 16px;
}

/* =========================================================
   14. Off-Canvas Mobile Menu
   ========================================================= */
.dmm-hamburger-trigger {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: #333;
    cursor: pointer;
    padding: 8px 10px;
    z-index: 9999;
    line-height: 1;
}
.dmm-hamburger-trigger.dmm-is-sticky { position: fixed; top: 15px; }
.dmm-hamburger-trigger.dmm-pos-right.dmm-is-sticky { right: 15px; }
.dmm-hamburger-trigger.dmm-pos-left.dmm-is-sticky  { left: 15px; }

.dmm-offcanvas-drawer  { display: block; }
.dmm-offcanvas-close   { display: none; }
.dmm-offcanvas-overlay { display: none; }

@media (max-width: 768px) {
    .dmm-hamburger-trigger { display: inline-flex; align-items: center; }

    /* Hide desktop mega menu on mobile */
    li.dmm-has-mega-menu > .dmm-mega-menu-wrapper {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    .dmm-offcanvas-drawer {
        display: block;
        position: fixed;
        top: 0;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        background: #fff;
        z-index: 999999;
        overflow-y: auto;
        box-shadow: 0 0 30px rgba(0,0,0,0.15);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .dmm-offcanvas-drawer.dmm-pos-left  { left: 0;  transform: translateX(-100%); }
    .dmm-offcanvas-drawer.dmm-pos-right { right: 0; transform: translateX(100%); }
    body.dmm-offcanvas-open .dmm-offcanvas-drawer.dmm-pos-left  { transform: translateX(0); }
    body.dmm-offcanvas-open .dmm-offcanvas-drawer.dmm-pos-right { transform: translateX(0); }

    .dmm-offcanvas-close {
        display: block;
        position: absolute;
        top: 12px;
        right: 12px;
        background: none;
        border: none;
        font-size: 20px;
        color: #666;
        cursor: pointer;
        z-index: 1;
    }

    .dmm-offcanvas-drawer ul {
        list-style: none;
        padding: 55px 20px 20px;
        margin: 0;
    }
    .dmm-offcanvas-drawer ul li { display: block; }
    .dmm-offcanvas-drawer ul li a {
        display: block !important;
        padding: 11px 0 !important;
        border-bottom: 1px solid #f0f0f0 !important;
        color: #000 !important;
        text-decoration: none !important;
        font-size: 15px !important;
        font-weight: 500 !important;
    }
    .dmm-offcanvas-drawer ul li a:hover {
        color: #ff0000 !important;
    }

    /* Mobile mega menu toggle */
    .dmm-offcanvas-drawer .dmm-mega-menu-wrapper,
    .offcanvas .dmm-mega-menu-wrapper,
    .dmm-mega-menu-wrapper {
        position: static !important;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: #f9f9f9;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        display: none;
        padding: 10px 15px;
        margin: 5px 0 10px 0;
        pointer-events: auto;
    }
    
    /* Ensure text is visible on mobile regardless of desktop settings */
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper,
    html body .offcanvas .dmm-mega-menu-wrapper,
    html body .dmm-mega-menu-wrapper,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper a,
    html body .offcanvas .dmm-mega-menu-wrapper a,
    html body .dmm-mega-menu-wrapper a,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper a:link,
    html body .offcanvas .dmm-mega-menu-wrapper a:link,
    html body .dmm-mega-menu-wrapper a:link,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper a:visited,
    html body .offcanvas .dmm-mega-menu-wrapper a:visited,
    html body .dmm-mega-menu-wrapper a:visited,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper li,
    html body .offcanvas .dmm-mega-menu-wrapper li,
    html body .dmm-mega-menu-wrapper li,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-title,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-title,
    html body .dmm-mega-menu-wrapper .dmm-title,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-title a,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-title a,
    html body .dmm-mega-menu-wrapper .dmm-title a,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-title a:link,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-title a:link,
    html body .dmm-mega-menu-wrapper .dmm-title a:link,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-title a:visited,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-title a:visited,
    html body .dmm-mega-menu-wrapper .dmm-title a:visited,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-custom-link,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-custom-link,
    html body .dmm-mega-menu-wrapper .dmm-custom-link,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-custom-link:link,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-custom-link:link,
    html body .dmm-mega-menu-wrapper .dmm-custom-link:link,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-custom-link:visited,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-custom-link:visited,
    html body .dmm-mega-menu-wrapper .dmm-custom-link:visited,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-woo-title,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-woo-title,
    html body .dmm-mega-menu-wrapper .dmm-woo-title,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-woo-title a,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-woo-title a,
    html body .dmm-mega-menu-wrapper .dmm-woo-title a,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-woo-title a:link,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-woo-title a:link,
    html body .dmm-mega-menu-wrapper .dmm-woo-title a:link,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-woo-title a:visited,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-woo-title a:visited,
    html body .dmm-mega-menu-wrapper .dmm-woo-title a:visited,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-item-link,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-item-link,
    html body .dmm-mega-menu-wrapper .dmm-item-link,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-item-link:link,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-item-link:link,
    html body .dmm-mega-menu-wrapper .dmm-item-link:link,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-item-link:visited,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-item-link:visited,
    html body .dmm-mega-menu-wrapper .dmm-item-link:visited,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-post-title a,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-post-title a,
    html body .dmm-mega-menu-wrapper .dmm-post-title a,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-post-title a:link,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-post-title a:link,
    html body .dmm-mega-menu-wrapper .dmm-post-title a:link,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-post-title a:visited,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-post-title a:visited,
    html body .dmm-mega-menu-wrapper .dmm-post-title a:visited,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-generic-item,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-generic-item,
    html body .dmm-mega-menu-wrapper .dmm-generic-item,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-product__title,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-product__title,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-product__title,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-category__title,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-category__title,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-category__title,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-product__link,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-product__link,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-product__link,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-category__link,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-category__link,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-category__link,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-product__link:link,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-product__link:link,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-product__link:link,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-product__link:visited,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-product__link:visited,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-product__link:visited,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-category__link:link,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-category__link:link,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-category__link:link,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-category__link:visited,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-category__link:visited,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-category__link:visited,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .products .product h2,
    html body .offcanvas .dmm-mega-menu-wrapper .products .product h2,
    html body .dmm-mega-menu-wrapper .products .product h2,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .products .product h3,
    html body .offcanvas .dmm-mega-menu-wrapper .products .product h3,
    html body .dmm-mega-menu-wrapper .products .product h3,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .products .product h4,
    html body .offcanvas .dmm-mega-menu-wrapper .products .product h4,
    html body .dmm-mega-menu-wrapper .products .product h4,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .products .product a,
    html body .offcanvas .dmm-mega-menu-wrapper .products .product a,
    html body .dmm-mega-menu-wrapper .products .product a,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .products .product a:link,
    html body .offcanvas .dmm-mega-menu-wrapper .products .product a:link,
    html body .dmm-mega-menu-wrapper .products .product a:link,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .products .product a:visited,
    html body .offcanvas .dmm-mega-menu-wrapper .products .product a:visited,
    html body .dmm-mega-menu-wrapper .products .product a:visited,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .price,
    html body .offcanvas .dmm-mega-menu-wrapper .price,
    html body .dmm-mega-menu-wrapper .price,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .price span,
    html body .offcanvas .dmm-mega-menu-wrapper .price span,
    html body .dmm-mega-menu-wrapper .price span,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .amount,
    html body .offcanvas .dmm-mega-menu-wrapper .amount,
    html body .dmm-mega-menu-wrapper .amount,
    html body .dmm-offcanvas-drawer li.menu-item-has-children > a,
    html body .offcanvas li.menu-item-has-children > a,
    html body .dmm-mega-menu-wrapper li.menu-item-has-children > a,
    html body .dmm-offcanvas-drawer li.menu-item-has-children > a:link,
    html body .offcanvas li.menu-item-has-children > a:link,
    html body .dmm-mega-menu-wrapper li.menu-item-has-children > a:link,
    html body .dmm-offcanvas-drawer li.menu-item-has-children > a:visited,
    html body .offcanvas li.menu-item-has-children > a:visited,
    html body .dmm-mega-menu-wrapper li.menu-item-has-children > a:visited,
    html body .dmm-offcanvas-drawer ul li.menu-item-has-children > a,
    html body .offcanvas ul li.menu-item-has-children > a,
    html body .dmm-mega-menu-wrapper ul li.menu-item-has-children > a,
    html body .dmm-offcanvas-drawer ul li.menu-item-has-children > a:link,
    html body .offcanvas ul li.menu-item-has-children > a:link,
    html body .dmm-mega-menu-wrapper ul li.menu-item-has-children > a:link,
    html body .dmm-offcanvas-drawer ul li.menu-item-has-children > a:visited,
    html body .offcanvas ul li.menu-item-has-children > a:visited,
    html body .dmm-mega-menu-wrapper ul li.menu-item-has-children > a:visited {
        color: #000000 !important;
    }
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper a:hover,
    html body .offcanvas .dmm-mega-menu-wrapper a:hover,
    html body .dmm-mega-menu-wrapper a:hover,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper a:active,
    html body .offcanvas .dmm-mega-menu-wrapper a:active,
    html body .dmm-mega-menu-wrapper a:active,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper a:focus,
    html body .offcanvas .dmm-mega-menu-wrapper a:focus,
    html body .dmm-mega-menu-wrapper a:focus,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-custom-link:hover,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-custom-link:hover,
    html body .dmm-mega-menu-wrapper .dmm-custom-link:hover,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-custom-link:active,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-custom-link:active,
    html body .dmm-mega-menu-wrapper .dmm-custom-link:active,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-custom-link:focus,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-custom-link:focus,
    html body .dmm-mega-menu-wrapper .dmm-custom-link:focus,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-woo-title a:hover,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-woo-title a:hover,
    html body .dmm-mega-menu-wrapper .dmm-woo-title a:hover,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-woo-title a:active,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-woo-title a:active,
    html body .dmm-mega-menu-wrapper .dmm-woo-title a:active,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-woo-title a:focus,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-woo-title a:focus,
    html body .dmm-mega-menu-wrapper .dmm-woo-title a:focus,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-item-link:hover,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-item-link:hover,
    html body .dmm-mega-menu-wrapper .dmm-item-link:hover,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-item-link:active,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-item-link:active,
    html body .dmm-mega-menu-wrapper .dmm-item-link:active,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-item-link:focus,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-item-link:focus,
    html body .dmm-mega-menu-wrapper .dmm-item-link:focus,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-post-title a:hover,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-post-title a:hover,
    html body .dmm-mega-menu-wrapper .dmm-post-title a:hover,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-post-title a:active,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-post-title a:active,
    html body .dmm-mega-menu-wrapper .dmm-post-title a:active,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .dmm-post-title a:focus,
    html body .offcanvas .dmm-mega-menu-wrapper .dmm-post-title a:focus,
    html body .dmm-mega-menu-wrapper .dmm-post-title a:focus,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-product__title:hover,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-product__title:hover,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-product__title:hover,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-category__title:hover,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-category__title:hover,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-category__title:hover,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-product__link:hover,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-product__link:hover,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-product__link:hover,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-product__link:active,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-product__link:active,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-product__link:active,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-product__link:focus,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-product__link:focus,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-product__link:focus,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-category__link:hover,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-category__link:hover,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-category__link:hover,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-category__link:active,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-category__link:active,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-category__link:active,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .woocommerce-loop-category__link:focus,
    html body .offcanvas .dmm-mega-menu-wrapper .woocommerce-loop-category__link:focus,
    html body .dmm-mega-menu-wrapper .woocommerce-loop-category__link:focus,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .products .product a:hover,
    html body .offcanvas .dmm-mega-menu-wrapper .products .product a:hover,
    html body .dmm-mega-menu-wrapper .products .product a:hover,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .products .product a:active,
    html body .offcanvas .dmm-mega-menu-wrapper .products .product a:active,
    html body .dmm-mega-menu-wrapper .products .product a:active,
    html body .dmm-offcanvas-drawer .dmm-mega-menu-wrapper .products .product a:focus,
    html body .offcanvas .dmm-mega-menu-wrapper .products .product a:focus,
    html body .dmm-mega-menu-wrapper .products .product a:focus,
    html body .dmm-offcanvas-drawer li.menu-item-has-children > a:hover,
    html body .offcanvas li.menu-item-has-children > a:hover,
    html body .dmm-mega-menu-wrapper li.menu-item-has-children > a:hover,
    html body .dmm-offcanvas-drawer li.menu-item-has-children > a:active,
    html body .offcanvas li.menu-item-has-children > a:active,
    html body .dmm-mega-menu-wrapper li.menu-item-has-children > a:active,
    html body .dmm-offcanvas-drawer li.menu-item-has-children > a:focus,
    html body .offcanvas li.menu-item-has-children > a:focus,
    html body .dmm-mega-menu-wrapper li.menu-item-has-children > a:focus,
    html body .dmm-offcanvas-drawer ul li.menu-item-has-children > a:hover,
    html body .offcanvas ul li.menu-item-has-children > a:hover,
    html body .dmm-mega-menu-wrapper ul li.menu-item-has-children > a:hover,
    html body .dmm-offcanvas-drawer ul li.menu-item-has-children > a:active,
    html body .offcanvas ul li.menu-item-has-children > a:active,
    html body .dmm-mega-menu-wrapper ul li.menu-item-has-children > a:active,
    html body .dmm-offcanvas-drawer ul li.menu-item-has-children > a:focus,
    html body .offcanvas ul li.menu-item-has-children > a:focus,
    html body .dmm-mega-menu-wrapper ul li.menu-item-has-children > a:focus {
        color: #ff0000 !important;
    }
    
    .dmm-offcanvas-drawer li.dmm-has-mega-menu.dmm-mobile-open > .dmm-mega-menu-wrapper,
    .offcanvas li.dmm-has-mega-menu.dmm-mobile-open > .dmm-mega-menu-wrapper,
    li.dmm-has-mega-menu.dmm-mobile-open > .dmm-mega-menu-wrapper {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Reset absolute positioning, min-width, and animations on mobile viewports so dropdown fits inside drawer */
    .dmm-mega-menu-wrapper,
    .dmm-offcanvas-drawer .dmm-mega-menu-wrapper,
    .offcanvas .dmm-mega-menu-wrapper {
        position: static !important;
        min-width: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        float: none !important;
    }
    /* Make columns stack vertically full-width on mobile viewports */
    .dmm-column-frontend,
    .dmm-offcanvas-drawer .dmm-column-frontend,
    .offcanvas .dmm-column-frontend {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 15px;
    }

    /* Optimize mega menu inner container padding on mobile viewports to prevent overflow */
    .dmm-mega-menu-inner {
        padding: 15px 10px !important;
    }

    /* Make WooCommerce products full-width inside product grids on mobile viewports */
    .dmm-woo-grid-container ul.products li.product,
    .dmm-woo-cat-grid-container ul.products li.product,
    .dmm-offcanvas-drawer .dmm-woo-grid-container ul.products li.product,
    .dmm-offcanvas-drawer .dmm-woo-cat-grid-container ul.products li.product,
    .offcanvas .dmm-woo-grid-container ul.products li.product,
    .offcanvas .dmm-woo-cat-grid-container ul.products li.product {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .dmm-offcanvas-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }
    body.dmm-offcanvas-open .dmm-offcanvas-overlay {
        opacity: 1;
        visibility: visible;
    }

    /* Formats widgets and lists inside top bar mobile drawer vertically */
    .mobile-topbar-menu .widget {
        display: block !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 20px !important;
        float: none !important;
    }
    .mobile-topbar-menu .widget_nav_menu ul {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
    }
    .mobile-topbar-menu .widget_nav_menu ul li {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        float: none !important;
    }
    .mobile-topbar-menu .widget_nav_menu ul li a {
        display: block !important;
        padding: 10px 0 !important;
        color: #333 !important;
        font-size: 15px !important;
        font-weight: 500 !important;
        border-bottom: 1px solid #f0f0f0 !important;
        text-decoration: none !important;
    }
}

/* =========================================================
   15. AJAX Live Search
   ========================================================= */
.dmm-live-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 10px 0;
}
.dmm-live-search-form {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}
.dmm-search-cat-wrapper { border-right: 1px solid #ddd; background: #f9f9f9; }
.dmm-search-category {
    border: none;
    background: transparent;
    padding: 10px;
    outline: none;
    cursor: pointer;
    color: #555;
    font-size: 13px;
}
.dmm-search-input-wrapper { flex: 1; display: flex; align-items: center; position: relative; }
.dmm-live-search-input {
    border: none;
    width: 100%;
    padding: 10px 14px;
    outline: none;
    font-size: 14px;
}
.dmm-search-btn { background: transparent; border: none; padding: 10px 14px; color: #666; cursor: pointer; }
.dmm-search-spinner { position: absolute; right: 40px; color: #999; }
.dmm-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    z-index: 99999;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
}
.dmm-search-results ul { list-style: none; margin: 0; padding: 0; }
.dmm-search-results li a {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}
.dmm-search-results li a:hover { background: #f9f9f9; }
.dmm-search-results li img { width: 46px; height: 46px; object-fit: cover; border-radius: 4px; margin-right: 12px; flex-shrink: 0; }
.dmm-search-item-info h5 { margin: 0 0 4px; font-size: 13px; color: #333; line-height: 1.3; }
.dmm-search-item-info .price { font-size: 12px; color: #2271b1; font-weight: 700; }
.dmm-no-results { padding: 15px; text-align: center; color: #777; font-size: 13px; }

/* =========================================================
   Item Icon Support (title, link, post, category, woo_category)
   ========================================================= */
.dmm-item-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    flex-shrink: 0;
    line-height: 1;
}

/* Title with icon — use flex for alignment */
.dmm-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.dmm-title .dmm-title-text {
    flex: 1 1 auto;
}

/* Custom link with icon — use flex for alignment */
.dmm-custom-link {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.dmm-custom-link .dmm-link-text {
    flex: 1 1 auto;
}

/* Post title link with icon */
.dmm-post-title a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

/* Dashicons inside mega menu item icons need a fixed size */
.dmm-mega-menu-wrapper .dmm-item-icon.dashicons {
    width: 1em;
    height: 1em;
    font-size: inherit;
}
