/**
 * Mobile UI Enhancements for QuickStore/OpenCart 3.x
 * Additive CSS - does not modify existing desktop styles
 * All rules scoped to @media (max-width: 767px) unless noted
 * Version: 5.0 - Fix stacking context: menu panel moved to body level via JS
 */

/* ==========================================================================
   DEFAULT STATES (all viewports) - Hidden by default
   ========================================================================== */

.mobile-header-controls {
    display: none;
}

.mobile-hamburger {
    display: none;
}

.mobile-cart-btn {
    display: none;
}

.mobile-search-bar {
    display: none;
}

.menu-overlay,
.cart-overlay,
.menu-close,
.cart-close {
    display: none;
}

.mobile-cart-panel {
    display: none;
}

.mobile-search-suggestions {
    display: none;
}


/* ==========================================================================
   1. MOBILE HEADER CONTROLS (Login + Language + Currency)
   Replaces bank account info on mobile xs only
   ========================================================================== */

@media (max-width: 767px) {
    .mobile-header-controls {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 6px 15px;
        box-sizing: border-box;
        position: relative;
        z-index: 1001;
    }

    .mobile-header-controls .mobile-left {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .mobile-header-controls .mobile-right {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    /* Login link */
    .mobile-header-controls .mobile-login a {
        color: #fff;
        font-size: 13px;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        white-space: nowrap;
        padding: 4px 0;
        min-height: 32px;
    }

    .mobile-header-controls .mobile-login a:hover {
        color: #ccc;
    }

    .mobile-header-controls .mobile-login .fa {
        font-size: 15px;
    }

    /* ---- Mobile Language/Currency custom dropdowns ---- */
    .mobile-header-controls .mobile-lang-curr {
        display: inline-flex !important;
        align-items: center;
        gap: 6px;
        flex-direction: row !important;
    }

    .mobile-lang-dropdown,
    .mobile-curr-dropdown {
        position: relative;
        display: inline-block;
    }

    .mobile-lang-btn,
    .mobile-curr-btn {
        color: #fff !important;
        font-size: 12px;
        padding: 4px 6px !important;
        text-decoration: none;
        background: transparent !important;
        border: none !important;
        line-height: 1.2;
        cursor: pointer;
        font-family: 'Rubik', sans-serif !important;
        font-weight: 400 !important;
        white-space: nowrap;
    }

    .mobile-lang-btn img {
        vertical-align: middle;
        margin-right: 3px;
    }

    .mobile-lang-btn .fa,
    .mobile-curr-btn .fa {
        margin-left: 3px;
        font-size: 10px;
    }

    .mobile-lang-btn:hover,
    .mobile-curr-btn:hover {
        color: #ccc !important;
    }

    .mobile-lang-menu,
    .mobile-curr-menu {
        display: none;
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        z-index: 10000 !important;
        background: #fff !important;
        border: 1px solid #ddd !important;
        border-radius: 4px !important;
        box-shadow: 0 3px 12px rgba(0,0,0,0.15) !important;
        padding: 4px 0 !important;
        margin: 2px 0 0 0 !important;
        min-width: 140px !important;
        max-width: 200px !important;
        list-style: none !important;
    }

    .mobile-lang-menu li,
    .mobile-curr-menu li {
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    .mobile-lang-menu li a,
    .mobile-curr-menu li a {
        color: #333 !important;
        font-size: 13px !important;
        padding: 8px 14px !important;
        display: block !important;
        text-decoration: none !important;
        white-space: nowrap;
    }

    .mobile-lang-menu li a img {
        vertical-align: middle;
        margin-right: 5px;
    }

    .mobile-lang-menu li a:hover,
    .mobile-curr-menu li a:hover {
        background: #f5f5f5 !important;
    }

    /* Hide desktop header nav content on mobile */
    .header_nav .left-nav,
    .header_nav .right-nav {
        display: none !important;
    }

    .header_nav .container {
        padding: 0;
    }

    .header_nav .row {
        margin: 0;
        display: block;
    }

    .header_nav {
        z-index: 1000;
    }

    /* Font consistency */
    .mobile-header-controls,
    .mobile-header-controls .mobile-login a {
        font-family: 'Rubik', sans-serif !important;
        font-weight: 400 !important;
    }

    .mobile-header-controls .mobile-login a {
        text-transform: none !important;
        letter-spacing: normal !important;
    }
}


/* ==========================================================================
   2. MOBILE HAMBURGER BUTTON (left side of header_top)
   ========================================================================== */

@media (max-width: 767px) {
    .mobile-hamburger {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 40px;
        cursor: pointer;
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 200;
        padding: 8px;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-hamburger span {
        display: block;
        width: 22px;
        height: 2px;
        background: #fff;
        margin: 3px 0;
        border-radius: 1px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    /* Hamburger X state */
    body.menu-open .mobile-hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(4px, 4px);
    }
    body.menu-open .mobile-hamburger span:nth-child(2) {
        opacity: 0;
    }
    body.menu-open .mobile-hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(4px, -4px);
    }

    /* Shift logo right to make room for hamburger.
       Use text-align + margin instead of padding to avoid squeezing the logo. */
    .header_top .header-logo {
        padding-left: 0 !important;
        text-align: center !important;
    }

    .header_top .header-logo #logo {
        display: inline-block;
        margin-left: 10px;
        margin-right: 40px;
    }

    .header_top .header-logo #logo img {
        max-width: 140px !important;
        height: auto !important;
        width: auto !important;
    }

    /* Hide the WD-panel-heading toggle on mobile (we use our hamburger) */
    .WD-panel-heading {
        display: none !important;
    }
}


/* ==========================================================================
   3. MOBILE CART BUTTON (right side of header_top)
   ========================================================================== */

@media (max-width: 767px) {
    .mobile-search-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        cursor: pointer;
        position: absolute;
        right: 50px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 200;
        color: #fff;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-search-toggle .fa {
        font-size: 18px;
    }

    .mobile-search-toggle.search-active {
        color: #4db8ff;
    }

    .mobile-cart-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        cursor: pointer;
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 200;
        color: #fff;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-cart-btn .fa {
        font-size: 20px;
    }

    .mobile-cart-badge {
        position: absolute;
        top: 2px;
        right: 0;
        background: #e74c3c;
        color: #fff;
        font-size: 10px;
        font-weight: 600;
        min-width: 16px;
        height: 16px;
        line-height: 16px;
        text-align: center;
        border-radius: 50%;
        padding: 0 3px;
        display: none;
    }

    .mobile-cart-badge.has-items {
        display: block;
    }

    /* Hide the desktop cart and search icons on mobile */
    .header_cart {
        display: none !important;
    }

    .header_search {
        display: none !important;
    }

    /* Header_top needs relative positioning for the absolute buttons */
    #header_top .row {
        position: relative;
    }
}


/* ==========================================================================
   4. SLIDE-OUT MOBILE MENU (from left) - xs only
   Overlays + menu panel are at <body> level (JS moves panel out of
   #header_top stacking context) so z-indexes work correctly.
   ========================================================================== */

