/* ==========================================================================
   MAMA Menu Manager — frontend menu display
   Uses the same brand hex as fallback for --mama-* vars, so it looks right
   whether or not the MAMA Luxury Hero child theme is also active.
   ========================================================================== */

.mama-menu{ --mm-gold: var(--mama-gold, #D4AF37); --mm-brown: var(--mama-brown, #2A1B10); }

.mama-menu__search{ max-width: 340px; margin: 0 0 20px; }
.mama-menu__search-input{
    width: 100%;
    padding: 11px 16px;
    border: 1px solid #e0d8c8;
    border-radius: 6px;
    font-size: 14px;
}
.mama-menu__search-input:focus{ outline: none; border-color: var(--mm-gold); box-shadow: 0 0 0 3px rgba(212,175,55,.15); }

.mama-menu__tabs{
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e8e0d0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}
.mama-menu__tab{
    flex: 0 0 auto;
    padding: 10px 18px;
    border-radius: 20px;
    border: 1px solid #e0d8c8;
    background: #fff;
    color: #5a4a3a;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
    min-height: 40px;
}
.mama-menu__tab:hover{ border-color: var(--mm-gold); color: var(--mm-brown); }
.mama-menu__tab.is-active{ background: var(--mm-brown); border-color: var(--mm-brown); color: var(--mm-gold); }

.mama-menu__mobile-select-label{
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}
.mama-menu__mobile-select{
    display: none; /* shown only on mobile — see media query below */
    width: 100%;
    margin-bottom: 20px;
    padding: 13px 40px 13px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--mm-brown);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232A1B10' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    border: 1px solid #e0d8c8;
    border-radius: 8px;
    appearance: none;
    -webkit-appearance: none;
    min-height: 48px;
}
.mama-menu__mobile-select:focus{ outline: none; border-color: var(--mm-gold); box-shadow: 0 0 0 3px rgba(212,175,55,.15); }

.mama-menu__panel{ display: none; }
.mama-menu__panel.is-active{ display: block; }

.mama-menu__grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}

.mama-menu__card{
    background: #fff;
    border: 1px solid #eee3d0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease;
}
.mama-menu__card:hover{ transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.08); }
.mama-menu__card[hidden]{ display: none; }

.mama-menu__card-image{ display: block; position: relative; aspect-ratio: 4/3; overflow: hidden; background: #f3ede1; }
.mama-menu__card-image img{ width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.mama-menu__card:hover .mama-menu__card-image img{ transform: scale(1.06); }

.mama-menu__badge{
    position: absolute;
    top: 10px; left: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 4px 9px;
    border-radius: 4px;
    background: var(--mm-gold);
    color: var(--mm-brown);
}
.mama-menu__badge--chefs_special{ background: var(--mm-brown); color: var(--mm-gold); }
.mama-menu__badge--new{ background: #2E7D32; color: #fff; }

.mama-menu__card-body{ padding: 16px; }
.mama-menu__card-title{
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #221a12;
    text-decoration: none;
    margin-bottom: 4px;
}
.mama-menu__card-title:hover{ color: var(--mm-gold); }
.mama-menu__card-desc{ font-size: 13px; color: #766a5a; line-height: 1.5; margin: 0 0 10px; }

.mama-menu__meta{ display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mama-menu__meta-item{
    font-size: 11px;
    color: #6f6252;
    background: #f6f1e6;
    padding: 3px 8px;
    border-radius: 4px;
}
.mama-menu__meta-item--spice{ color: #a32d2d; background: #fbeaea; }

.mama-menu .mama-menu__card-footer{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.mama-menu__price{ font-size: 16px; font-weight: 700; color: #B8912B; }
.mama-menu__price del{ color: #b8ada0; font-weight: 400; font-size: 13px; margin-right: 4px; }
.mama-menu__price ins{ text-decoration: none; }

/* WooCommerce's own add-to-cart button, restyled to match.
   Selector specificity deliberately raised (vs. a plain .add_to_cart_button)
   so this reliably wins over the theme's generic a.button styling regardless
   of stylesheet load order, and height is fixed (not padding-driven) so it
   can't be inflated by inherited line-height. */
.mama-menu .mama-menu__card-footer a.add_to_cart_button,
.mama-menu .mama-menu__card-footer a.button{
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    max-width: max-content !important;
    height: 30px !important;
    min-height: 0 !important;
    background: var(--mm-gold) !important;
    color: var(--mm-brown) !important;
    border: none !important;
    border-radius: 5px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    line-height: 1 !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: .02em;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
    white-space: nowrap;
    box-sizing: border-box !important;
    flex: 0 0 auto;
}
.mama-menu__card-footer .add_to_cart_button:hover{ transform: translateY(-2px); box-shadow: 0 8px 18px rgba(212,175,55,.35); }
.mama-menu__card-footer .added_to_cart{
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    color: #2E7D32;
}

.mama-menu__no-results{ text-align: center; color: #888; padding: 40px 0; }
.mama-menu__empty-category{ text-align: center; color: #a89a86; font-style: italic; padding: 40px 0; }

@media (max-width: 600px){
    .mama-menu__tabs{ display: none; }
    .mama-menu__mobile-select{ display: block; }

    .mama-menu__grid{
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .mama-menu__card{
        display: flex;
        flex-direction: row;
        align-items: stretch;
    }
    .mama-menu__card:hover{ transform: none; } /* lift animation doesn't make sense in a list row */

    .mama-menu__card-image{
        flex: 0 0 92px;
        width: 92px;
        aspect-ratio: 1;
    }
    .mama-menu__badge{
        font-size: 8.5px;
        padding: 2px 5px;
        top: 5px; left: 5px;
    }

    .mama-menu__card-body{
        flex: 1;
        min-width: 0; /* allow text truncation inside a flex child */
        padding: 8px 12px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
    }
    .mama-menu__card-title{
        font-size: 14px;
        margin-bottom: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mama-menu__card-desc{
        font-size: 12px;
        margin: 0;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .mama-menu__meta{ display: none; } /* spice/prep/dietary tags — too much detail for a compact row; still visible on the product's own page */

    .mama-menu__card-footer{ margin-top: 2px; }
    .mama-menu__price{ font-size: 14px; }

    .mama-menu__tab{ padding: 8px 14px; font-size: 12px; min-height: 44px; }
    .mama-menu__search-input{ min-height: 44px; font-size: 16px; } /* 16px prevents iOS auto-zoom on focus */
    .mama-menu .mama-menu__card-footer a.add_to_cart_button,
    .mama-menu .mama-menu__card-footer a.button{ height: 34px !important; padding: 0 12px !important; font-size: 10.5px !important; }
    /* if your theme has a fixed/sticky site header, set this to its height
       (in px) so the sticky category tabs don't hide underneath it */
    .mama-menu__tabs{ top: var(--mama-sticky-header-offset, 0px); }
}
