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

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

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

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

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

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

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

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

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

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

.cmpl-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;
}
.cmpl-menu__dates::-webkit-scrollbar { display: none; }

.cmpl-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(--cmpl-line);
    border-radius: 12px;
    background: var(--cmpl-card);
    text-decoration: none;
    transition: all .2s;
    cursor: pointer;
}
.cmpl-menu__day-name {
    font-family: var(--cmpl-font-head) !important;
    font-size: 14px;
    color: var(--cmpl-muted);
}
.cmpl-menu__day-num {
    font-family: var(--cmpl-font-head) !important;
    font-weight: 700;
    font-size: 18px;
    color: var(--cmpl-text);
}
.cmpl-menu__date:hover { border-color: var(--cmpl-primary); }
.cmpl-menu__date.is-active {
    background: var(--cmpl-primary);
    border-color: var(--cmpl-primary-dark);
}
.cmpl-menu__date.is-active .cmpl-menu__day-name,
.cmpl-menu__date.is-active .cmpl-menu__day-num { color: var(--cmpl-text); }

/* chevrony wewnątrz karty dat */
.cmpl-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;
}
.cmpl-menu__datenav:hover,
.cmpl-menu__datenav:focus,
.cmpl-menu__datenav:active { opacity: 1; background-color: transparent; outline: none; }
.cmpl-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"); }
.cmpl-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 ---- */
.cmpl-menu__meals-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cmpl-menu__arrow {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: var(--cmpl-card) no-repeat center / 10px 18px;
    box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .3);
    cursor: pointer;
    transition: transform .15s;
}
.cmpl-menu__arrow:hover { transform: scale(1.05); }
.cmpl-menu__arrow:hover,
.cmpl-menu__arrow:focus,
.cmpl-menu__arrow:active { background-color: var(--cmpl-card); outline: none; }
.cmpl-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"); }
.cmpl-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"); }

.cmpl-menu__meals {
    display: flex;
    gap: var(--cmpl-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;
}
.cmpl-menu__meals::-webkit-scrollbar { display: none; }
.cmpl-menu__meals.is-loading { opacity: .5; pointer-events: none; }

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

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

.cmpl-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. */
.cmpl-menu .cmpl-dish .cmpl-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;
}

.cmpl-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;
}
.cmpl-dish__name {
    margin: 0;
    text-align: center;
    font-family: var(--cmpl-font-body) !important;
    font-size: 16px;
    line-height: 1.4;
    color: var(--cmpl-text);
}

/* ---- Strzałki pod kartą (mobile) ---- */
.cmpl-menu__arrows-mobile {
    display: none;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}
.cmpl-menu__marrow {
    width: 48px;
    height: 48px;
    border: 1.5px solid var(--cmpl-primary);
    border-radius: 12px;
    background: var(--cmpl-card) no-repeat center / 11px 20px;
    cursor: pointer;
}
.cmpl-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"); }
.cmpl-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"); }
.cmpl-menu__marrow:hover,
.cmpl-menu__marrow:focus,
.cmpl-menu__marrow:active { background-color: var(--cmpl-card); outline: none; }

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

/* ---- Przycisk (opcjonalny) ---- */
.cmpl-menu__cta-wrap {
    display: flex;
    justify-content: center;
    margin-top: 36px;
}
.cmpl-menu__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 48px;
    border-radius: 999px;
    background: var(--cmpl-accent);
    color: #fff;
    font-family: var(--cmpl-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;
}
.cmpl-menu__cta:hover,
.cmpl-menu__cta:focus,
.cmpl-menu__cta:active { color: #fff; background-color: var(--cmpl-accent-hover); }

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

/* Mobile (breakpoint Elementora 767px): 1 karta + podgląd następnej */
@media (max-width: 767px) {
    .cmpl-menu__dates { justify-content: flex-start; }

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

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

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