@media (max-width: 767px) {
    /* Overlay backgrounds - at body level for proper stacking */
    .menu-overlay,
    .cart-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        pointer-events: none;
    }

    .menu-overlay.active,
    .cart-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* ===== Standard Menu Slide Panel ===== */
    #menu .nav.navbar-nav {
        position: fixed !important;
        top: 0 !important;
        left: -280px !important;
        width: 280px !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: #fff !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 60px 15px 20px !important;
        margin: 0 !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
        display: block !important;
    }

    #menu .nav.navbar-nav.menu-open {
        left: 0 !important;
    }

    /* ===== WD Megamenu Slide Panel (original position, before JS moves it) ===== */
    .main-category-list .wd-menu .ul-top-items {
        position: fixed !important;
        top: 0 !important;
        left: -280px !important;
        width: 280px !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: #fff !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 60px 15px 20px !important;
        margin: 0 !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
        display: block !important;
    }

    .main-category-list .wd-menu .ul-top-items.menu-open {
        left: 0 !important;
    }

    /* ===== Slide Panel after JS moves it to <body> level ===== */
    body > .ul-top-items.mobile-slide-panel,
    body > .nav.navbar-nav.mobile-slide-panel {
        position: fixed !important;
        top: 0 !important;
        left: -280px !important;
        width: 280px !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: #fff !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 60px 15px 20px !important;
        margin: 0 !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
        display: block !important;
        list-style: none !important;
    }

    body > .ul-top-items.mobile-slide-panel.menu-open,
    body > .nav.navbar-nav.mobile-slide-panel.menu-open {
        left: 0 !important;
    }

    /* Menu items styling when panel is at body level */
    body > .ul-top-items.mobile-slide-panel > li.li-top-item {
        border-bottom: 1px solid #eee;
        width: 100%;
        float: none !important;
        list-style: none;
        position: relative;
    }

    body > .ul-top-items.mobile-slide-panel > li.li-top-item > a {
        padding: 12px 35px 12px 0 !important;
        color: #333 !important;
        font-size: 14px;
        display: block;
        width: 100%;
        text-decoration: none;
    }

    body > .ul-top-items.mobile-slide-panel > li.li-top-item > a:hover {
        color: #2563eb !important;
    }

    /* Hide original material-icons arrows if they exist */
    body > .ul-top-items.mobile-slide-panel > li.li-top-item > i.material-icons {
        display: none !important;
    }

    /* Submenu toggle button (JS-created) */
    body > .ul-top-items.mobile-slide-panel > li.li-top-item > .submenu-toggle {
        position: absolute !important;
        right: 0 !important;
        top: 0 !important;
        width: 44px !important;
        height: 44px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #999;
        font-size: 14px;
        transition: transform 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    body > .ul-top-items.mobile-slide-panel > li.li-top-item > .submenu-toggle.submenu-open {
        transform: rotate(180deg);
        color: #2563eb;
    }

    /* Subcategory containers: hidden by default, toggled via JS */
    body > .ul-top-items.mobile-slide-panel > li.li-top-item > .mega-menu-container {
        display: none;
        position: static !important;
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        background: #f9f9f9 !important;
        padding: 0 0 0 15px !important;
        margin: 0 !important;
        float: none !important;
    }

    body > .ul-top-items.mobile-slide-panel > li.li-top-item > .mega-menu-container.submenu-open {
        display: block !important;
    }

    /* Subcategory link styling */
    body > .ul-top-items.mobile-slide-panel .mega-menu-container a {
        display: block !important;
        padding: 8px 0 !important;
        color: #555 !important;
        font-size: 13px !important;
        text-decoration: none !important;
        border-bottom: 1px solid #eee;
    }

    body > .ul-top-items.mobile-slide-panel .mega-menu-container a:hover {
        color: #2563eb !important;
    }

    /* Hide deep nesting containers, images, etc in submenus */
    body > .ul-top-items.mobile-slide-panel .mega-menu-container .container {
        width: 100% !important;
        padding: 0 !important;
    }

    body > .ul-top-items.mobile-slide-panel .mega-menu-container .sub_item3-content,
    body > .ul-top-items.mobile-slide-panel .mega-menu-container .row {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        float: none !important;
    }

    body > .ul-top-items.mobile-slide-panel .mega-menu-container img,
    body > .ul-top-items.mobile-slide-panel .mega-menu-container .sub-cate-img {
        display: none !important;
    }

    /* Fix stacking context ONLY for the slide panel (fallback if JS hasn't run) */
    .main-category-list .wd-menu {
        position: static !important;
        z-index: auto !important;
    }

    .main-category-list {
        position: static !important;
        z-index: auto !important;
    }

    /* Menu close button - top:60px to sit below header_nav (52px tall) */
    .menu-close {
        display: none;
        position: fixed;
        top: 60px;
        left: 240px;
        width: 35px;
        height: 35px;
        cursor: pointer;
        z-index: 10000;
        background: #f5f5f5;
        border-radius: 50%;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease 0.15s, visibility 0.3s ease 0.15s;
        min-width: 44px;
        min-height: 44px;
    }

    .menu-close.active {
        display: block;
        opacity: 1;
        visibility: visible;
    }

    .menu-close:before,
    .menu-close:after {
        content: '';
        position: absolute;
        width: 18px;
        height: 2px;
        background: #333;
        top: 50%;
        left: 50%;
    }

    .menu-close:before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .menu-close:after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    /* Prevent body scroll when menu or cart is open */
    body.menu-open,
    body.cart-open {
        overflow: hidden !important;
    }

    /* Menu item styling */
    #menu .nav.navbar-nav > li {
        border-bottom: 1px solid #eee;
        width: 100%;
        float: none !important;
    }

    #menu .nav.navbar-nav > li > a {
        padding: 12px 0 !important;
        color: #333 !important;
        font-size: 14px;
        display: flex;
        align-items: center;
        min-height: 44px;
        width: 100%;
    }

    #menu .nav.navbar-nav > li > a:hover {
        color: #2563eb !important;
    }

    #menu.responsive-menu .nav.navbar-nav {
        display: block !important;
    }

    /* WD Megamenu item styling */
    .main-category-list .wd-menu .ul-top-items > li.li-top-item {
        border-bottom: 1px solid #eee;
        width: 100%;
        float: none !important;
        list-style: none;
        position: relative;
    }

    .main-category-list .wd-menu .ul-top-items > li.li-top-item > a {
        padding: 12px 35px 12px 0 !important;
        color: #333 !important;
        font-size: 14px;
        display: block;
        width: 100%;
        text-decoration: none;
    }

    .main-category-list .wd-menu .ul-top-items > li.li-top-item > a:hover {
        color: #2563eb !important;
    }

    /* Hide material icons if they exist in menu */
    .main-category-list .wd-menu .ul-top-items > li.li-top-item > i.material-icons {
        display: none !important;
    }

    /* Mobile menu separator + extra links (Akce, Novinky, Aukce) */
    .mobile-slide-panel > li.mobile-menu-separator {
        list-style: none !important;
        height: 0 !important;
        background: none !important;
        margin: 8px 0 !important;
        padding: 0 !important;
        border: none !important;
        border-top: 1px solid #e0e0e0 !important;
        border-bottom: none !important;
    }

    /* Remove border-bottom from the item just before separator */
    .mobile-slide-panel > li.mobile-menu-separator + li.mobile-extra-link {
        border-top: none !important;
    }

    .mobile-slide-panel > li.mobile-extra-link {
        border-bottom: 1px solid #f0f0f0 !important;
    }

    .mobile-slide-panel > li.mobile-extra-link:last-child {
        border-bottom: none !important;
    }

    .mobile-slide-panel > li.mobile-extra-link > a {
        display: flex !important;
        align-items: center !important;
        padding: 12px 0 !important;
        color: #333 !important;
        font-size: 14px !important;
        text-decoration: none !important;
    }

    .mobile-slide-panel > li.mobile-extra-link > a .fa {
        width: 22px !important;
        text-align: center !important;
        margin-right: 8px !important;
        color: #2563eb !important;
        font-size: 15px !important;
    }

    /* Subcategory containers: hidden by default, toggled via JS */
    .main-category-list .wd-menu .ul-top-items > li.li-top-item > .mega-menu-container {
        display: none;
        position: static !important;
        width: 100% !important;
        box-shadow: none !important;
    }

    .main-category-list .wd-menu .ul-top-items > li.li-top-item > .mega-menu-container.submenu-open {
        display: block !important;
    }

    /* Hide the desktop headertop visually but keep megamenu slide panel accessible.
       Use height:0 + overflow:visible so fixed-position children still render. */
    .headertop {
        height: 0 !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    .headertop .cat-menu {
        height: 0 !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}


/* ==========================================================================
   5. SLIDE-OUT CART PANEL (from right) - xs only
   ========================================================================== */

@media (max-width: 767px) {
    .mobile-cart-panel {
        display: flex !important;
        flex-direction: column !important;
        position: fixed;
        top: 0;
        right: -320px;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        background: #fff;
        z-index: 9999;
        overflow: hidden !important;
        padding: 20px 15px 0;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.15);
    }

    .mobile-cart-panel.cart-open {
        right: 0;
    }

    /* Cart close button */
    .cart-close {
        display: none;
        position: fixed;
        top: 15px;
        right: 285px;
        width: 35px;
        height: 35px;
        cursor: pointer;
        z-index: 10000;
        background: #f5f5f5;
        border-radius: 50%;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease 0.15s, visibility 0.3s ease 0.15s;
        min-width: 44px;
        min-height: 44px;
    }

    .cart-close.active {
        display: block;
        opacity: 1;
        visibility: visible;
    }

    .cart-close:before,
    .cart-close:after {
        content: '';
        position: absolute;
        width: 18px;
        height: 2px;
        background: #333;
        top: 50%;
        left: 50%;
    }

    .cart-close:before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .cart-close:after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    /* Cart panel content styling */
    .mobile-cart-panel .cart-panel-title {
        font-family: 'Rubik', sans-serif;
        font-size: 18px;
        font-weight: 600;
        color: #111;
        margin: 0 0 0 0;
        padding: 10px 0 15px;
        border-bottom: 2px solid #eee;
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0 !important;
    }

    .mobile-cart-panel .cart-panel-title .fa {
        color: #2563eb;
    }

    .mobile-cart-panel .cart-item {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-cart-panel .cart-item img {
        width: 60px;
        height: 60px;
        object-fit: contain;
        border-radius: 4px;
        border: 1px solid #eee;
        flex-shrink: 0;
    }

    .mobile-cart-panel .cart-item-info {
        flex: 1;
        min-width: 0;
    }

    .mobile-cart-panel .cart-item-name {
        font-size: 13px;
        color: #333;
        line-height: 1.3;
        margin-bottom: 4px;
    }

    .mobile-cart-panel .cart-item-name a {
        color: #333;
        text-decoration: none;
    }

    .mobile-cart-panel .cart-item-price {
        font-size: 14px;
        font-weight: 600;
        color: #111;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .mobile-cart-panel .cart-item-qty {
        font-size: 12px;
        font-weight: 500;
        color: #666;
        background: #f0f0f0;
        border-radius: 4px;
        padding: 1px 5px;
        white-space: nowrap;
    }

    .mobile-cart-panel .cart-item-remove {
        width: 28px;
        height: 28px;
        border: none;
        background: #f5f5f5;
        border-radius: 50%;
        color: #999;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .mobile-cart-panel .cart-totals {
        margin-top: 15px;
        border-top: 2px solid #eee;
        padding-top: 12px;
    }

    .mobile-cart-panel .cart-total-row {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
        font-size: 14px;
        color: #333;
    }

    .mobile-cart-panel .cart-action-btn {
        display: block;
        width: 100%;
        padding: 14px;
        margin-top: 15px;
        background: #2563eb;
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 15px;
        font-weight: 600;
        font-family: 'Rubik', sans-serif;
        text-align: center;
        text-decoration: none;
        cursor: pointer;
    }

    .mobile-cart-panel .cart-action-btn:hover {
        background: #0057a8;
        color: #fff;
    }

    .mobile-cart-panel .cart-empty {
        text-align: center;
        padding: 40px 15px;
        color: #999;
        font-size: 14px;
    }

    /* Scrollable cart items area */
    .mobile-cart-panel .cart-items-scroll {
        flex: 1 1 0% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        min-height: 0 !important;
    }

    /* Sticky footer with totals + button — always visible at bottom */
    .mobile-cart-panel .cart-panel-footer {
        flex-shrink: 0 !important;
        padding: 10px 0 20px;
        background: #fff;
        border-top: 2px solid #eee;
        margin-top: auto;
    }

    .mobile-cart-panel .cart-panel-footer .cart-totals {
        margin-top: 0;
        border-top: none;
        padding-top: 0;
    }

    .mobile-cart-panel .cart-empty .fa {
        font-size: 40px;
        color: #ddd;
        display: block;
        margin-bottom: 15px;
    }
}


/* ==========================================================================
   6. SEARCH BOX MOBILE + LIVE SEARCH SUGGESTIONS
   ========================================================================== */

@media (max-width: 767px) {
    .mobile-search-bar {
        display: block !important;
        width: 100% !important;
        padding: 0 12px !important;
        background: #222;
        box-sizing: border-box !important;
        position: fixed;
        top: 117px;
        left: 0;
        right: 0;
        z-index: 99;
        overflow: hidden !important;
        max-height: 0 !important;
        opacity: 0 !important;
        transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease !important;
    }

    .mobile-search-bar.search-open {
        max-height: 60px !important;
        opacity: 1 !important;
        padding: 8px 12px !important;
        overflow: visible !important;
    }

    .mobile-search-bar .input-group {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        position: relative;
        box-sizing: border-box !important;
    }

    .mobile-search-bar input.form-control {
        flex: 1 !important;
        min-width: 0 !important;
        width: auto !important;
        max-width: none !important;
        height: 36px;
        font-size: 14px;
        padding: 6px 12px;
        border: none;
        border-radius: 6px 0 0 6px;
        background: #fff;
        color: #333;
        -webkit-appearance: none;
        box-sizing: border-box !important;
    }

    .mobile-search-bar input.form-control:focus {
        outline: none;
        box-shadow: none;
    }

    .mobile-search-bar .input-group-btn {
        display: flex !important;
        flex-shrink: 0 !important;
        width: 42px !important;
    }

    .mobile-search-bar .input-group-btn button {
        height: 36px !important;
        width: 42px !important;
        min-width: 42px !important;
        border: none !important;
        background: #2563eb !important;
        color: #fff !important;
        border-radius: 0 6px 6px 0 !important;
        cursor: pointer;
        font-size: 15px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 0 !important;
    }

    /* Live search suggestions dropdown */
    .mobile-search-suggestions {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 10000 !important;
        background: #fff !important;
        border: 1px solid #ddd !important;
        border-top: none !important;
        border-radius: 0 0 6px 6px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
        max-height: 60vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
    }

    .mobile-search-suggestions.open {
        display: block !important;
    }

    .mobile-search-suggestions li {
        padding: 0 !important;
        margin: 0 !important;
        border-bottom: 1px solid #f0f0f0;
        list-style: none !important;
    }

    .mobile-search-suggestions li:last-child {
        border-bottom: none;
    }

    .mobile-search-suggestions li a {
        display: flex !important;
        align-items: center;
        gap: 10px;
        padding: 10px 12px !important;
        color: #333 !important;
        text-decoration: none !important;
        font-size: 13px !important;
        line-height: 1.3;
    }

    .mobile-search-suggestions li a:hover,
    .mobile-search-suggestions li a:focus {
        background: #f5f7ff !important;
    }

    .mobile-search-suggestions li a img {
        width: 40px;
        height: 40px;
        object-fit: contain;
        border-radius: 3px;
        flex-shrink: 0;
    }

    .mobile-search-suggestions .search-item-info {
        flex: 1;
        min-width: 0;
    }

    .mobile-search-suggestions .search-item-name {
        display: block;
        color: #333;
        font-size: 13px;
        line-height: 1.3;
    }

    .mobile-search-suggestions .search-item-price {
        display: block;
        color: #2563eb;
        font-size: 12px;
        font-weight: 600;
        margin-top: 2px;
    }

    .mobile-search-suggestions .search-view-all {
        display: block;
        text-align: center;
        padding: 10px !important;
        background: #f8f9fa;
        color: #2563eb !important;
        font-weight: 600;
        font-size: 13px !important;
        border-top: 1px solid #eee;
    }

    .mobile-search-suggestions .search-loading {
        text-align: center;
        padding: 15px !important;
        color: #999;
    }

    .mobile-search-suggestions .search-no-results {
        text-align: center;
        padding: 15px !important;
        color: #999;
        font-size: 13px;
    }

    /* Reset the theme's top:130px on #content and top:115px on breadcrumb.
       Theme uses position:relative + top to push content below fixed desktop headers.
       On mobile we replace this with margin/padding so flow is correct. */
    #content {
        top: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    #product-special {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* Breadcrumb: position:static with padding-top to clear fixed headers.
       Default (search hidden): header_nav(48) + header_top(71) = ~120px
       With search open: + search bar(52) = ~172px */
    .content-top-breadcum {
        position: static !important;
        top: auto !important;
        margin-top: 0 !important;
        padding-top: 120px !important;
        background: #eaedf2 !important;
        padding-bottom: 5px !important;
        margin-bottom: 5px !important;
        transition: padding-top 0.2s ease !important;
    }

    body.search-bar-open .content-top-breadcum {
        padding-top: 172px !important;
    }

    .content-top-breadcum .breadcrumb {
        background: transparent !important;
        margin: 0 !important;
        padding: 6px 15px !important;
        font-size: 12px !important;
    }

    .content-top-breadcum .breadcrumb a {
        color: #555 !important;
    }

    .content-top-breadcum .breadcrumb > li + li::before {
        color: #888 !important;
    }

    /* Homepage: breadcrumb is hidden, so push the main content down */
    .common-home .content-top-breadcum {
        display: none !important;
    }

    /* For homepage, push main content area below fixed headers */
    .common-home #product-special,
    .common-home .main-slider,
    .common-home .content_header_top {
        margin-top: 120px !important;
        transition: margin-top 0.2s ease !important;
    }
    body.search-bar-open .common-home #product-special,
    body.search-bar-open .common-home .main-slider,
    body.search-bar-open .common-home .content_header_top {
        margin-top: 165px !important;
    }

    /* #product-special: reset any leftover theme offsets */
    #product-special {
        padding-top: 0;
    }

    /* Also hide desktop live search on mobile (we use our own) */
    .live-search {
        display: none !important;
    }
}


