/* M16 Porównywarka — część globalna: pływający pasek, komunikat, dodatki do popupu.
   Kolory jak w m16-theme.css: zieleń #93c13d / #7da62f, tekst #28301e, ramki #e4e7de, tło #f5f6f2. */

/* ---------- popup (oprawa z sekcji 54 m16-theme.css) ---------- */
#compareModal .m16c-modal__msg { margin: 6px 0 0; }
#compareModal .m16c-modal__group { margin: 6px 0 0; font-size: 13px; color: #6b7263; }
#compareModal .m16c-modal--error::before { content: "\e911"; background: #fdf0ee; box-shadow: inset 0 0 0 2px #e0775f; color: #c4512f; }
#compareModal .m16c-modal--error .m16c-modal__msg { color: #8a3a22; }
#compareModal .m16c-modal__continue {
    margin: 12px 0 0;
    padding: 6px 10px;
    border: 0;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #565655;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
#compareModal .m16c-modal__continue:hover { color: #28301e; }

/* ---------- przycisk „Dodaj do porównania” na karcie produktu: stan „w porównaniu” ---------- */
.product-actions .compare-button.m16c-on,
.product-additional-info .compare-button.m16c-on {
    color: #7da62f;
}

/* ---------- pływający pasek ---------- */
.m16c-bar {
    position: fixed;
    right: 16px;
    bottom: 20px;
    z-index: 98;
    font-size: 14px;
    color: #28301e;
}
.m16c-bar__panel {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 10px 10px 16px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 32px rgba(29, 37, 24, .22), 0 0 0 1px #e4e7de;
}
.m16c-bar__head {
    display: flex;
    align-items: center;
    gap: 8px;
}
.m16c-bar__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f2f7e8;
    box-shadow: inset 0 0 0 2px #93c13d;
    color: #7a9d3f;
}
.m16c-bar__icon::before {
    content: "\e911";
    font-family: "roadthemes-icon";
    font-size: 16px;
    line-height: 1;
}
.m16c-bar__title {
    font-family: Kanit, sans-serif;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
}
.m16c-bar__n { color: #7da62f; }
.m16c-bar__hide {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: -2px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6b7263;
    cursor: pointer;
}
.m16c-bar__hide:hover { background: #f5f6f2; color: #28301e; }
.m16c-bar__items {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.m16c-bar__item { position: relative; }
.m16c-bar__item a {
    display: block;
    width: 48px;
    height: 48px;
    padding: 3px;
    border: 1px solid #e4e7de;
    border-radius: 10px;
    background: #fff;
}
.m16c-bar__item a:hover { border-color: #93c13d; }
.m16c-bar__item img,
.m16c-bar__noimg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.m16c-bar__rm {
    position: absolute;
    top: -7px;
    right: -7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #565655;
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease;
}
.m16c-bar__rm .material-icons { font-size: 14px; }
.m16c-bar__item:hover .m16c-bar__rm,
.m16c-bar__rm:focus-visible { opacity: 1; }
.m16c-bar__rm:hover { background: #c4512f; }
.m16c-bar__more {
    font-size: 13px;
    font-weight: 600;
    color: #6b7263;
}
.m16c-bar__go {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 42px;
    padding: 0 18px 0 20px;
    border-radius: 21px;
    background: #93c13d;
    font-size: 14px;
    font-weight: 600;
    color: #fff !important;
    white-space: nowrap;
    text-decoration: none !important;
    transition: background-color .2s ease;
}
.m16c-bar__go:hover,
.m16c-bar__go:focus-visible { background: #7da62f; outline: none; }
.m16c-bar__go .material-icons { font-size: 18px; }

/* prawy dolny róg; na karcie produktu obok pływającego „Dodaj do koszyka” (.m16-float-cart,
   m16-theme.js) — szerokość przycisku koszyka podaje JS w --m16c-cart-w (klient 2026-10-09) */
body.m16-float-cart-on .m16c-bar {
    right: calc(16px + var(--m16c-cart-w, 200px) + 12px);
    bottom: 12px;
}
body.m16-float-cart-on .m16c-bar.is-collapsed { bottom: 20px; }
/* strzałka „do góry” (.back-top, prawy dół) nad paskiem; przy pływającym koszyku zostaje
   reguła z sekcji 47 m16-theme.css (pasek stoi wtedy na lewo od koszyka) */
body.m16c-bar-on:not(.m16-float-cart-on) .back-top { bottom: 104px !important; }

/* zwinięty: okrągła pigułka z licznikiem */
.m16c-bar__pill {
    display: none;
    position: relative;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 10px 28px rgba(29, 37, 24, .25), 0 0 0 1px #e4e7de;
    cursor: pointer;
}
.m16c-bar__pill .m16c-bar__icon { box-shadow: none; background: none; width: auto; height: auto; }
.m16c-bar__pill .m16c-bar__icon::before { font-size: 22px; }
.m16c-bar__pill-n {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #93c13d;
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    color: #fff;
}
.m16c-bar.is-collapsed .m16c-bar__panel { display: none; }
.m16c-bar.is-collapsed .m16c-bar__pill { display: inline-flex; }

/* komunikat (np. „Usunięto z porównania”) */
.m16c-toast {
    position: fixed;
    left: 50%;
    bottom: 96px;
    z-index: 1060;
    padding: 10px 18px;
    border-radius: 20px;
    background: #28301e;
    font-size: 14px;
    color: #fff;
    opacity: 0;
    transform: translate(-50%, 10px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}
.m16c-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* nad dolnym paskiem posquickmenu (~55 px) i obok pływającego „Dodaj do koszyka” */
@media (max-width: 1024px) {
    /* na telefonie/tablecie porównanie jest w dolnym pasku (pozycja „Porównaj” posquickmenu) —
       pływający pasek wchodził pod baner ciasteczek (klient 2026-10-09) */
    body.has-quickmenu .m16c-bar { display: none; }
    body.has-quickmenu .m16c-toast { bottom: 140px; }
}

/* pozycja „Porównaj” w dolnym pasku: licznik tylko, gdy coś jest w porównaniu; mignięcie po dodaniu */
.quickmenu-compare .qm-count:empty,
.quickmenu-compare .qm-count.m16c-zero { display: none; }
.quickmenu-compare.m16c-pulse .block-icon { animation: m16cPulse .9s ease 2; }
@keyframes m16cPulse {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.22); }
}
@media (max-width: 767px) {
    .m16c-bar { right: 12px; }
    .m16c-bar__panel { gap: 10px; padding: 8px 8px 8px 12px; }
    .m16c-bar__head .m16c-bar__icon,
    .m16c-bar__title { display: none; }
    .m16c-bar__items { gap: 6px; }
    .m16c-bar__item a { width: 40px; height: 40px; }
    .m16c-bar__item:nth-last-child(n+3):not(.m16c-bar__more) { display: none; }
    .m16c-bar__rm { opacity: 1; }
    .m16c-bar__go { height: 40px; padding: 0 14px 0 16px; }
    /* na karcie produktu z pływającym koszykiem — tylko pigułka, żeby się nie nakładały */
    body.m16-float-cart-on .m16c-bar__panel { display: none; }
    body.m16-float-cart-on .m16c-bar__pill { display: inline-flex; }
}
@media (prefers-reduced-motion: reduce) {
    .m16c-toast, .m16c-bar__rm { transition: none; }
}
