/* AgroKraina Sticky Cart 1.2.1 - PrestaShop 1.6 */
#ag-sticky-cart.agsc {
    --ag-primary-green: #2e7d32;
    --ag-primary-green-dark: #256a29;
    --ag-danger: #b3261e;
    --ag-text: #222;
    --ag-border: #d9d9d9;
    --ag-surface: #fff;

    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    background: #fff;
    background: var(--ag-surface);
    border-top: 1px solid #d9d9d9;
    border-top-color: var(--ag-border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .14);
    transform: translateY(110%);
    opacity: 0;
    visibility: hidden;
    transition: transform .22s ease, opacity .18s ease, visibility .22s;
    -webkit-font-smoothing: antialiased;
}

#ag-sticky-cart.agsc.agsc--visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Gdy layer_cart jest otwarty, sticky zjeżdża płynnie zamiast znikać przez display:none. */
body.layer-cart-open #ag-sticky-cart.agsc,
body.modal-open #ag-sticky-cart.agsc {
    transform: translateY(110%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#ag-sticky-cart .agsc__inner {
    width: 100%;
    max-width: 1180px;
    min-height: 72px;
    margin: 0 auto;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
}

#ag-sticky-cart .agsc__product {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
}

#ag-sticky-cart .agsc__image-wrap {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border: 1px solid #e3e3e3;
    background: #fff;
    padding: 2px;
    box-sizing: border-box;
}

#ag-sticky-cart .agsc__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#ag-sticky-cart .agsc__meta { min-width: 0; }

#ag-sticky-cart .agsc__title {
    max-width: 440px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #222;
    color: var(--ag-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 2px;
}

#ag-sticky-cart .agsc__availability {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #2e7d32;
    color: var(--ag-primary-green);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 2px;
}

#ag-sticky-cart .agsc__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2e7d32;
    background: var(--ag-primary-green);
    box-shadow: 0 0 0 2px rgba(46, 125, 50, .12);
    flex: 0 0 7px;
}

#ag-sticky-cart .agsc__availability--out,
#ag-sticky-cart .agsc__availability--inquiry {
    color: #b3261e;
    color: var(--ag-danger);
}

#ag-sticky-cart .agsc__availability--out .agsc__dot,
#ag-sticky-cart .agsc__availability--inquiry .agsc__dot {
    background: #b3261e;
    background: var(--ag-danger);
    box-shadow: 0 0 0 2px rgba(179, 38, 30, .12);
}

#ag-sticky-cart .agsc__price {
    color: #222;
    color: var(--ag-text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
}

#ag-sticky-cart .agsc__button {
    min-height: 48px;
    min-width: 215px;
    padding: 0 18px;
    border: 1px solid #286d2c;
    border-radius: 4px;
    background: #2e7d32;
    background: var(--ag-primary-green);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 46px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .10);
    transition: background .15s ease, box-shadow .15s ease, transform .08s ease;
    flex: 0 0 auto;
}

#ag-sticky-cart .agsc__button:hover,
#ag-sticky-cart .agsc__button:focus {
    background: #256a29;
    background: var(--ag-primary-green-dark);
    color: #fff;
    outline: none;
    box-shadow: 0 3px 7px rgba(0, 0, 0, .16);
}

#ag-sticky-cart .agsc__button:active { transform: translateY(1px); }
#ag-sticky-cart .agsc__button[disabled] { background: #9e9e9e; border-color: #8c8c8c; cursor: not-allowed; opacity: .85; }

#ag-sticky-cart .agsc__cart-icon {
    display: inline-block;
    margin-right: 8px;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    vertical-align: -1px;
}

/* Quantity: opcjonalne, domyślnie ukryte na bardzo wąskich telefonach. */
#ag-sticky-cart .agsc__qty {
    display: none;
    align-items: stretch;
    flex: 0 0 auto;
    height: 42px;
    border: 1px solid #d5d5d5;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}


#ag-sticky-cart .agsc__qty.agsc__qty--disabled { display: none !important; }
#ag-sticky-cart .agsc__qty-btn,
#ag-sticky-cart .agsc__qty-input {
    border: 0;
    background: #fff;
    color: #333;
    height: 40px;
    box-sizing: border-box;
}

#ag-sticky-cart .agsc__qty-btn {
    width: 34px;
    padding: 0;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

#ag-sticky-cart .agsc__qty-btn:focus,
#ag-sticky-cart .agsc__qty-input:focus { outline: 2px solid rgba(46, 125, 50, .35); outline-offset: -2px; }

#ag-sticky-cart .agsc__qty-input {
    width: 42px;
    padding: 0 3px;
    text-align: center;
    font-size: 14px;
    border-left: 1px solid #e1e1e1;
    border-right: 1px solid #e1e1e1;
    -moz-appearance: textfield;
}
#ag-sticky-cart .agsc__qty-input::-webkit-inner-spin-button,
#ag-sticky-cart .agsc__qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

body.agsc-body-visible { padding-bottom: 74px !important; }

@media (min-width: 768px) {
    #ag-sticky-cart.agsc:not(.agsc--desktop-enabled) { display: none !important; }
    body.agsc-body-visible { padding-bottom: 0 !important; }
}

@media (min-width: 480px) {
    #ag-sticky-cart .agsc__qty { display: flex; }
}

@media (max-width: 767px) {
    #ag-sticky-cart .agsc__inner {
        min-height: 68px;
        padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
        gap: 9px;
    }

    #ag-sticky-cart .agsc__image-wrap,
    #ag-sticky-cart .agsc__title { display: none; }

    #ag-sticky-cart .agsc__product { justify-content: center; }
    #ag-sticky-cart .agsc__meta { width: 100%; text-align: center; }
    #ag-sticky-cart .agsc__availability { justify-content: center; margin-bottom: 6px; font-size: 12px; }
    #ag-sticky-cart .agsc__price { text-align: center; font-size: 19px; line-height: 1.05; }

    #ag-sticky-cart .agsc__button {
        min-width: 174px;
        min-height: 54px;
        padding: 0 12px;
        font-size: 14px;
        line-height: 52px;
    }

    body.agsc-body-visible { padding-bottom: calc(72px + env(safe-area-inset-bottom)) !important; }
}

@media (max-width: 479px) {
    #ag-sticky-cart .agsc__qty { display: none; }
}

@media (max-width: 420px) {
    #ag-sticky-cart .agsc__product { min-width: 112px; flex: 1 1 39%; }
    #ag-sticky-cart .agsc__availability { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #ag-sticky-cart .agsc__price { font-size: 18px; white-space: nowrap; }
    #ag-sticky-cart .agsc__button { min-width: 0; flex: 1 1 61%; padding: 0 9px; font-size: 14px; }
}

@media (max-width: 350px) {
    #ag-sticky-cart .agsc__button { font-size: 13px; }
    #ag-sticky-cart .agsc__cart-icon { display: none; }
}


/* AgroKrajna: contrast fix for availability label. The parent already sets green,
   but the span may be restyled by the theme or other modules.
   Explicitly style the text, independently of the green/red status dot. */
#ag-sticky-cart.agsc .agsc__availability .agsc__availability-text {
    color: #2e7d32 !important;
    -webkit-text-fill-color: #2e7d32 !important;
    opacity: 1 !important;
}
#ag-sticky-cart.agsc .agsc__availability.agsc__availability--out .agsc__availability-text,
#ag-sticky-cart.agsc .agsc__availability.agsc__availability--inquiry .agsc__availability-text {
    color: #b3261e !important;
    -webkit-text-fill-color: #b3261e !important;
}
