/* Sport-Mag: bara comuna de acces (Puncte | Black Friday | Pareri | Contact), 26 oct 2026.
   Se incarca numai pe Sport-Mag (id_shop 1), din footer.tpl, cand intrerupatorul sau cookie-ul de proba e pornit.
   Clasele de pe <body>, puse de smb-bar.v1.js:
     smb-bar-on        bara e in pagina (spatiu rezervat jos pe mobil, lansatoarele vechi ascunse)
     smb-has-puncte    adaptorul TheMarketer e gata (panoul lui se muta deasupra barei)
     smb-has-pareri    adaptorul Compari e gata
     smb-has-contact   adaptorul arcontactus e gata
     smb-fallback-*    adaptorul n-a venit in 20 s: lansatorul nativ reapare
     smb-panel-open    un panou e deschis (butonul Sus se retrage)
   Icoanele sunt Feather Icons (MIT), inline in footer.tpl. */

/* ---------- bara ---------- */
.smb-bar {
    position: fixed;
    z-index: 9998;               /* sub #back-to-top si #bf_button (9999), sub arcontactus (10000) si sub panourile TheMarketer / Compari */
    display: flex;
    align-items: stretch;
    box-sizing: border-box;
    margin: 0;
    background: #fff;
    border: 1px solid #e3e6e6;
    box-shadow: 0 -2px 14px rgba(0, 0, 0, .14);
    font-family: Arial, Helvetica, sans-serif;
}
.smb-cell {
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-sizing: border-box;
    margin: 0;
    padding: 6px 4px;
    background: none;
    border: 0;
    border-radius: 10px;
    color: #2f3b3c;
    font: 600 12px/1.2 Arial, Helvetica, sans-serif;
    letter-spacing: 0;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
}
.smb-cell:hover, .smb-cell:focus { text-decoration: none; color: #2f3b3c; }
.smb-cell:focus { outline: none; }
.smb-cell:focus-visible { outline: 2px solid #FE8C29; outline-offset: -2px; }
.smb-cell svg {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.smb-cell[data-smb="pareri"] { color: #4f6b63; }
.smb-cell[data-smb="contact"] { color: #008749; }
.smb-cell[data-smb="bf"] { background: #263234; color: #fff; }
.smb-cell[data-smb="bf"]:hover, .smb-cell[data-smb="bf"]:focus { color: #fff; background: #1b2526; }
.smb-cell[data-smb="bf"] svg { stroke: #FE8C29; }
.smb-cell[aria-expanded="true"] { background: #fff1e4; color: #FE8C29; }
.smb-cell[hidden] { display: none !important; }

/* ---------- mobil: bara jos, pe toata latimea ---------- */
@media (max-width: 767px) {
    .smb-bar {
        left: 0;
        right: 0;
        bottom: 0;
        height: 64px;
        height: calc(64px + env(safe-area-inset-bottom));
        padding: 6px 6px 6px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
        gap: 4px;
        border-width: 1px 0 0;
        border-radius: 0;
    }
    body.smb-bar-on {
        padding-bottom: 64px;
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }
    /* Sus: deasupra barei, in dreapta, la 12 px */
    body.smb-bar-on #back-to-top {
        bottom: 76px;
        bottom: calc(76px + env(safe-area-inset-bottom));
        right: 16px;
    }
}

/* ---------- desktop: bara compacta in dreapta jos ---------- */
@media (min-width: 768px) {
    .smb-bar {
        right: 24px;
        bottom: 18px;
        height: 72px;
        padding: 6px;
        gap: 4px;
        border-radius: 14px;
    }
    .smb-cell { min-width: 104px; padding: 6px 14px; }
    .smb-cell + .smb-cell { position: relative; }
    .smb-cell + .smb-cell::before {
        content: "";
        position: absolute;
        left: -2px;
        top: 14px;
        bottom: 14px;
        width: 1px;
        background: #e3e6e6;
    }
    .smb-cell[data-smb="bf"] + .smb-cell::before, .smb-cell + .smb-cell[data-smb="bf"]::before { display: none; }
    /* Sus: deasupra barei (bara se termina la 90 px), la 12 px */
    body.smb-bar-on #back-to-top {
        bottom: 102px;
        right: 24px;
    }
}

/* ---------- butonul Sus se retrage cat timp un panou e deschis ---------- */
body.smb-bar-on.smb-panel-open #back-to-top { display: none !important; }

/* ---------- lansatoarele vechi ---------- */
/* eticheta verticala Black Friday a modulului landingpage; pe pagina BF (#bf_button.white = „Inapoi la pagina principala”) ramane */
body.smb-bar-on #bf_button:not(.white) { display: none !important; }
/* arcontactus: bulina verde si baloanele de „typing”; meniul ramane */
body.smb-bar-on.smb-has-contact:not(.smb-fallback-contact) #arcontactus .arcontactus-message-button,
body.smb-bar-on.smb-has-contact:not(.smb-fallback-contact) #arcontactus .arcontactus-prompt { display: none !important; }
/* Compari: tab-ul „Pareri”; panoul ramane */
body.smb-bar-on.smb-has-pareri:not(.smb-fallback-pareri) #ak-widget .akw-tab { display: none !important; }
/* TheMarketer: butonul „Beneficii” si balonul de cod de reducere ancorat de el; panoul ramane */
body.smb-bar-on.smb-has-puncte:not(.smb-fallback-puncte) #theMarketer-launcher-widget .mktl-widget-toggle,
body.smb-bar-on.smb-has-puncte:not(.smb-fallback-puncte) #theMarketer-launcher-widget .mktl-loyalty-balloon { display: none !important; }

/* ---------- panourile native, ancorate deasupra barei ---------- */
/* arcontactus: cutia fixa devine un punct de ancora; meniul si formularul de apel se deschid de la acel punct in sus */
body.smb-bar-on.smb-has-contact #arcontactus.arcontactus-widget.arcontactus-message {
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    left: auto !important;
    overflow: visible !important;
}
body.smb-bar-on.smb-has-contact #arcontactus .messangers-block,
body.smb-bar-on.smb-has-contact #arcontactus .callback-countdown-block {
    bottom: 0 !important;
    right: 0 !important;
    left: auto !important;
}
body.smb-bar-on.smb-has-contact #arcontactus .messangers-block::before,
body.smb-bar-on.smb-has-contact #arcontactus .callback-countdown-block::before { display: none !important; }

@media (min-width: 768px) {
    body.smb-bar-on.smb-has-contact #arcontactus.arcontactus-widget.arcontactus-message { right: 24px !important; bottom: 102px !important; }
    body.smb-bar-on.smb-has-pareri #ak-widget.akw-bottom-right { right: 24px !important; }
    body.smb-bar-on.smb-has-pareri #ak-widget.akw-opened.akw-bottom-right { bottom: 102px !important; }
    body.smb-bar-on.smb-has-puncte #theMarketer-launcher-widget,
    body.smb-bar-on.smb-has-puncte #theMarketer-launcher-widget.mktl-open { left: auto !important; right: 24px !important; bottom: 102px !important; }
    body.smb-bar-on.smb-has-puncte #theMarketer-launcher-widget > div.mktl-launcher-widget-container { max-height: calc(100vh - 122px) !important; }
}
@media (max-width: 767px) {
    body.smb-bar-on.smb-has-contact #arcontactus.arcontactus-widget.arcontactus-message {
        right: 12px !important;
        bottom: 76px !important;
        bottom: calc(76px + env(safe-area-inset-bottom)) !important;
    }
    body.smb-bar-on.smb-has-pareri #ak-widget.akw-bottom-right { right: 12px !important; }
    body.smb-bar-on.smb-has-pareri #ak-widget.akw-mobile.akw-bottom-right { right: 0 !important; }
    body.smb-bar-on.smb-has-pareri #ak-widget.akw-opened.akw-bottom-right {
        bottom: 64px !important;
        bottom: calc(64px + env(safe-area-inset-bottom)) !important;
    }
}
/* TheMarketer intre 577 si 767 px: panoul de 376 px, deasupra barei; sub 577 px modulul il deschide pe tot ecranul (regula lui, cu !important), cu X-ul lui */
@media (min-width: 577px) and (max-width: 767px) {
    body.smb-bar-on.smb-has-puncte #theMarketer-launcher-widget,
    body.smb-bar-on.smb-has-puncte #theMarketer-launcher-widget.mktl-open { left: auto !important; right: 12px !important; bottom: 76px !important; }
    body.smb-bar-on.smb-has-puncte #theMarketer-launcher-widget > div.mktl-launcher-widget-container { max-height: calc(100vh - 96px) !important; }
}
