/* Container */
ul#wmm-container.wmm-desktop-menu {
    width: 100%;
    height: 100%;
    display: block;
    list-style: none;
    padding: 0;
    margin: 0;
}

ul#wmm-container.wmm-desktop-menu li.wmm-toggle-item {
    list-style: none;
    width: 100%;
}

ul#wmm-container.wmm-desktop-menu li.wmm-wrapper-item {
    list-style: none;
    width: 100%;
}

/* Toggle Button */
#wmm-toggle {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;

    margin-top: 0;
    margin-bottom: 0;
    position: relative;
    top: 2px;
    /* adjust as needed */

    padding: 12px 16px;
    background: #34A648;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: 0.25s;
    border: none;
}

#wmm-toggle:hover {
    background: #34A648;
}

html.wmm-no-scroll,
body.wmm-no-scroll {
    overflow: hidden !important;
    height: 100%;
    touch-action: none;
}

/* Menu wrapper (hidden by default) */
#wmm-wrapper {
    position: fixed;
    /* <— IMPORTANT */
    left: 0;
    top: calc(100% + 6px);
    /* initially will jump — fix with JS below */
    width: 100vw;
    /* full screen width */
    max-width: 100%;
    display: flex;

    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.15);

    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 9999;

    -webkit-overflow-scrolling: touch;
}

/* Active state → show menu */
ul#wmm-container.wmm-desktop-menu.show #wmm-wrapper {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wmm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wmm-cat-list {
    width: 25%;
    /* adjust if needed */
    border-right: 1px solid #ddd;
    overflow-y: auto;
    max-height: 70vh; /* Changed from 80vh to 70vh */
}

/* Enhanced category item with hover effect */
.wmm-cat-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-left: 3px solid transparent;
    list-style: none;
}

.wmm-cat-item a {
    text-decoration: none;
    width: 100%;
}

.wmm-cat-item:hover {
    background: #f0f8ff;
    border-left: 3px solid #34A648;
    padding-left: 20px;
}

.wmm-cat-item.active {
    background: #e6f7ff;
    border-left: 3px solid #34A648;
    color: #34A648;
    font-weight: 600;
}

.wmm-product-panel {
    width: 75%;
    position: relative;
    max-height: 70vh; /* Changed from 80vh to 70vh */
    /* same height as category list */
    overflow-y: auto;
    background: #fff;
    padding: 12px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    padding: 10px;
    transition: all 0.3s ease;
}

.wmm-loading {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    z-index: 5;
}

.wmm-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #ccc;
    border-top: 3px solid #34A648;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Product list → Grid */
.wmm-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    padding: 8px;
}

/* Product card */
.wmm-product {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #eee;
    transition: all 0.25s ease;
    background: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Hover effect for product card */
.wmm-product:hover {
    background: #f9f9f9;
    border-color: #ddd;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
}

/* Enhanced image with proper aspect ratio handling */
.wmm-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.wmm-product:hover .wmm-img {
    transform: scale(1.03);
}

/* Info section */
.wmm-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.wmm-title {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    text-decoration: none;
}

.wmm-title:hover {
    color: #34A648;
}

.wmm-price {
    color: #e63946;
    font-size: 15px;
    font-weight: 600;
}

.wmm-desc {
    font-size: 12px;
    color: #666;
    max-height: 38px;
    overflow: hidden;
}

/* Add to cart button */
.wmm-cart-btn {
    display: inline-block;
    padding: 8px 12px;
    background: #34A648;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    margin-top: auto;
    transition: all .3s;
    cursor: pointer;
    font-weight: 500;
}

.wmm-cart-btn:hover {
    background: #34A648;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.2);
}

.wmm-cart-btn.out-of-stock {
    background: #ccc;
    cursor: not-allowed;
}

.wmm-cart-btn.coming-soon {
    background: #ff9800;
}

.wmm-cart-btn.backorder {
    background: #4caf50;
}

.wmm-cart-btn.adding {
    background: #4caf50;
    position: relative;
}

.wmm-cart-btn.adding::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

/* Variation select box (optional) */
.wmm-variations select {
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 12px;
}

/* All Products item styles */
.all-products-item {
    background: #f0f8ff;
    border: 2px dashed #34A648;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.all-products-link {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #34A648;
    text-decoration: none;
}

.all-products-link .arrow {
    font-size: 24px;
    font-weight: bold;
    margin-left: 10px;
    color: #34A648;
}

/* List Style Layout */
.wmm-products-list {
    width: 100%;
    padding: 10px;
}

.wmm-list-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 3 equal columns */
    gap: 20px;
    height: 100%;
}

.wmm-list-column {
    height: 100%;
}