/* ==========================================================================
   7. COLUMN-LEFT SIDEBAR - MINIMAL OVERRIDES
   Only fix critical overlap, preserve theme's styling (blue border, positioning)
   ========================================================================== */

@media (max-width: 767px) {
    /* The theme sets position:relative;top:50-100px on mobile for #column-left.
       This is intentional (compensates for JS-moved sidebar position).
       We do NOT override it. We only ensure it doesn't create horizontal overflow. */
    #column-left,
    #column-right {
        max-width: 100% !important;
        overflow-x: hidden;
    }

    /* Reduce the large top offset on the sidebar - theme sets 50-100px but
       with our fixed header layout, it creates excessive gap */
    .layout-2.left-col #column-left,
    .layout-2.right-col #column-right {
        top: 0px !important;
    }

    /* Ensure product grid doesn't have weird top offset */
    .row.cat_prod {
        clear: both;
    }
}


/* ==========================================================================
   8. PRODUCT CARD SPACING
   ========================================================================== */

@media (max-width: 767px) {
    .product-layout {
        padding-left: 5px !important;
        padding-right: 5px !important;
        box-sizing: border-box;
    }

    .product-block.product-thumb {
        margin-bottom: 10px;
        overflow: hidden;
    }

    .product-thumb .image img {
        max-width: 100%;
        height: auto;
    }

    .row.cat_prod {
        margin-left: -5px;
        margin-right: -5px;
    }
}


/* ==========================================================================
   9. CATEGORY THUMBNAIL FIX
   ========================================================================== */

