/* =========================================================================
   Caterings Menu PL — widget Elementora
   Kolory/fonty z systemu „new" (--pom-*) z fallbackami.
   Dieta wybierana w widgecie (bez paska diet). Liczba kart na desktop: --cmtpl-visible.
   ========================================================================= */

.cmtpl-menu {
    /* mapowanie na system „new" (fallbacki, gdyby brak globalnego CSS) */
    --cmtpl-primary:      var(--pom-primary-500, #c8c84a);
    --cmtpl-primary-dark: var(--pom-primary-600, #b3b33f);
    --cmtpl-accent:       var(--pom-accent-600, #d91b36);
    --cmtpl-accent-hover: var(--pom-accent-700, #b3162d);
    --cmtpl-badge-bg:     var(--pom-badge-category-bg, #bfe8ff);
    --cmtpl-badge-text:   var(--pom-badge-category-text, #1f5d8a);
    --cmtpl-text:         var(--pom-neutral-800, #333333);
    --cmtpl-muted:        var(--pom-neutral-700, #595959);
    --cmtpl-line:         var(--pom-neutral-300, #efefef);
    --cmtpl-card:         var(--pom-neutral-100, #ffffff);
    --cmtpl-font-head:    var(--pom-font-heading, 'Rubik', sans-serif);
    --cmtpl-font-body:    var(--pom-font-body, 'Montserrat', sans-serif);

    --cmtpl-visible: 3;   /* nadpisywane inline z widgetu */
    --cmtpl-gap: 40px;    /* odstęp między kartami (desktop) */

    padding: 40px 0;
    box-sizing: border-box;
    font-family: var(--cmtpl-font-body) !important;
    color: var(--cmtpl-text);
}

.cmtpl-menu *,
.cmtpl-menu *::before,
.cmtpl-menu *::after { box-sizing: border-box; }

.cmtpl-menu__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---- Nagłówek ---- */
.cmtpl-menu__title {
    margin: 0 0 16px;
    text-align: center;
    font-family: var(--cmtpl-font-head) !important;
    font-weight: 700;
    font-size: 40px;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--cmtpl-text);
}

.cmtpl-menu__subtitle {
    max-width: 820px;
    margin: 0 auto 28px;
    text-align: center;
    font-family: var(--cmtpl-font-body) !important;
    font-size: 18px;
    line-height: 1.5;
    color: var(--cmtpl-muted);
}

/* ---- Przełącznik diet ---- */
.cmtpl-menu__dietbar { margin: 0 0 32px; }

.cmtpl-menu__dietbar-label {
    margin: 0 0 12px;
    text-align: center;
    font-family: var(--cmtpl-font-head) !important;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
    color: var(--cmtpl-text);
}

.cmtpl-menu__pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 1240px;
    margin: 0 auto;
}

.cmtpl-menu .cmtpl-pill {
    padding: 10px 18px;
    border: 1px solid #dcdcdc;
    border-radius: 999px;
    background: var(--cmtpl-card);
    font-family: var(--cmtpl-font-head) !important;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.2;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--cmtpl-text);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.cmtpl-menu .cmtpl-pill:hover,
.cmtpl-menu .cmtpl-pill:focus {
    background-color: var(--cmtpl-card);
    border-color: var(--cmtpl-primary);
    color: var(--cmtpl-text);
    outline: none;
    box-shadow: none;
}
.cmtpl-menu .cmtpl-pill.is-active,
.cmtpl-menu .cmtpl-pill.is-active:hover,
.cmtpl-menu .cmtpl-pill.is-active:focus,
.cmtpl-menu .cmtpl-pill.is-active:active {
    background-color: var(--cmtpl-primary);
    border-color: var(--cmtpl-primary-dark);
    color: var(--cmtpl-text);
    font-weight: 700;
}

/* select diet — tylko mobile */
.cmtpl-menu__selectwrap { display: none; }
.cmtpl-menu .cmtpl-menu__select {
    width: 100%;
    padding: 14px 44px 14px 16px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    background: var(--cmtpl-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10' fill='none'%3E%3Cpath d='M1 1l7 7 7-7' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center / 16px 10px;
    -webkit-appearance: none;
    appearance: none;
    font-family: var(--cmtpl-font-head) !important;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
    color: var(--cmtpl-text);
    cursor: pointer;
}
.cmtpl-menu .cmtpl-menu__select:focus { outline: none; border-color: var(--cmtpl-primary); }

/* ---- Karta wyboru daty ---- */
.cmtpl-menu__datecard {
    max-width: 684px;
    margin: 0 auto 40px;
    padding: 8px 12px 12px;
    background: var(--cmtpl-card);
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 16px;
    box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .15);
}

.cmtpl-menu__month {
    padding-left: 34px;
    margin-bottom: 6px;
    font-family: var(--cmtpl-font-head) !important;
    font-size: 14px;
    color: var(--cmtpl-text);
}

.cmtpl-menu__dates-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cmtpl-menu__dates {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: safe center;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cmtpl-menu__dates::-webkit-scrollbar { display: none; }

.cmtpl-menu__date {
    flex: 0 0 auto;
    scroll-snap-align: center;
    width: 62px;
    padding: 8px 4px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: 1.5px solid var(--cmtpl-line);
    border-radius: 12px;
    background: var(--cmtpl-card);
    text-decoration: none;
    transition: all .2s;
    cursor: pointer;
}
.cmtpl-menu__day-name {
    font-family: var(--cmtpl-font-head) !important;
    font-size: 14px;
    color: var(--cmtpl-muted);
}
.cmtpl-menu__day-num {
    font-family: var(--cmtpl-font-head) !important;
    font-weight: 700;
    font-size: 18px;
    color: var(--cmtpl-text);
}
.cmtpl-menu__date:hover { border-color: var(--cmtpl-primary); }
.cmtpl-menu__date.is-active {
    background: var(--cmtpl-primary);
    border-color: var(--cmtpl-primary-dark);
}
.cmtpl-menu__date.is-active .cmtpl-menu__day-name,
.cmtpl-menu__date.is-active .cmtpl-menu__day-num { color: var(--cmtpl-text); }

/* chevrony wewnątrz karty dat */
.cmtpl-menu__datenav {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent no-repeat center / 12px 20px;
    cursor: pointer;
    opacity: .55;
    transition: opacity .2s;
}
.cmtpl-menu__datenav:hover,
.cmtpl-menu__datenav:focus,
.cmtpl-menu__datenav:active { opacity: 1; background-color: transparent; outline: none; }
.cmtpl-menu__datenav--prev { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='20' viewBox='0 0 12 20' fill='none'%3E%3Cpath d='M11 1L2 10l9 9' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.cmtpl-menu__datenav--next { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='20' viewBox='0 0 12 20' fill='none'%3E%3Cpath d='M1 1l9 9-9 9' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* ---- Dania + strzałki zewnętrzne ---- */
.cmtpl-menu__meals-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cmtpl-menu__arrow {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: var(--cmtpl-card) no-repeat center / 10px 18px;
    box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .3);
    cursor: pointer;
    transition: transform .15s;
}
.cmtpl-menu__arrow:hover { transform: scale(1.05); }
.cmtpl-menu__arrow:hover,
.cmtpl-menu__arrow:focus,
.cmtpl-menu__arrow:active { background-color: var(--cmtpl-card); outline: none; }
.cmtpl-menu__arrow--prev { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='18' viewBox='0 0 10 18' fill='none'%3E%3Cpath d='M9 1L1 9l8 8' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.cmtpl-menu__arrow--next { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='18' viewBox='0 0 10 18' fill='none'%3E%3Cpath d='M1 1l8 8-8 8' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

.cmtpl-menu__meals {
    display: flex;
    gap: var(--cmtpl-gap);
    flex: 1;
    min-width: 0;               /* pozwala flex-item się kurczyć w kolumnie 3/4 */
    align-items: stretch;       /* karty równej wysokości (nadmiar na dole krótszych) */
    justify-content: flex-start;
    padding: 24px 2px 8px;
    min-height: 300px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    transition: opacity .3s;
}
.cmtpl-menu__meals::-webkit-scrollbar { display: none; }
.cmtpl-menu__meals.is-loading { opacity: .5; pointer-events: none; }

/* ---- Karta dania ---- */
/* Szerokość = dokładnie tyle, by zmieściło się --cmtpl-visible kart (bez ucinania). */
.cmtpl-dish {
    position: relative;
    flex: 0 0 calc((100% - (var(--cmtpl-visible, 3) - 1) * var(--cmtpl-gap)) / var(--cmtpl-visible, 3));
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: var(--cmtpl-card);
    border: 2px solid var(--cmtpl-primary);
    border-radius: 16px;
    box-shadow: 0 3px 4px rgba(0, 0, 0, .10);
}

.cmtpl-dish__badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    padding: 4px 16px;
    border-radius: 999px;
    background: var(--cmtpl-badge-bg);
    color: var(--cmtpl-badge-text);
    font-family: var(--cmtpl-font-head) !important;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
}

.cmtpl-dish__top {
    padding: 18px 12px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}
/* Mocna reguła + !important, by pobić ewentualne img{height:auto/max-*} motywu. */
.cmtpl-menu .cmtpl-dish .cmtpl-dish__img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 174px !important;
    object-fit: contain !important;
    object-position: center;
}

.cmtpl-dish__bottom {
    flex: 0 0 auto;              /* nie rośnie -> brak dziury; tekst pod zdjęciem */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 14px 16px 22px;
}
.cmtpl-dish__name {
    margin: 0;
    text-align: center;
    font-family: var(--cmtpl-font-body) !important;
    font-size: 16px;
    line-height: 1.4;
    color: var(--cmtpl-text);
}

/* ---- Strzałki pod kartą (mobile) ---- */
.cmtpl-menu__arrows-mobile {
    display: none;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}
.cmtpl-menu__marrow {
    width: 48px;
    height: 48px;
    border: 1.5px solid var(--cmtpl-primary);
    border-radius: 12px;
    background: var(--cmtpl-card) no-repeat center / 11px 20px;
    cursor: pointer;
}
.cmtpl-menu__marrow--prev { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='20' viewBox='0 0 11 20' fill='none'%3E%3Cpath d='M10 1L2 10l8 9' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.cmtpl-menu__marrow--next { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='20' viewBox='0 0 11 20' fill='none'%3E%3Cpath d='M1 1l8 9-8 9' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.cmtpl-menu__marrow:hover,
.cmtpl-menu__marrow:focus,
.cmtpl-menu__marrow:active { background-color: var(--cmtpl-card); outline: none; }

/* ---- Błąd ---- */
.cmtpl-menu__error {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cmtpl-menu__error[hidden] { display: none; }
.cmtpl-menu__error h3 { text-align: center; color: var(--cmtpl-muted); }

/* ---- Przycisk (opcjonalny) ---- */
.cmtpl-menu__cta-wrap {
    display: flex;
    justify-content: center;
    margin-top: 36px;
}
.cmtpl-menu__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 48px;
    border-radius: 999px;
    background: var(--cmtpl-accent);
    color: #fff;
    font-family: var(--cmtpl-font-head) !important;
    font-weight: 700;
    font-size: 20px;
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .35);
    transition: background-color .2s, filter .2s;
}
.cmtpl-menu__cta:hover,
.cmtpl-menu__cta:focus,
.cmtpl-menu__cta:active { color: #fff; background-color: var(--cmtpl-accent-hover); }

/* ---- Responsywność ---- */
@media (max-width: 960px) {
    .cmtpl-menu__title { font-size: 28px; }
}

/* Mobile (breakpoint Elementora 767px): 1 karta + podgląd następnej */
@media (max-width: 767px) {
    .cmtpl-menu__subtitle { font-size: 16px; }

    /* przełącznik diet: pigułki → select */
    .cmtpl-menu__pills { display: none; }
    .cmtpl-menu__selectwrap { display: block; }
    .cmtpl-menu__dietbar-label { text-align: left; font-size: 20px; }

    .cmtpl-menu__dates { justify-content: flex-start; }

    /* strzałki boczne → wyśrodkowane pod kartą */
    .cmtpl-menu__arrow { display: none; }
    .cmtpl-menu__arrows-mobile { display: flex; }
    .cmtpl-menu__meals-wrap { gap: 0; }

    .cmtpl-menu__meals { justify-content: flex-start; gap: 16px; padding-left: 4px; padding-right: 4px; }
    .cmtpl-dish { flex: 0 0 min(80vw, 320px); }   /* ignoruje --cmtpl-visible na mobile */

    .cmtpl-menu__cta { width: 100%; }
}