.wmm-list-column-1,
.wmm-list-column-2 {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wmm-list-column-3 {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.wmm-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 20px !important;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.wmm-list-item:last-child {
    border-bottom: none;
}

.wmm-list-link {
    font-size: 16px;
    color: #222;
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.wmm-list-link:hover {
    background: #f0f8ff;
    color: #34A648;
}

.wmm-category-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    object-fit: cover;
    margin-top: 10px;
}

.wmm-view-all-container {
    grid-column: 1 / -1; /* Span all columns */
    text-align: center;
    padding: 20px 0;
}

.wmm-view-all-btn {
    padding: 10px 20px;
    background: #34A648;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.wmm-view-all-btn:hover {
    background: #2d8a3d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.4s ease-in;
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(15px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Optional fade + slide */
.fade-in {
    animation: fadeIn 0.35s ease-in;
}

.slide-in {
    animation: slideIn 0.35s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(10px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Scrollbars optional */
.wmm-cat-list::-webkit-scrollbar,
.wmm-product-panel::-webkit-scrollbar {
    width: 6px;
}

.wmm-cat-list::-webkit-scrollbar-thumb,
.wmm-product-panel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.wmm-product {
    animation: fadeUp 0.35s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Menu Styles */
ul#wmm-mobile-container.wmm-mobile-menu {
    width: 100%;
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
}

ul#wmm-mobile-container.wmm-mobile-menu li.wmm-mobile-toggle-item {
    list-style: none;
    width: 100%;
}

ul#wmm-mobile-container.wmm-mobile-menu li.wmm-mobile-wrapper-item {
    list-style: none;
    width: 100%;
}

#wmm-mobile-toggle {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0;
    margin-bottom: 0;
    position: relative;
    top: 2px;
    padding: 12px 16px;
    background: #34A648;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: 0.25s;
    border: none;
}

#wmm-mobile-toggle:hover {
    background: #34A648;
}

#wmm-mobile-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #fff;
    border: none;
    box-shadow: none;
    z-index: 99999;
    display: none;
    overflow-y: auto;
}
    
.wmm-mobile-cart-summary {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
}
    
.wmm-cart-items, .wmm-cart-total, .wmm-cart-weight {
    text-align: center;
}
    
.wmm-cart-label {
    display: block;
    font-weight: bold;
    color: #333;
}
    
.wmm-cart-value {
    display: block;
    color: #34A648;
    font-weight: bold;
}

.wmm-mobile-cart-summary {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
}

.wmm-cart-items, .wmm-cart-total, .wmm-cart-weight {
    text-align: center;
}

.wmm-cart-label {
    display: block;
    font-weight: bold;
    color: #333;
}

.wmm-cart-value {
    display: block;
    color: #34A648;
    font-weight: bold;
}

ul#wmm-mobile-container.wmm-mobile-menu.show #wmm-mobile-wrapper {
    display: block;
}

.wmm-mobile-cat-list {
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
    margin-bottom: 50px;
}

.wmm-mobile-cat-item {
    list-style: none;
    border-bottom: 1px solid #eee;
    position: relative;
}

.wmm-mobile-cat-link {
    display: block;
    padding: 10px 20px;
    font-size: 18px;
    color: #fff;
    background: #34A648;
    text-decoration: none;
    position: relative;
}

.wmm-mobile-cat-link::after {
    content: '\25BC'; /* Down arrow */
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    transition: transform 0.3s ease;
}

.wmm-mobile-cat-item.expanded .wmm-mobile-cat-link::after {
    transform: translateY(-50%) rotate(180deg);
}

.wmm-mobile-products-list {
    padding: 0;
    margin: 0;
    list-style: none;
    background-color: #f9f9f9;
}