@media (max-width: 767px) {
    .category_img,
    .col-xs-3.category_img {
        padding-left: 10px !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .category_img img {
        width: auto !important;
        height: auto !important;
        max-width: 70px;
        max-height: 70px;
        object-fit: contain;
    }

    .category_details h2.page-title,
    .col-xs-9.category_details h2 {
        font-size: 18px !important;
        line-height: 24px !important;
        margin: 0 0 8px 0;
    }

    .row.category_thumb {
        margin-left: 0;
        margin-right: 0;
        padding: 10px;
        height: auto !important;
        overflow: visible !important;
        background: linear-gradient(135deg, #f8f9fc 0%, #eef1f8 100%);
        border-radius: 8px;
    }

    /* Ensure .category_thumb properly contains subcategory list */
    .category_thumb .title-description {
        overflow: visible !important;
        height: auto !important;
    }

    .col-xs-9.category_details {
        padding-left: 10px;
    }

    /* Aside (#column-left) spacing — clear subcategories properly */
    #content > aside,
    #content > #column-left,
    #content > .col-sm-3.hidden-xs {
        clear: both !important;
        margin-top: 15px !important;
    }
}


/* ==========================================================================
   10. HERO BANNER MOBILE RESPONSIVENESS
   ========================================================================== */

@media (max-width: 991px) {
    .main-slider {
        width: 100% !important;
        overflow: hidden !important;
    }

    .main-slider .swiper-container,
    .main-slider .swiper-viewport {
        width: 100% !important;
        overflow: hidden !important;
    }

    .main-slider .swiper-slide img,
    .swiper-container .swiper-slide img {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        object-fit: cover !important;
        object-position: center center !important;
    }

    .main-slider .swiper-slide {
        width: 100% !important;
    }

    .main-slider .swiper-wrapper {
        width: 100% !important;
    }
}

@media (max-width: 767px) {
    /* ---- Banner / Swiper — match production znamky.cz mobile exactly ---- */
    /* Let Swiper handle slide positioning & fade natively — no overrides */

    .main-slider .swiper-slide img,
    .swiper-container .swiper-slide img {
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .main-slider .swiper-viewport {
        overflow: hidden !important;
    }

    /* Slider text overlay — no gradient, flex centered vertically, positioned like production */
    .main-slider .slider-content {
        display: flex !important;
        position: absolute !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 8% !important;
        right: 36% !important;
        width: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
        background: none !important;
        text-align: left !important;
        box-sizing: border-box !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 2 !important;
        align-items: center !important;
    }

    .main-slider .slider-content .main-carousel-content {
        display: block !important;
    }

    .main-slider .slider-content h2,
    .main-slider .slider-content h3,
    .main-slider .slider-content .title,
    .main-slider .slider-content .slider-title {
        font-family: 'Rubik', sans-serif !important;
        font-size: 17px !important;
        font-weight: 500 !important;
        margin: 0 0 5px 0 !important;
        color: #111 !important;
        line-height: 20px !important;
        text-shadow: none !important;
    }

    /* Hide subtitle and description on mobile — matches production */
    .main-slider .slider-content .slider-details,
    .main-slider .slider-content .slider-description {
        display: none !important;
    }

    .main-slider .slider-content .slider-buttons {
        display: flex !important;
        gap: 8px !important;
        margin-top: 0 !important;
    }

    .main-slider .slider-content .slider-button a {
        font-family: 'Rubik', sans-serif !important;
        font-size: 11px !important;
        font-weight: 500 !important;
        padding: 4px 12px !important;
        display: inline-block !important;
        border-radius: 25px !important;
        color: #fff !important;
        background: rgb(0, 104, 201) !important;
        text-decoration: none !important;
        border: none !important;
    }

    .main-slider .slider-content .slider-button1 {
        display: none !important;
    }

    /* ---- HP section headings — unified Rubik 18px/500 ---- */
    .box-heading,
    .box .box-heading,
    #content .box-heading {
        font-family: 'Rubik', sans-serif !important;
        font-size: 18px !important;
        font-weight: 500 !important;
        color: #111 !important;
        line-height: 1.2 !important;
        margin-bottom: 12px !important;
        text-transform: none !important;
        letter-spacing: normal !important;
    }

    /* ---- HP content sections — consistent spacing ---- */
    .content-top .box,
    .content-bottom .box,
    #content .box {
        margin-bottom: 20px !important;
    }

    .content-top .container,
    .content-bottom .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* ---- HP product cards — unified font sizing ---- */
    .product-thumb h4,
    .product-thumb h4 a,
    .product-thumb .name,
    .product-thumb .name a {
        font-family: 'Rubik', sans-serif !important;
        font-size: 13px !important;
        font-weight: 400 !important;
        line-height: 1.3 !important;
        color: #111 !important;
    }

    .product-thumb .price,
    .product-thumb .price-new {
        font-family: 'Rubik', sans-serif !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #111 !important;
    }

    .product-thumb .price-old {
        font-family: 'Rubik', sans-serif !important;
        font-size: 12px !important;
        font-weight: 400 !important;
        color: #999 !important;
    }

    .product-thumb .cart_button,
    .product-thumb .button-group button {
        font-family: 'Rubik', sans-serif !important;
        font-size: 12px !important;
        font-weight: 500 !important;
    }
}


/* ==========================================================================
   11. PAGE-SPECIFIC FIXES
   ========================================================================== */

