/* MakerBase sticky bar – v9
   Oprava: CSS už není vázané jen na body.type-detail, takže se bar nikdy nevykreslí jako obyčejný obsah dole ve stránce. */

.mb-sticky-cart,
.mb-sticky-cart * {
    box-sizing: border-box !important;
}

.mb-sticky-cart {
    position: fixed !important;
}

body .mb-sticky-cart {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 99990;
    width: min(1120px, calc(100vw - 32px));
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(15, 35, 75, 0.1);
    border-radius: 18px;
    box-shadow: 0 14px 48px rgba(0, 0, 0, 0.16);
    transform: translate(-50%, calc(100% + 46px));
    opacity: 0;
    pointer-events: none;
    transition: transform 280ms cubic-bezier(.22,.61,.36,1), opacity 220ms ease;
}

body .mb-sticky-cart.mb-sticky-cart-visible {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

body .mb-sticky-cart.mb-sticky-cart-hide {
    transform: translate(-50%, calc(100% + 46px)) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body .mb-sticky-cart-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px;
}

body .mb-sticky-cart-image {
    width: 58px;
    height: 58px;
    border-radius: 12px;
    background: #f6f8fc;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

body .mb-sticky-cart-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

body .mb-sticky-cart-info {
    min-width: 0;
}

body .mb-sticky-cart-title {
    font-size: 15px;
    line-height: 1.25;
    font-weight: 800;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body .mb-sticky-cart-code {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.2;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body .mb-sticky-cart-variant {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 900;
    color: #0856a3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body .mb-sticky-cart-price {
    font-size: 20px;
    line-height: 1;
    font-weight: 900;
    color: #172554;
    white-space: nowrap;
}

body .mb-sticky-cart-amount {
    display: flex;
    align-items: center;
    height: 42px;
    border: 1px solid rgba(15, 35, 75, 0.22);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

body .mb-sticky-cart-minus,
body .mb-sticky-cart-plus {
    width: 38px;
    height: 42px;
    border: 0;
    background: transparent;
    color: #111827;
    cursor: pointer;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

body .mb-sticky-cart-minus:hover,
body .mb-sticky-cart-plus:hover {
    background: #f3f6fb;
}

body .mb-sticky-cart-qty {
    width: 44px;
    height: 42px;
    border: 0;
    background: transparent;
    color: #111827;
    text-align: center;
    font-size: 17px;
    font-weight: 800;
    appearance: textfield;
    -moz-appearance: textfield;
}

body .mb-sticky-cart-qty::-webkit-outer-spin-button,
body .mb-sticky-cart-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

body .mb-sticky-cart-button {
    height: 46px;
    min-width: 190px;
    border: 0;
    border-radius: 999px;
    background: #2f6fde;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    padding: 0 24px;
    box-shadow: 0 10px 26px rgba(47, 111, 222, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

body .mb-sticky-cart-button:hover {
    background: #245fd0;
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(47, 111, 222, 0.34);
}

body .mb-sticky-cart-button:active {
    transform: translateY(0);
}

body .mb-sticky-cart-button svg {
    width: 19px;
    height: 19px;
    display: block;
}

body .mb-sticky-cart-button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 767px) {
    body .mb-sticky-cart {
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        width: auto;
        border-radius: 16px;
        transform: translateY(calc(100% + 34px));
        box-shadow: 0 10px 36px rgba(0, 0, 0, 0.18);
    }

    body .mb-sticky-cart.mb-sticky-cart-visible {
        transform: translateY(0);
    }

    body .mb-sticky-cart.mb-sticky-cart-hide {
        transform: translateY(calc(100% + 34px)) !important;
    }

    body .mb-sticky-cart-inner {
        grid-template-columns: 48px minmax(0, 1fr) 86px;
        grid-template-rows: auto auto;
        gap: 4px 10px;
        padding: 10px;
    }

    body .mb-sticky-cart-image {
        grid-row: 1 / 3;
        width: 48px;
        height: 48px;
        border-radius: 11px;
    }

    body .mb-sticky-cart-info {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }

    body .mb-sticky-cart-title {
        font-size: 13px;
        line-height: 1.2;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    body .mb-sticky-cart-variant {
        margin-top: 3px;
        font-size: 12px;
        line-height: 1.15;
        font-weight: 900;
        color: #0856a3;
    }

    body .mb-sticky-cart-code {
        display: none;
    }

    body .mb-sticky-cart-price {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        font-size: 15px;
        line-height: 1.1;
    }

    body .mb-sticky-cart-amount {
        display: none;
    }

    body .mb-sticky-cart-button {
        grid-column: 3 / 4;
        grid-row: 1 / 3;
        min-width: 86px;
        width: 86px;
        height: 50px;
        border-radius: 14px;
        padding: 0 10px;
        gap: 0;
        box-shadow: 0 8px 20px rgba(47, 111, 222, 0.26);
    }

    body .mb-sticky-cart-button svg {
        display: none !important;
    }

    body .mb-sticky-cart-button span {
        display: inline !important;
        font-size: 11px;
        line-height: 1.05;
        text-align: center;
    }
}

@media (max-width: 380px) {
    body .mb-sticky-cart-inner {
        grid-template-columns: 44px minmax(0, 1fr) 76px;
    }

    body .mb-sticky-cart-image {
        width: 44px;
        height: 44px;
    }

    body .mb-sticky-cart-button {
        min-width: 76px;
        width: 76px;
        height: 48px;
        padding: 0 8px;
    }

    body .mb-sticky-cart-button span {
        font-size: 10px;
    }

    body .mb-sticky-cart-title {
        font-size: 12.5px;
    }

    body .mb-sticky-cart-price {
        font-size: 14px;
    }
}

/* Varianty: sticky bar čeká na výběr varianty místo toho, aby rovnou přidával do košíku. */
body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-button {
    background: #14245e;
    box-shadow: 0 10px 26px rgba(20, 36, 94, 0.26);
}

body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-button:hover {
    background: #0f1d50;
    box-shadow: 0 12px 30px rgba(20, 36, 94, 0.32);
}

body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-amount {
    opacity: 0.55;
}

body .mb-sticky-variant-pulse {
    border-radius: 14px !important;
    outline: 3px solid rgba(84, 167, 246, 0.55) !important;
    outline-offset: 8px !important;
    transition: outline-color 180ms ease, outline-offset 180ms ease !important;
}

@media (max-width: 767px) {
    body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-inner {
        grid-template-columns: 48px minmax(0, 1fr) 104px;
    }

    body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-button {
        min-width: 104px;
        width: 104px;
    }

    body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-button span {
        font-size: 10.5px;
    }
}

@media (max-width: 380px) {
    body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-inner {
        grid-template-columns: 44px minmax(0, 1fr) 94px;
    }

    body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-button {
        min-width: 94px;
        width: 94px;
    }
}


/* === v5 pevná pojistka proti neostylovanému vykreslení v obsahu stránky === */
body .mb-sticky-cart {
    position: fixed !important;
    left: 50% !important;
    bottom: 18px !important;
    z-index: 99990 !important;
    display: block !important;
}

body .mb-sticky-cart-inner {
    display: grid !important;
}

body .mb-sticky-cart-button svg {
    width: 19px !important;
    height: 19px !important;
    max-width: 19px !important;
    max-height: 19px !important;
}

body .mb-sticky-cart-needs-variant .mb-sticky-cart-button svg {
    display: none !important;
}

@media (max-width: 767px) {
    body .mb-sticky-cart {
        left: 10px !important;
        right: 10px !important;
        bottom: calc(10px + env(safe-area-inset-bottom)) !important;
        width: auto !important;
    }
}


/* === v7: při nevybrané variantě je tlačítko „VYBRAT VARIANTU“, po výběru ukazuje cenu konkrétní varianty. === */
body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-button span {
    white-space: nowrap !important;
}

@media (min-width: 768px) {
    body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-button {
        min-width: 210px !important;
    }
}


/* === v8: mobil/desktop – bez vybrané varianty ukáže cenu OD a tlačítko VYBRAT VARIANTU. === */
body .mb-sticky-cart-price {
    white-space: nowrap !important;
}

body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-button span {
    white-space: normal !important;
    text-align: center !important;
}

@media (max-width: 767px) {
    body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-inner {
        grid-template-columns: 48px minmax(0, 1fr) 112px !important;
    }

    body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-button {
        min-width: 112px !important;
        width: 112px !important;
    }

    body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-button span {
        font-size: 10.5px !important;
        line-height: 1.05 !important;
    }
}

@media (max-width: 380px) {
    body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-inner {
        grid-template-columns: 44px minmax(0, 1fr) 104px !important;
    }

    body .mb-sticky-cart.mb-sticky-cart-needs-variant .mb-sticky-cart-button {
        min-width: 104px !important;
        width: 104px !important;
    }
}


/* === v9: vybraná varianta pod názvem produktu ve sticky baru. === */
body .mb-sticky-cart-variant:empty {
    display: none !important;
}