.wmm-mobile-products-list li {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wmm-mobile-product-item {
    justify-content: space-between;
    align-items: center;
    padding: 5px 20px !important;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.wmm-mobile-product-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 20px !important;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.wmm-mobile-product-item:last-child {
    border-bottom: none;
}

.wmm-mobile-product-item a {
    display: block;
    font-size: 16px;
    color: #444;
    text-decoration: none;
    flex-grow: 1;
    padding: 0;
}

.wmm-mobile-product-item a:hover {
    background-color: transparent;
    color: #34A648;
}

.wmm-mobile-product-item .wmm-mobile-cart-btn {
    margin-left: 10px;
    flex-shrink: 0;
}

.loading {
    padding: 12px 40px;
    font-size: 16px;
    color: #666;
    font-style: italic;
}

/* Desktop Styles - Normal behavior */
@media (min-width: 769px) {
    ul#wmm-container.wmm-desktop-menu {
        display: block;
    }
    
    /* Hide mobile menu on desktop */
    ul#wmm-mobile-container.wmm-mobile-menu {
        display: none;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* Hide desktop menu on mobile */
    ul#wmm-container.wmm-desktop-menu {
        display: none;
    }
    
    /* Show mobile menu on mobile */
    ul#wmm-mobile-container.wmm-mobile-menu {
        display: block;
    }
    
    /* Full screen menu on mobile */
    ul#wmm-container.wmm-desktop-menu.show #wmm-wrapper {
        position: fixed;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border: none;
        border-radius: 0;
        box-shadow: none;
        transform: translateY(0) !important;
        display: block;
        z-index: 99999; /* Higher z-index to ensure it's on top */
    }
    
    /* Only show category list on mobile */
    .wmm-cat-list {
        width: 100% !important;
        max-height: 100vh !important;
        height: 100vh !important;
        border-right: none;
        padding: 20px;
        overflow-y: auto;
        padding-top: 60px; /* Space for close button */
    }
    
    /* Hide product panel on mobile */
    .wmm-product-panel {
        display: none !important;
    }
    
    /* Mobile category item styles */
    .wmm-cat-item {
        padding: 16px 20px;
        font-size: 18px;
        border-bottom: 1px solid #eee;
        border-left: none;
        margin-bottom: 10px;
        border-radius: 8px;
    }
    
    .wmm-cat-item:hover {
        padding-left: 20px; /* No extra padding on hover for mobile */
        border-left: none;
    }
    
    .wmm-cat-item.active {
        border-left: none;
        border-right: 4px solid #34A648; /* Right border instead of left for mobile */
    }
    
    /* Close button for mobile */
    .wmm-mobile-close {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #666;
        z-index: 100000; /* Even higher z-index for close button */
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 5px;
        background-color: #f0f0f0;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    
    .wmm-mobile-close:hover {
        background-color: #e0e0e0;
    }
    
    .wmm-product {
        flex-direction: row;
        align-items: flex-start;
    }

    .wmm-img {
        width: 60px;
        height: 60px;
    }
    
    .all-products-link {
        font-size: 16px;
    }
    
    .all-products-link .arrow {
        font-size: 20px;
    }
    
    /* Mobile list style */
    .wmm-list-container {
        grid-template-columns: 1fr; /* Single column on mobile */
        grid-template-rows: auto auto auto; /* Three rows */
    }
    
    .wmm-list-column-1,
    .wmm-list-column-2,
    .wmm-list-column-3 {
        grid-column: 1; /* All columns in single column layout */
    }
    
    .wmm-list-column-1 {
        grid-row: 1;
    }
    
    .wmm-list-column-2 {
        grid-row: 2;
    }
    
    .wmm-list-column-3 {
        grid-row: 3;
        margin-top: 20px;
    }
    
    .wmm-view-all-container {
        grid-column: 1; /* Single column on mobile */
    }
    
    /* Mobile cart button styles */
    .wmm-mobile-cart-btn {
        display: block;
        padding: 8px 12px;
        background: #34A648;
        color: #fff;
        border: none;
        border-radius: 4px;
        font-size: 14px;
        text-align: center;
        cursor: pointer;
        white-space: nowrap;
        min-width: 120px;
    }
    
    .wmm-mobile-cart-btn:hover {
        background: #2d8a3c;
    }
    
    .wmm-mobile-cart-btn.adding {
        opacity: 0.7;
        cursor: not-allowed;
        position: relative;
    }
    
    .wmm-mobile-cart-btn.adding::after {
        content: "";
        position: absolute;
        width: 12px;
        height: 12px;
        margin: auto;
        border: 2px solid transparent;
        border-top-color: #ffffff;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
    }
    
    .wmm-mobile-cart-btn.added {
        background: #4CAF50;
        min-width: 40px;
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
    }
    
    .wmm-mobile-cart-btn.error {
        background: #f44336;
    }
    
    .wmm-mobile-cart-btn.out-of-stock {
        background: #ccc;
        cursor: not-allowed;
    }
    
    .wmm-mobile-cart-btn.backorder {
        background: #ff9800;
    }
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.wmm-mini-cart__quantity-badge svg {
    color: #fff !important;
    fill: #fff !important;
}
.wmm-mini-cart__icon {
    display: block;
    height: 2em;
    margin: -.25em;
    width: 2em;
}

.wmm-mobile-action-buttons {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.wmm-view-cart-btn, .wmm-checkout-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    flex: 1;
    margin: 0 5px;
}

.wmm-view-cart-btn {
    background: #34A648;
    color: white;
}

.wmm-checkout-btn {
    background: #ff9800;
    color: white;
}

.wmm-view-cart-btn:hover, .wmm-checkout-btn:hover {
    opacity: 0.9;
}