@media (max-width: 767px) {
    /* Account, checkout pages that use top offset from theme */
    #account-login,
    #account-register,
    #account-account,
    #account-edit,
    #account-password,
    #account-address,
    #account-wishlist,
    #account-order,
    #account-newsletter,
    #account-recurring,
    #account-reward,
    #account-transaction,
    #account-return,
    #account-voucher,
    [id^="account-"],
    #checkout-checkout,
    #checkout-cart {
        position: static !important;
        top: auto !important;
        margin-top: 0 !important;
        margin-bottom: 30px !important;
    }

    /* Ensure white background for main content areas */
    #product-special > .container > .row {
        background: #fff;
    }

    /* Fix body background showing through on pages */
    body {
        background-color: #f5f5f5 !important;
    }

    /* Cart, checkout, and account pages: white background, not grey */
    body[class*="checkout-"] #product-special,
    body[class*="checkout-"] #content,
    body[class*="checkout-"] .content-top-breadcum + *,
    body[class*="account-"] #content,
    body[class*="account-"] #product-special,
    body[class*="account-"] .content-top-breadcum + * {
        background-color: #fff !important;
    }

    body[class*="checkout-"],
    body[class*="account-"] {
        background-color: #fff !important;
    }

    /* White content wrapper for account/checkout pages — high specificity to beat theme's #id #content selectors */
    body[class*="account-"] #content,
    body[class*="checkout-"] #content,
    [id^="account-"] #content,
    [id^="checkout-"] #content,
    #account-account #content,
    #account-edit #content,
    #account-password #content,
    #account-address #content,
    #account-wishlist #content,
    #account-order #content,
    #account-newsletter #content,
    #account-recurring #content,
    #account-reward #content,
    #account-transaction #content,
    #account-return #content,
    #account-voucher #content,
    #account-register #content,
    #account-login #content,
    #checkout-checkout #content,
    #checkout-cart #content,
    #information-information #content,
    #information-sitemap #content {
        background: #fff !important;
        padding: 15px 20px !important;
        margin: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
    }

    /* ---- FIX: Double arrow icons in slide menu ---- */
    body > .ul-top-items.mobile-slide-panel > li.li-top-item > a.a-top-link::after,
    body > .ul-top-items.mobile-slide-panel > li.li-top-item > a.a-top-link::before {
        display: none !important;
        content: none !important;
    }

    /* ---- FIX: Search bar z-index must be above header_top (100) ---- */
    .mobile-search-bar {
        z-index: 101 !important;
    }

    /* ---- FIX: Product page layout ---- */
    /* Theme sets #product-product { top: 200px } for desktop — zero it on mobile */
    #product-product {
        top: 0 !important;
        margin-bottom: 20px !important;
    }

    /* Product page: eliminate ALL gap between breadcrumbs and product image */
    .product-left .product-info,
    .product-info {
        padding: 0 !important;
        border: none !important;
        margin: 0 !important;
        min-height: 0 !important;
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
        position: static !important;
        top: auto !important;
    }

    .product-left .product-image,
    .product-left .left.product-image,
    .product-left .left.product-image.thumbnails,
    .product-info .thumbnails,
    .thumbnails {
        clear: none !important;
        top: 0 !important;
        position: static !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        float: none !important;
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow: visible !important;
    }

    .col-sm-4.product-left,
    .col-sm-8.product-left {
        margin-top: 0 !important;
        padding-top: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        position: static !important;
        top: auto !important;
        float: none !important;
    }

    /* Override deeply nested .product-info rules from theme bottom */
    .product-info .product-info {
        min-height: 0 !important;
        max-height: none !important;
        position: static !important;
        border: none !important;
        overflow: visible !important;
    }

    /* Kill pseudo-elements and ElevateZoom container gap */
    .product-info::before,
    .product-info::after {
        display: none !important;
        height: 0 !important;
    }

    .product-info .zoomContainer {
        display: none !important;
    }

    /* Breadcrumb to product row gap elimination */
    .productpage .row,
    #content.productpage > .row {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .productpage .breadcrumb {
        margin-bottom: 5px !important;
    }

    /* Override the theme image container fixed dimensions */
    .product-info .image {
        max-width: 100% !important;
        height: auto !important;
        margin: 0 !important;
    }

    .product-info .image .thumbnail {
        margin: 0 0 10px 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    /* Product image should be immediate, no hidden padding */
    .product-info .image img,
    #tmzoom {
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    /* Product right section */
    .col-sm-5.product-right {
        width: 100% !important;
        margin-top: 15px;
        overflow: hidden !important;
    }

    /* Child floats inside product-right must not collapse parent */
    .product-right .product-detail-left {
        float: none !important;
        width: 100% !important;
    }

    /* ---- FIX: Promo boxes - full width on mobile ---- */
    .product-promo-boxes {
        width: 100% !important;
        max-width: 100% !important;
    }

    .product-promo-box {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }

    .product-promo-box .subscription-content {
        gap: 8px !important;
        flex-wrap: wrap !important;
    }

    .product-promo-box .subscription-title {
        font-size: 12px !important;
    }

    .product-promo-box .subscription-desc {
        font-size: 10px !important;
    }

    .product-promo-box .btn-subscription {
        font-size: 11px !important;
        padding: 4px 10px !important;
    }

    /* ---- FIX: Specification table - full width on mobile ---- */
    #tab-specification .table,
    #tab-specification .table-bordered,
    .product-tab .table,
    .product-tab .table-bordered {
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed !important;
    }

    #tab-specification .table td,
    #tab-specification .table th {
        padding: 6px 8px !important;
        font-size: 13px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* ---- FIX: Product description table - full width & reduced padding ---- */
    .product-description {
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed !important;
    }

    .product-description td {
        padding: 4px 2px !important;
        font-size: 13px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    .productpage .description .product-description .description-right,
    .product-description .description-right {
        padding-left: 10px !important;
        word-break: break-word !important;
    }

    .product-description td span.desc {
        font-size: 12px !important;
        white-space: nowrap;
    }

    /* Product right side - full width on mobile */
    .col-sm-5.product-right {
        width: 100% !important;
        float: none !important;
        padding: 10px 0 0 !important;
    }

    .productpage .description {
        padding: 10px 0 !important;
    }

    #tab-specification .table td,
    .product-tab .table td {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        padding: 6px 8px !important;
        font-size: 13px !important;
    }

    /* First column (attribute name) - fixed narrow width */
    #tab-specification .table td:first-child {
        width: 35% !important;
    }

    /* Product tab area - full width on mobile */
    .product-tab,
    #tabs_info {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        padding: 0 5px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    /* Hide the spacer column before tabs */
    .product-tab ~ .col-sm-1,
    #tabs_info ~ .col-sm-1,
    .col-sm-1:empty {
        display: none !important;
    }

    /* Tab content padding */
    .product-tab .tab-content {
        padding: 10px !important;
        overflow-x: auto !important;
    }

    /* #wdcmsrightservices - product services box should fit mobile */
    #wdcmsrightservices {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }

    .wdproduct-services li {
        padding: 8px 0 !important;
    }

    .service-title {
        font-size: 13px !important;
        word-wrap: break-word !important;
    }

    /* ---- FIX: Product card width - 2-column grid ---- */
    .product-layout {
        width: 50% !important;
        max-width: 50% !important;
        box-sizing: border-box !important;
        float: left !important;
        display: block !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
        overflow: hidden !important;
    }

    .row.cat_prod {
        overflow: hidden;
        margin-left: -4px !important;
        margin-right: -4px !important;
    }

    .product-layout .product-block,
    .product-layout .product-thumb {
        max-width: 100% !important;
        overflow: hidden;
        box-sizing: border-box !important;
    }

    /* Constrain ALL inner elements to parent width */
    .product-layout .product-block-inner {
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .product-thumb .image {
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .product-thumb .image a {
        display: block !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .product-thumb .image img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .product-thumb .product-details,
    .product-thumb .caption {
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .product-thumb .product_hover_block,
    .product-thumb .action {
        max-width: 100% !important;
        overflow: hidden !important;
    }

    /* Ensure product card buttons don't overflow */
    .product-thumb .button-group button,
    .product-thumb .cart-button button,
    .product-thumb .cart-button a {
        max-width: 100% !important;
        overflow: hidden;
        text-overflow: ellipsis;
        box-sizing: border-box !important;
    }

    /* Product name/price text overflow protection */
    .product-thumb .name,
    .product-thumb .name a,
    .product-thumb .price {
        max-width: 100% !important;
        overflow: hidden;
        text-overflow: ellipsis;
        word-wrap: break-word;
    }

    /* ---- FIX: Znamky.cz+ price box on category cards ---- */
    .znamky-cat-preview,
    .znamky-cat-member {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 3px !important;
        padding: 3px 6px !important;
        font-size: 9px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .znamky-cat-label {
        font-size: 9px !important;
        white-space: normal !important;
    }

    .znamky-cat-price {
        font-size: 11px !important;
        white-space: nowrap !important;
    }

    /* On product page - znamky inline price */
    .znamky-product-inline {
        display: block !important;
        margin-left: 0 !important;
        margin-top: 6px !important;
        padding: 4px 8px !important;
        font-size: 12px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        word-wrap: break-word;
    }

    .znamky-product-inline .znamky-product-price {
        font-size: 13px !important;
    }

    /* ============================================================
       CATEGORY CARD REFRESH — Mobile (mirrors category-refresh.css)
       ============================================================ */

    /* --- Product Card: Flex structure for equal-height cards --- */
    .row.cat_prod .product-layout.product-grid {
        display: flex !important;
        flex-direction: column;
    }

    .row.cat_prod .product-layout.product-grid > .product-block {
        flex: 1 1 auto;
        display: flex !important;
        flex-direction: column;
    }

    .row.cat_prod .product-layout.product-grid .product-block-inner {
        flex: 1 1 auto;
        display: flex !important;
        flex-direction: column;
    }

    .row.cat_prod .product-layout.product-grid .product-details {
        flex: 1 1 auto;
        display: flex !important;
        flex-direction: column;
        padding: 8px !important;
    }

    .row.cat_prod .product-layout.product-grid .product-details .caption {
        flex: 1 1 auto;
        display: flex !important;
        flex-direction: column;
    }

    /* --- Product Image: 1:1 Aspect Ratio --- */
    .row.cat_prod .product-layout.product-grid .product-thumb .image {
        position: relative !important;
        width: 100% !important;
        padding-top: 100% !important;
        overflow: hidden !important;
        background: #f5f5f5;
    }

    .row.cat_prod .product-layout.product-grid .product-thumb .image a {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: block !important;
    }

    .row.cat_prod .product-layout.product-grid .product-thumb .image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
    }

    /* --- Product Name: 2-line truncation --- */
    .row.cat_prod .product-layout.product-grid .caption h4 {
        height: 36px !important;
        line-height: 18px !important;
        font-size: 13px !important;
        margin: 0 0 4px !important;
        overflow: hidden !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        text-overflow: ellipsis !important;
    }

    .row.cat_prod .product-layout.product-grid .caption h4 a {
        font-size: 13px !important;
        line-height: 18px !important;
        color: #1a1a2e;
        text-decoration: none;
    }

    /* --- Price Row: flex with Znamky+ badge --- */
    .row.cat_prod .product-layout.product-grid .price-row {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 3px !important;
        margin: 0 0 4px !important;
        flex-shrink: 0;
        min-height: 1.4em;
    }

    .row.cat_prod .product-layout.product-grid .price-row .price {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        flex-shrink: 1;
        min-width: 0;
        font-size: 13px !important;
    }

    .row.cat_prod .product-layout.product-grid .price-row .price .price-new {
        font-weight: 700 !important;
        color: #c0392b !important;
        font-size: 13px !important;
    }

    .row.cat_prod .product-layout.product-grid .price-row .price .price-old {
        font-size: 10px !important;
        color: #999 !important;
        text-decoration: line-through !important;
    }

    /* --- Znamky+ Badge on Category Cards --- */
    .znamkyplus-tag {
        display: inline-flex !important;
        flex-direction: column !important;
        align-items: center !important;
        background: #e5b80b !important;
        color: #1a1a2e !important;
        padding: 2px 5px !important;
        border-radius: 5px !important;
        text-decoration: none !important;
        flex-shrink: 0 !important;
        line-height: 1.15 !important;
    }

    .znamkyplus-tag-label {
        font-size: 7px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3px !important;
        opacity: 0.85;
    }

    .znamkyplus-tag-price {
        font-size: 9px !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
    }

    /* --- Cart Button: always at bottom --- */
    .row.cat_prod .product-layout.product-grid .product_hover_block {
        margin-top: auto !important;
        flex-shrink: 0 !important;
        padding: 0 8px 8px !important;
    }

    .row.cat_prod .product-layout.product-grid .product_hover_block .cart-button a,
    .row.cat_prod .product-layout.product-grid .product_hover_block .cart-button button {
        font-size: 12px !important;
        padding: 8px 4px !important;
        border-radius: 8px !important;
        width: 100% !important;
    }

    /* --- Discount / Sale badge on image --- */
    .row.cat_prod .product-layout.product-grid .special-tag {
        position: absolute !important;
        top: 6px !important;
        left: 6px !important;
        z-index: 2;
        font-size: 11px !important;
        padding: 2px 6px !important;
        border-radius: 4px !important;
    }

    /* --- Wishlist icon on image --- */
    .row.cat_prod .product-layout.product-grid .wishlist-icon,
    .row.cat_prod .product-layout.product-grid .product-thumb .image .wish {
        position: absolute !important;
        top: 6px !important;
        right: 6px !important;
        z-index: 2;
    }

    /* ============================================================
       PRODUCT PAGE TABLES — Mobile (light headers, not dark)
       ============================================================ */

    /* Specification tab: light headers */
    #tab-specification thead td {
        background: #f0f2f5 !important;
        color: #333 !important;
        font-weight: 700 !important;
        font-size: 12px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        padding: 8px !important;
        border-bottom: 2px solid #dee2e6 !important;
    }

    #tab-specification .table-bordered {
        border-radius: 10px !important;
        overflow: hidden !important;
        border: 1px solid #e8eaed !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    #tab-specification .table-bordered td {
        border: none !important;
        border-bottom: 1px solid #f0f1f5 !important;
    }

    #tab-specification .table-bordered tbody tr td:first-child {
        background: #fafbfc !important;
        font-weight: 500 !important;
        color: #555 !important;
    }

    #tab-specification .table-bordered tbody tr:last-child td {
        border-bottom: none !important;
    }

    /* Description tab: light table headers */
    #tab-description table {
        border-collapse: separate !important;
        border-spacing: 0 !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        border: 1px solid #e8eaed !important;
    }

    #tab-description table td {
        padding: 8px 10px !important;
        font-size: 13px !important;
        border: none !important;
        border-bottom: 1px solid #f0f1f5 !important;
    }

    #tab-description table tr:last-child td {
        border-bottom: none !important;
    }

    #tab-description table td:first-child {
        font-weight: 500 !important;
        color: #555 !important;
        background: #fafbfc !important;
    }

    #tab-description table tr:first-child td,
    #tab-description table thead td,
    #tab-description table thead th {
        background: #f0f2f5 !important;
        font-weight: 700 !important;
        color: #333 !important;
        border-bottom: 2px solid #dee2e6 !important;
    }

    /* ============================================================
       PRODUCT PAGE — Znamky+ badge + price row (mobile)
       ============================================================ */

    .product-price-row {
        display: flex !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .znamkyplus-tag-product {
        display: inline-flex !important;
        flex-direction: column !important;
        align-items: center !important;
        background: #e5b80b !important;
        color: #1a1a2e !important;
        padding: 3px 10px !important;
        border-radius: 6px !important;
        text-decoration: none !important;
        line-height: 1.2 !important;
    }

    .znamkyplus-tag-product .znamkyplus-tag-label {
        font-size: 8px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.4px !important;
        opacity: 0.85;
    }

    .znamkyplus-tag-product .znamkyplus-tag-price {
        font-size: 12px !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
    }

    /* ---- FIX: Aside (#column-left) sidebar on all pages ---- */
    #column-left {
        width: 100% !important;
        float: none !important;
        clear: both !important;
        padding: 0 15px !important;
        margin-top: 10px !important;
        margin-bottom: 15px;
        background: transparent !important;
    }

    #column-left .box {
        background: #eef2f9 !important;
        border: 1px solid #c5d5ea !important;
        border-radius: 8px !important;
        margin-bottom: 10px;
        padding: 12px 15px !important;
    }

    #column-left .box .box-heading {
        color: #333 !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Center the toggle arrow vertically in the aside box */
    #column-left .box .mobile_togglemenu {
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
        width: 44px !important;
        height: 44px !important;
        right: 5px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    #column-left .box .mobile_togglemenu::before {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    /* ---- FIX: Submenu link color unification ---- */
    body > .ul-top-items.mobile-slide-panel .mega-menu-container a,
    body > .ul-top-items.mobile-slide-panel .mega-menu-container a span,
    body > .ul-top-items.mobile-slide-panel .mega-menu-container strong,
    body > .ul-top-items.mobile-slide-panel .mega-menu-container strong a,
    body > .ul-top-items.mobile-slide-panel .mega-menu-container h5,
    body > .ul-top-items.mobile-slide-panel .mega-menu-container h5 a {
        color: #444 !important;
        font-size: 13px !important;
        font-weight: 400 !important;
        text-decoration: none !important;
        text-transform: none !important;
    }

    body > .ul-top-items.mobile-slide-panel .mega-menu-container a:hover,
    body > .ul-top-items.mobile-slide-panel .mega-menu-container a:hover span {
        color: #2563eb !important;
    }

    /* ---- FIX: Subcategory grid 2-column layout ---- */
    .sub_category .col-xs-6,
    .row.sub_category > div {
        width: 50% !important;
        float: left !important;
        box-sizing: border-box !important;
        padding: 5px !important;
    }

    .sub_category .col-xs-6 .subcategory-thumbnail,
    .sub_category a {
        font-size: 12px;
        word-wrap: break-word;
    }

    /* ---- FIX: .category-item responsive 2-column ---- */
    .category_list2 {
        display: flex !important;
        flex-wrap: wrap !important;
        height: auto !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .category_list2 ul {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    .category_list2 .category-item {
        width: calc(50% - 10px) !important;
        max-width: calc(50% - 10px) !important;
        min-width: 0 !important; /* override inline min-width:150px */
        margin: 5px !important;
        box-sizing: border-box !important;
        flex-shrink: 0;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px;
        padding: 8px !important;
        background: #fff;
        border-radius: 6px;
        border: 1px solid #dde1ea;
    }

    .category_list2 .category-item a {
        font-size: 12px !important;
        word-wrap: break-word;
    }

    /* Subcategory thumbnail icons - ensure they fit side-by-side with text */
    .category_list2 .category_img2 {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        width: 36px !important;
        height: 36px !important;
        overflow: visible !important;
    }

    .category_list2 .category_img2 a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 36px !important;
        height: 36px !important;
    }

    /* Reset .img-thumbnail padding/border on subcategory icons */
    .category_list2 .category_img2 img,
    .category_list2 .category_img2 img.img-thumbnail {
        width: 36px !important;
        height: 36px !important;
        object-fit: contain !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    /* Subcategory text - flex to fill remaining space */
    .category_list2 .category_text2,
    .category_list2 .category-item > a.category_text2 {
        flex: 1 !important;
        min-width: 0 !important;
        font-size: 12px !important;
        line-height: 1.3 !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        color: #333 !important;
    }

    /* ---- Category page aside & bottom spacing fixes ---- */

    /* Aside (#column-left) on category pages: tighter to content, no excessive gap */
    #product-special #column-left,
    .container > .row > #column-left {
        margin-top: 0 !important;
        margin-bottom: 5px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Remove excessive gap between column-left and content */
    #product-special > .row {
        display: flex !important;
        flex-wrap: wrap !important;
    }

    /* Reduce gap above product grid - override theme's top:90px */
    .row.cat_prod {
        margin-top: 0 !important;
        padding-top: 0 !important;
        position: static !important;
        top: auto !important;
    }

    /* ---- Category bottom controls: unified block ---- */

    #desktop-filter,
    #desktop-filter * {
        display: none !important;
        visibility: hidden !important;
        overflow: hidden !important;
        height: 0 !important;
        width: 0 !important;
    }

    /* Mobile filter: unified light background block */
    #mobile-filter {
        display: block !important;
        background: #f5f5f7 !important;
        border-radius: 10px 10px 0 0 !important;
        padding: 12px !important;
        margin: 5px 0 0 !important;
        clear: both;
        overflow: hidden !important;
        position: static !important;
        top: auto !important;
        width: auto !important;
        float: none !important;
    }

    /* Hide redundant grid/list and compare at bottom */
    #mobile-filter .btn-list-grid,
    #mobile-filter .compare-total {
        display: none !important;
    }

    /* Hide white customSelect wrappers */
    #mobile-filter .customSelect {
        display: none !important;
    }

    /* Sort/limit row: inline, compact */
    #mobile-filter .pagination-right {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    #mobile-filter .sort-by-wrapper,
    #mobile-filter .show-wrapper {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        margin: 0 !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
    }

    #mobile-filter .sort-by-wrapper {
        flex: 1 !important;
        min-width: 0 !important;
    }

    #mobile-filter .sort-by-wrapper label,
    #mobile-filter .show-wrapper label {
        font-size: 12px !important;
        font-weight: 500 !important;
        color: #666 !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }

    #mobile-filter .sort select,
    #mobile-filter .limit select {
        opacity: 1 !important;
        position: relative !important;
        appearance: auto !important;
        -webkit-appearance: auto !important;
        background: #fff !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 6px !important;
        padding: 6px 8px !important;
        font-size: 12px !important;
        height: auto !important;
        width: auto !important;
        color: #333 !important;
    }

    #mobile-filter .sort {
        flex: 1 !important;
        min-width: 0 !important;
    }

    #mobile-filter .sort select {
        width: 100% !important;
    }

    /* ---- Pagination: same unified background ---- */
    .pagination-wrapper {
        display: block !important;
        padding: 12px !important;
        margin: 0 0 15px !important;
        clear: both;
        background: #f5f5f7 !important;
        border-radius: 0 0 10px 10px !important;
        float: none !important;
        width: auto !important;
        border-top: 1px solid #eaeaea !important;
    }

    .pagination-wrapper .page-result,
    .pagination-wrapper .page-link {
        width: 100% !important;
        float: none !important;
        text-align: center !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .pagination-wrapper .page-result {
        font-size: 12px !important;
        color: #888 !important;
        margin-bottom: 10px !important;
    }

    .pagination-wrapper .pagination {
        display: flex !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .pagination-wrapper .pagination li {
        margin: 0 !important;
    }

    .pagination-wrapper .pagination li a,
    .pagination-wrapper .pagination li span {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 36px !important;
        height: 36px !important;
        padding: 0 8px !important;
        border-radius: 8px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        text-decoration: none !important;
        border: 1px solid #e0e0e0 !important;
        background: #fff !important;
        color: #333 !important;
    }

    .pagination-wrapper .pagination li.active span {
        background: #2563eb !important;
        color: #fff !important;
        border-color: #2563eb !important;
    }

    .pagination-wrapper .pagination li a:hover {
        background: #e9ecef !important;
    }

    /* ---- Special, Latest, Auction pages: filter & headline fixes ---- */

    /* Headline left padding on product listing pages */
    .product-special #content h2.page-title,
    .product-latest #content h2.page-title,
    .product-auction #content h2.page-title,
    .product-special #content > h1,
    .product-latest #content > h1 {
        padding-left: 15px !important;
    }

    .product-special #content .page-subheadline,
    .product-latest #content .page-subheadline {
        padding: 0 15px !important;
    }

    /* Filter bar on Special/Latest: same cleanup as category */
    .product-special .category_filter,
    .product-latest .category_filter {
        background: #f5f5f7 !important;
        border-radius: 10px 10px 0 0 !important;
        padding: 12px !important;
        margin: 5px 0 0 !important;
        clear: both;
        overflow: hidden !important;
        position: static !important;
        float: none !important;
        width: auto !important;
        display: block !important;
    }

    .product-special .category_filter .btn-list-grid,
    .product-special .category_filter .compare-total,
    .product-latest .category_filter .btn-list-grid,
    .product-latest .category_filter .compare-total {
        display: none !important;
    }

    .product-special .category_filter .customSelect,
    .product-latest .category_filter .customSelect {
        display: none !important;
    }

    .product-special .category_filter .pagination-right,
    .product-latest .category_filter .pagination-right {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        float: none !important;
    }

    .product-special .category_filter .sort-by-wrapper,
    .product-special .category_filter .show-wrapper,
    .product-latest .category_filter .sort-by-wrapper,
    .product-latest .category_filter .show-wrapper {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
    }

    .product-special .category_filter .sort-by-wrapper,
    .product-latest .category_filter .sort-by-wrapper {
        flex: 1 !important;
        min-width: 0 !important;
    }

    .product-special .category_filter .sort-by-wrapper label,
    .product-special .category_filter .show-wrapper label,
    .product-latest .category_filter .sort-by-wrapper label,
    .product-latest .category_filter .show-wrapper label {
        font-size: 12px !important;
        font-weight: 500 !important;
        color: #666 !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }

    .product-special .category_filter .sort select,
    .product-special .category_filter .limit select,
    .product-latest .category_filter .sort select,
    .product-latest .category_filter .limit select {
        opacity: 1 !important;
        position: relative !important;
        appearance: auto !important;
        -webkit-appearance: auto !important;
        background: #fff !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 6px !important;
        padding: 6px 8px !important;
        font-size: 12px !important;
        height: auto !important;
        width: auto !important;
        color: #333 !important;
    }

    .product-special .category_filter .sort,
    .product-latest .category_filter .sort {
        flex: 1 !important;
        min-width: 0 !important;
        float: none !important;
        width: auto !important;
    }

    .product-special .category_filter .sort select,
    .product-latest .category_filter .sort select {
        width: 100% !important;
    }

    .product-special .category_filter .limit,
    .product-latest .category_filter .limit {
        float: none !important;
        width: auto !important;
    }

    /* Auction page: reduce gap between breadcrumb and header */
    .product-auction .content-top-breadcum {
        margin-top: 70px !important;
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }

    .product-auction #content {
        margin-top: 5px !important;
        padding-top: 0 !important;
    }

    /* ---- Information pages: fix layout and spacing ---- */
    [class*="information-information"] #content {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        padding: 10px 15px !important;
    }

    [class*="information-information"] #content h1 {
        margin-top: 0 !important;
        padding-top: 0 !important;
        font-size: 22px !important;
    }

    [class*="information-information"] .row {
        margin: 0 !important;
    }

    [class*="information-information"] #column-left,
    [class*="information-information"] #column-right {
        display: none !important;
    }

    #information-information {
        position: static !important;
        top: auto !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* ---- Contact page: fix logo bg and layout ---- */
    #information-contact #content {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        padding: 10px 15px !important;
    }

    #information-contact .address-detail img.img-thumbnail {
        background: #fff !important;
        border: 1px solid #eee !important;
        padding: 8px !important;
        max-width: 160px !important;
    }

    #information-contact .contact-form-design {
        padding: 0 !important;
    }

    #information-contact .contact-form-design .left {
        margin-bottom: 15px !important;
    }

    #information-contact .contact-form .form-horizontal .form-group {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #information-contact .contact-form .form-horizontal .col-sm-2,
    #information-contact .contact-form .form-horizontal .col-sm-10 {
        width: 100% !important;
        float: none !important;
        padding: 0 !important;
    }

    #information-contact .contact-form .form-horizontal .col-sm-2 {
        text-align: left !important;
        margin-bottom: 4px !important;
    }

    #information-contact .contact-form legend {
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }

    #information-contact .buttons .pull-right {
        float: none !important;
    }

    #information-contact .buttons .btn {
        width: 100% !important;
        display: block !important;
    }

    /* ---- Search page: fix layout, form, filters, cards ---- */
    .product-search #product-search {
        position: static !important;
        top: auto !important;
    }

    .product-search #column-left,
    .product-search #column-right {
        display: none !important;
    }

    .product-search #content {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        padding: 10px 15px !important;
    }

    .product-search #content h3.page-title {
        font-size: 20px !important;
        margin: 5px 0 10px !important;
        padding: 0 !important;
    }

    /* Search form */
    .product-search .search_term,
    .product-search .category_dropdown,
    .product-search .search_subcategory {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin-bottom: 8px !important;
    }

    .product-search .search_term input {
        width: 100% !important;
    }

    .product-search .category_dropdown {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .product-search .category_dropdown select {
        flex: 1 !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    .product-search .category_dropdown #button-search {
        background: #2563eb !important;
        color: #fff !important;
        border: none !important;
        border-radius: 8px !important;
        padding: 8px 18px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        white-space: nowrap !important;
    }

    .product-search .search_subcategory {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px 16px !important;
    }

    .product-search .search_subcategory label {
        font-size: 13px !important;
        white-space: nowrap !important;
    }

    /* Search page filter — same style as category filter */
    .product-search .category_filter {
        background: #f5f5f7 !important;
        border-radius: 10px 10px 0 0 !important;
        padding: 12px !important;
        margin: 10px 0 0 !important;
        display: block !important;
        clear: both !important;
        overflow: hidden !important;
        position: static !important;
        width: auto !important;
        float: none !important;
    }

    .product-search .category_filter .btn-list-grid,
    .product-search .category_filter .compare-total {
        display: none !important;
    }

    .product-search .category_filter .customSelect {
        display: none !important;
    }

    .product-search .category_filter .pagination-right {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    .product-search .category_filter .sort-by-wrapper,
    .product-search .category_filter .show-wrapper {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
    }

    .product-search .category_filter .sort-by,
    .product-search .category_filter .show {
        width: auto !important;
        padding: 0 !important;
        float: none !important;
    }

    .product-search .category_filter .sort,
    .product-search .category_filter .limit {
        width: auto !important;
        padding: 0 !important;
        float: none !important;
    }

    .product-search .category_filter .sort select,
    .product-search .category_filter .limit select {
        opacity: 1 !important;
        position: relative !important;
        appearance: auto !important;
        -webkit-appearance: auto !important;
        background: #fff !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 6px !important;
        padding: 6px 8px !important;
        font-size: 12px !important;
        height: auto !important;
        width: auto !important;
        color: #333 !important;
    }

    .product-search .category_filter .sort-by label,
    .product-search .category_filter .show label {
        font-size: 12px !important;
        color: #666 !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }

    /* Search page pagination — same style as category */
    .product-search .pagination-wrapper {
        display: block !important;
        padding: 12px !important;
        margin: 0 0 15px !important;
        clear: both !important;
        background: #f5f5f7 !important;
        border-radius: 0 0 10px 10px !important;
        float: none !important;
        width: auto !important;
        border-top: 1px solid #eaeaea !important;
    }

    .product-search .pagination-wrapper .page-link,
    .product-search .pagination-wrapper .page-result {
        width: 100% !important;
        text-align: center !important;
        padding: 0 !important;
        float: none !important;
    }

    .product-search .pagination-wrapper .page-result {
        font-size: 12px !important;
        color: #888 !important;
        margin-top: 8px !important;
    }

    /* Search results cards — 2 per row grid, proper text wrapping */
    .product-search .product-layout.product-list {
        width: 50% !important;
        float: left !important;
        padding: 0 5px !important;
        margin-bottom: 10px !important;
    }

    .product-search .product-thumb h4 {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }

    .product-search .product-thumb h4 a {
        display: block !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
        color: #333 !important;
    }

    .product-search .product-thumb .price {
        font-size: 14px !important;
        font-weight: 600 !important;
        margin: 4px 0 !important;
    }

    .product-search .product-thumb .description {
        display: none !important;
    }

    /* Cart button styling on search page */
    .product-search .product-thumb .cart_button {
        background: #2563eb !important;
        color: #fff !important;
        border: none !important;
        border-radius: 8px !important;
        padding: 6px 10px !important;
        font-size: 12px !important;
        font-weight: 500 !important;
        width: 100% !important;
        cursor: pointer !important;
        transition: background 0.15s !important;
    }

    .product-search .product-thumb .cart_button:active {
        background: #1d4ed8 !important;
    }

    .product-search .product-thumb .cart_button.out_of_stock {
        background: #ccc !important;
        color: #666 !important;
        cursor: default !important;
    }

    /* ---- Mobile aside navigation for information & account pages ---- */
    .mobile-aside-nav {
        display: block !important;
        margin: 0 0 12px !important;
        padding: 5px 15px 0 !important;
    }

    .mobile-aside-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        background: #f5f5f7 !important;
        border: 1px solid #e8e8e8 !important;
        border-radius: 10px !important;
        padding: 10px 14px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #333 !important;
        cursor: pointer !important;
        width: 100% !important;
        text-align: left !important;
        transition: background 0.15s !important;
    }

    .mobile-aside-toggle:active {
        background: #eaeaea !important;
    }

    .mobile-aside-toggle .fa-chevron-down {
        font-size: 11px !important;
        color: #888 !important;
        transition: transform 0.2s !important;
    }

    .mobile-aside-toggle.open .fa-chevron-down {
        transform: rotate(180deg) !important;
    }

    .mobile-aside-links {
        display: none;
        list-style: none !important;
        margin: 0 !important;
        padding: 6px 0 0 !important;
        background: #f5f5f7 !important;
        border: 1px solid #e8e8e8 !important;
        border-top: none !important;
        border-radius: 0 0 10px 10px !important;
        overflow: hidden !important;
    }

    .mobile-aside-links.open {
        display: block !important;
    }

    .mobile-aside-links li {
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
    }

    .mobile-aside-links li a {
        display: block !important;
        padding: 9px 14px !important;
        font-size: 13px !important;
        color: #333 !important;
        text-decoration: none !important;
        border-bottom: 1px solid #eee !important;
        transition: background 0.1s !important;
    }

    .mobile-aside-links li:last-child a {
        border-bottom: none !important;
    }

    .mobile-aside-links li a:active {
        background: #e8e8e8 !important;
    }

    .mobile-aside-links li.active a {
        color: #2563eb !important;
        font-weight: 600 !important;
        background: #eef4fb !important;
    }

    /* ---- Account pages: fix layout and spacing ---- */
    body[class*="account-"] #column-left,
    body[class*="account-"] #column-right {
        display: none !important;
    }

    body[class*="account-"] #content {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
    }

    body[class*="account-"] .row {
        margin: 0 !important;
    }

    body[class*="account-"] #content h1,
    body[class*="account-"] #content h2.page-title {
        margin-top: 0 !important;
        padding-top: 0 !important;
        font-size: 22px !important;
    }

    /* ---- SEO text at bottom of category pages ---- */
    #content > br {
        display: none !important;
    }

    #content > h3 {
        padding: 0 15px !important;
        font-size: 17px !important;
        font-weight: 600 !important;
        margin: 15px 0 8px !important;
        line-height: 1.3 !important;
    }

    #content > p {
        padding: 0 15px !important;
        font-size: 13px !important;
        line-height: 1.6 !important;
        color: #444 !important;
        margin-bottom: 10px !important;
    }

    /* Bottom padding for #content on category pages */
    #product-special #content {
        padding-bottom: 20px !important;
    }

    /* Fix .title-description positioning (remove inline top:30px from template) */
    .col-sm-12.title-description {
        position: static !important;
        top: auto !important;
        margin: 10px 0 0 0 !important;
    }

    /* Category description */
    .category_details .category_description {
        min-height: auto !important;
        margin-bottom: 15px !important;
    }

    /* ---- FIX: Related/Featured products carousel - show 2 cards ---- */
    .owl-carousel .owl-item,
    .related .owl-carousel .owl-item,
    .featured .owl-carousel .owl-item {
        width: 50% !important;
    }

    .owl-carousel .product-layout,
    .related .product-layout,
    .featured .product-layout {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
    }

    /* ---- FIX: Product page - full width layout on mobile ---- */
    .col-sm-4.product-left,
    .col-sm-5.product-right,
    .col-sm-3.product {
        width: 100% !important;
        float: none !important;
    }

    /* Product image - ensure it doesn't have theme's absolute positioning */
    .product-left .product-image img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* ---- FIX: Blog section on HP - override owl-carousel inline widths ---- */
    .webdigifyblog .owl-wrapper-outer {
        width: 100% !important;
    }

    .webdigifyblog .owl-wrapper {
        width: 100% !important;
        transform: none !important;
        left: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .webdigifyblog .owl-item {
        width: 100% !important;
        float: none !important;
        margin-bottom: 15px !important;
        flex-shrink: 0;
    }

    .webdigifyblog .blog-item {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .webdigifyblog .blog-item img {
        max-width: 100% !important;
        height: auto !important;
    }

    .webdigifyblog .view-blog {
        padding: 12px 15px !important;
    }
    .webdigifyblog .view-blog h4 {
        font-size: 15px !important;
        margin-bottom: 8px !important;
    }
    .webdigifyblog .view-blog .blog-desc {
        font-size: 13px !important;
        line-height: 1.5 !important;
        margin-bottom: 8px !important;
    }
    .webdigifyblog .view-blog .date-time {
        margin-bottom: 6px !important;
    }

    /* Hide carousel nav on mobile for blog */
    .webdigifyblog .owl-controls,
    .webdigifyblog .owl-buttons {
        display: none !important;
    }

    /* ---- FIX: Blog post page side padding ---- */
    .information-blogger #content.single-blog,
    .information-blogger-blogs #content.all-blog {
        padding: 0 15px !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    .information-blogger #content.single-blog img {
        max-width: 100% !important;
        height: auto !important;
    }
    .information-blogger #content .blog-right-content,
    .information-blogger-blogs #content .blog-right-content {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    .information-blogger #content h1,
    .information-blogger-blogs #content h1 {
        padding-bottom: 8px !important;
    }
    .information-blogger #content .date-time,
    .information-blogger-blogs #content .date-time,
    .information-blogger-blogs .blog-right-content .date-time {
        padding-bottom: 6px !important;
        background: none !important;
        background-color: transparent !important;
        height: auto !important;
        min-height: 23px !important;
        overflow: visible !important;
    }

    .information-blogger #content.single-blog .blog-desc,
    .information-blogger #content.single-blog p,
    .information-blogger #content.single-blog table,
    .information-blogger #content.single-blog ul,
    .information-blogger #content.single-blog ol {
        max-width: 100% !important;
        width: 100% !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        box-sizing: border-box !important;
    }

    /* ---- FIX: Footer social icons spacing ---- */
    footer .social-block {
        margin-top: -25px !important;
    }

    /* ---- FIX: Footer toggle arrows ---- */
    footer h5.toggle {
        cursor: pointer !important;
        position: relative !important;
        padding-right: 35px !important;
    }
    /* Hide the original JS-injected toggle link's arrow, keep click area */
    footer .mobile_togglemenu {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 2 !important;
        cursor: pointer !important;
    }
    footer .mobile_togglemenu::before {
        content: none !important;
    }
    /* Use h5::after for the arrow instead - always positioned relative to h5 */
    footer h5.toggle::after {
        content: "\f107" !important;
        font-family: "FontAwesome" !important;
        color: #fff !important;
        font-size: 18px !important;
        position: absolute !important;
        right: 10px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 20px !important;
        text-align: center !important;
        line-height: 1 !important;
        pointer-events: none !important;
    }
    footer h5.toggle.active::after {
        content: "\f106" !important;
    }

    /* ---- FIX: HP promo/feature sections full width ---- */
    .wd_category_feature,
    .hometab,
    .hometab-auctions {
        max-width: 100% !important;
        overflow: hidden !important;
    }

    /* ---- FIX: Hometab spacing on mobile ---- */
    .hometab.box {
        margin-bottom: 15px !important;
    }
    .hometab-wrapper {
        padding: 15px 10px 15px !important;
    }
    .hometab .box-heading,
    .hometab .hometab-heading {
        margin-bottom: 10px !important;
        font-size: 18px !important;
    }

    /* ---- FIX: Category CMS banners on mobile ---- */
    .category_cms .category_block {
        margin-bottom: 8px !important;
    }
    .category_cms .category_block img {
        width: 100% !important;
        height: auto !important;
    }

    /* ---- FIX: Services/benefits owl carousel on mobile ---- */
    #wdcmsservice .owl-item {
        width: 100% !important;
    }
    #wdcmsservice .wdservice {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-top: 16px !important;
        padding-bottom: 16px !important;
    }
    #wdcmsservice .wdservice .service-icon {
        width: 50px !important;
        height: 50px !important;
    }
    #wdcmsservice .wdservice .service-title {
        font-size: 15px !important;
        font-weight: 600 !important;
    }
    #wdcmsservice .wdservice .service-desc {
        font-size: 13px !important;
    }
    #wdcmsservice .owl-wrapper {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        transform: none !important;
    }
    #wdcmsservice .owl-wrapper-outer {
        overflow: visible !important;
    }
    #wdcmsservice .home-sevices {
        height: auto !important;
    }
    #wdcmsservice .owl-controls {
        display: none !important;
    }

    /* ---- FIX: Newsletter popup + its bPopup backdrop ---- */
    .newletter-popup {
        display: none !important;
    }

    .b-modal,
    .b-modal.__b-popup1__ {
        display: none !important;
    }

    /* ---- FIX: Footer section on mobile ---- */
    footer .container {
        padding: 0 15px !important;
    }

    footer .col-sm-3,
    footer .col-sm-4,
    footer .col-sm-6,
    footer .footer-blocks > aside,
    footer .footer-blocks > div {
        width: 100% !important;
        float: none !important;
        clear: both !important;
        padding: 0 !important;
        margin-bottom: 15px;
    }

    /* Add padding at bottom of page so content isn't hidden behind sticky nav */
    body {
        padding-bottom: 60px !important;
    }
}


