/* Misuji Menu Widget — v3 with modal & inline qty */

.mmw-menu {
    width: 100%;
}

/* ── Filters ── */
.mmw-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.mmw-filter {
    padding: 6px 16px;
    border: 1.5px solid #d0d0d0;
    border-radius: 20px;
    background: transparent;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.mmw-filter:hover {
    border-color: #999;
    color: #333;
}

.mmw-filter.active {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}

/* ── Category ── */
.mmw-category {
    margin-bottom: 56px;
}

.mmw-category-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 24px 0;
    padding-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    border: none;
}

.mmw-category-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 3px;
    background-color: #c0392b;
    border-radius: 2px;
}

.mmw-category-desc {
    font-size: 14px;
    color: #999;
    margin: -12px 0 24px 0;
    font-style: italic;
}

/* ── Products list ── */
.mmw-products {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mmw-products.mmw-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 48px;
}

/* ── Product item ── */
.mmw-product {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #e8e8e8;
}

.mmw-product:last-child {
    border-bottom: none;
}

/* ── Product image (clickable → modal) ── */
.mmw-product-image {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.mmw-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.mmw-product-image:hover img {
    transform: scale(1.15);
}

/* ── Placeholder ── */
.mmw-placeholder {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

.mmw-placeholder svg {
    width: 32px;
    height: 32px;
}

/* ── Product info ── */
.mmw-product-info {
    flex: 1;
    min-width: 0;
}

.mmw-product-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.mmw-product-name-wrap {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.mmw-product-name {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    color: #1a1a1a;
}

.mmw-product-name.mmw-open-modal {
    cursor: pointer;
}

.mmw-product-name.mmw-open-modal:hover {
    text-decoration: underline;
}


.mmw-product-price {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    color: #c0392b;
    flex-shrink: 0;
}

.mmw-product-desc {
    font-size: 13px;
    line-height: 1.5;
    color: #888;
    margin-top: 2px;
}

.mmw-product-desc p {
    margin: 0;
}

/* ── Diet badges ── */
.mmw-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.mmw-badge-vegetarien {
    background: #e8f5e9;
    color: #2e7d32;
}

.mmw-badge-vegan {
    background: #e0f2f1;
    color: #00695c;
}

/* Badge tooltip */
.mmw-badge {
    position: relative;
    cursor: default;
    text-decoration: none !important;
}

.mmw-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.3;
}

.mmw-badge:hover::after {
    opacity: 1;
}

/* ── Cart controls (inline) ── */
.mmw-cart-controls {
    flex-shrink: 0;
}

.mmw-menu .mmw-add-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    border-radius: 50%;
    background: transparent;
    color: #c0392b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    border: 1.5px solid #c0392b;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.mmw-menu .mmw-add-btn svg {
    width: 13px;
    height: 13px;
    display: block;
}

.mmw-menu .mmw-add-btn:hover {
    background: #c0392b;
    color: #fff;
}

/* Quantity pill controls */
.mmw-qty-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid #c0392b;
    border-radius: 14px;
    overflow: hidden;
    background: transparent;
}

.mmw-menu .mmw-qty-btn {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border: none;
    background: transparent;
    color: #c0392b;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
}

.mmw-menu .mmw-qty-btn:hover {
    background: #c0392b;
    color: #fff;
}

.mmw-qty-value {
    min-width: 20px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #c0392b;
    user-select: none;
}

/* ── Hide WC "View cart" links ── */
.mmw-menu .added_to_cart {
    display: none !important;
}

/* ══════════════════════════════════
   Modal
   ══════════════════════════════════ */
.mmw-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.mmw-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: mmw-modal-in 0.25s ease;
}

@keyframes mmw-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.mmw-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.mmw-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Modal image */
.mmw-modal-image-wrap {
    width: 100%;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    line-height: 0;
}

.mmw-modal-image {
    width: 100%;
    display: block;
}

/* Modal body */
.mmw-modal-body {
    padding: 12px 24px 24px;
}

.mmw-modal-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #999;
    margin-bottom: 4px;
}

.mmw-modal-category:empty {
    display: none;
}

.mmw-modal-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mmw-modal-badges:empty {
    display: none;
}

.mmw-modal-badges .mmw-badge {
    font-size: 11px;
    padding: 3px 7px;
}

.mmw-modal-name {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1a1a1a;
}

.mmw-modal-price {
    font-size: 18px;
    font-weight: 600;
    color: #c0392b;
    margin-bottom: 12px;
}

.mmw-modal-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 24px;
}

.mmw-modal-desc:empty {
    display: none;
}

.mmw-modal-desc p {
    margin: 0;
}

/* Modal actions */
.mmw-modal-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mmw-modal-qty {
    display: flex;
    align-items: center;
    gap: 0;
    background: #f5f5f5;
    border-radius: 24px;
    overflow: hidden;
    flex-shrink: 0;
}

.mmw-modal-qty .mmw-qty-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 18px;
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 0;
}

.mmw-modal-qty .mmw-qty-btn:hover {
    background: #ccc;
    color: #111;
}

.mmw-modal-qty-value {
    min-width: 36px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    user-select: none;
}

.mmw-modal-add-to-cart {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 24px;
    background: #c0392b;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    padding: 0 24px;
}

.mmw-modal-add-to-cart:hover {
    background: #a5311f;
}

.mmw-modal-add-to-cart:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .mmw-products.mmw-cols-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .mmw-category-title {
        font-size: 22px;
        letter-spacing: 1.5px;
    }

    .mmw-product-image {
        width: 60px;
        height: 60px;
    }

    .mmw-product-name {
        font-size: 15px;
    }

    .mmw-product-price {
        font-size: 14px;
    }

    /* Modal mobile */
    .mmw-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .mmw-modal {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
        animation: mmw-modal-in-mobile 0.3s ease;
    }

    @keyframes mmw-modal-in-mobile {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .mmw-modal-image-wrap {
        border-radius: 16px 16px 0 0;
    }

    .mmw-modal-body {
        padding: 20px;
    }

    .mmw-modal-name {
        font-size: 20px;
    }

    .mmw-modal-actions {
        flex-direction: column;
        gap: 12px;
    }

    .mmw-modal-add-to-cart {
        width: 100%;
    }
}