/* ==========================================================================
   14. STICKY BOTTOM NAVIGATION BAR
   ========================================================================== */

@media (max-width: 767px) {
    .mobile-bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        background: #fff !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-around !important;
        z-index: 9997 !important;
        box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.1) !important;
        border-top: 1px solid #e5e5e5 !important;
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        text-decoration: none !important;
        color: #666 !important;
        font-size: 10px;
        font-family: 'Rubik', sans-serif;
        font-weight: 400;
        line-height: 1;
        padding: 4px 0;
        position: relative;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.15s ease;
    }

    .bottom-nav-item i {
        font-size: 20px;
        margin-bottom: 3px;
        line-height: 1;
    }

    .bottom-nav-item span {
        display: block;
        white-space: nowrap;
    }

    .bottom-nav-item:active,
    .bottom-nav-item.active {
        color: #2563eb !important;
    }

    .bottom-nav-item.active i {
        color: #2563eb !important;
    }

    /* Cart badge */
    .bottom-cart-badge {
        position: absolute !important;
        top: 2px !important;
        right: 50% !important;
        margin-right: -18px !important;
        min-width: 16px !important;
        height: 16px !important;
        line-height: 16px !important;
        padding: 0 4px !important;
        border-radius: 8px !important;
        background: #e53935 !important;
        color: #fff !important;
        font-size: 10px !important;
        font-weight: 600 !important;
        text-align: center !important;
        display: none !important;
    }

    .bottom-cart-badge.has-items {
        display: block !important;
    }

    /* Hide the old header hamburger — now in bottom nav. Cart stays in header too. */
    .mobile-hamburger {
        display: none !important;
    }

    /* ---- Prevent horizontal scroll on ALL pages ---- */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    .container, #content, #product-product {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    /* Ensure product detail tables don't overflow */
    #product-product table,
    #tabs_info table {
        width: 100% !important;
        table-layout: fixed !important;
        word-wrap: break-word;
    }

    /* ---- Related products: 2 per row on mobile ---- */
    #products-related .product-layout,
    .related-products .product-layout,
    #content .product-carousel .product-layout {
        width: 50% !important;
        float: left !important;
        padding: 0 5px !important;
        box-sizing: border-box !important;
    }
    #products-related .product-layout .product-thumb,
    .related-products .product-layout .product-thumb {
        margin-bottom: 10px;
    }
    #products-related .product-layout .product-thumb .image img,
    .related-products .product-layout .product-thumb .image img {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1;
        object-fit: cover;
    }
    #products-related .product-layout .product-thumb .caption h4 a,
    .related-products .product-layout .product-thumb .caption h4 a {
        font-size: 12px !important;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    #products-related .product-layout .product-thumb .caption .price,
    .related-products .product-layout .product-thumb .caption .price {
        font-size: 13px !important;
    }
    #products-related .product-layout .product-thumb .button-group button,
    .related-products .product-layout .product-thumb .button-group button {
        font-size: 11px !important;
        padding: 6px 8px !important;
    }

    /* ---- Spec table mobile fix ---- */
    .table-spec {
        table-layout: fixed;
        width: 100% !important;
        word-wrap: break-word;
    }
}
