/* GalloShop Core 16.2.3 — mobile cart visibility and drawer feedback. */
.gshop-mobile-header-cart { display: none; }

@media (max-width: 780px) {
    .gshop-brand-zone {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 38px minmax(64px, auto);
        align-items: center;
        gap: 7px;
        width: 100%;
    }

    .gshop-header-actions { display: none !important; }

    .gshop-mobile-header-cart {
        display: grid;
        grid-template-columns: 30px auto;
        align-items: center;
        gap: 4px;
        min-width: 68px;
        min-height: 38px;
        padding: 4px 6px;
        color: #101827;
        background: #fff;
        border: 1px solid #dfe3e8;
        border-radius: 10px;
        text-decoration: none;
        box-shadow: 0 2px 7px rgba(15, 23, 42, .08);
    }

    .gshop-mobile-header-cart__icon {
        position: relative;
        display: grid;
        place-items: center;
        width: 28px;
        height: 28px;
        font-size: 21px;
        line-height: 1;
    }

    .gshop-mobile-header-cart__count {
        position: absolute;
        top: -6px;
        right: -7px;
        display: grid;
        place-items: center;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        color: #fff;
        background: #d90000;
        border: 2px solid #fff;
        border-radius: 999px;
        font: 700 9px/1 Arial, sans-serif;
        font-style: normal;
    }

    .gshop-mobile-header-cart__subtotal {
        max-width: 68px;
        overflow: hidden;
        color: #101827;
        font-size: 10px;
        line-height: 1.1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .gshop-mobile-header-cart.is-updated { animation: gshop-cart-pulse .5s ease; }
    .gshop-mobile-header-cart.is-updated .gshop-mobile-header-cart__count { animation: gshop-cart-badge .5s ease; }

    .gshop-cart-success {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0 0 10px;
        padding: 9px 11px;
        color: #11652d;
        background: #eaf8ee;
        border: 1px solid #bce5c8;
        border-radius: 9px;
        font-size: 13px;
        font-weight: 700;
    }

    .gshop-cart-success[hidden] { display: none !important; }
    .gshop-cart-success.is-visible { animation: gshop-cart-success-in .3s ease both; }
    [data-gshop-ajax-buy].gshop-is-added { transform: scale(.98); filter: saturate(.85); }

    .gshop-cart-drawer-body { padding-bottom: 20px !important; }

    .gshop-cart-drawer-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        position: static !important;
        padding-bottom: 0 !important;
    }

    .gshop-cart-drawer-actions .gshop-button-primary { grid-column: 1 / -1; }
    .gshop-cart-drawer-actions .gshop-button-secondary {
        color: #111 !important;
        background: #fff !important;
        border: 1px solid #16191c !important;
        box-shadow: none !important;
    }
    .gshop-cart-drawer-actions > * { min-width: 0; }

    .gshop-cart-progress { pointer-events: none; user-select: none; }
    .gshop-cart-progress b {
        width: auto !important;
        height: auto !important;
        border: 0 !important;
        background: transparent !important;
        color: #aab0b7 !important;
        font-size: 14px !important;
    }
    .gshop-cart-progress .is-active b { color: #d70000 !important; }

    body.woocommerce-cart .gshop-commerce-content .actions .coupon {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: stretch !important;
        gap: 6px !important;
        width: 100% !important;
        flex-wrap: nowrap !important;
    }
    body.woocommerce-cart .gshop-commerce-content .actions .coupon #coupon_code {
        width: 100% !important;
        min-width: 0 !important;
    }
    body.woocommerce-cart .gshop-commerce-content .actions .coupon .button { white-space: nowrap; }

    body.gshop-checkout-sticky-visible .joinchat,
    body.gshop-checkout-sticky-visible .ht-ctc-chat,
    body.gshop-checkout-sticky-visible #qlwapp,
    body.gshop-checkout-sticky-visible .wpp-float,
    body:has(.gshop-mobile-buy-bar.is-visible) .joinchat,
    body:has(.gshop-mobile-buy-bar.is-visible) .ht-ctc-chat,
    body:has(.gshop-mobile-buy-bar.is-visible) #qlwapp,
    body:has(.gshop-mobile-buy-bar.is-visible) .wpp-float,
    body:has(.gshop-mobile-cart-bar:not([hidden])) .joinchat,
    body:has(.gshop-mobile-cart-bar:not([hidden])) .ht-ctc-chat,
    body:has(.gshop-mobile-cart-bar:not([hidden])) #qlwapp,
    body:has(.gshop-mobile-cart-bar:not([hidden])) .wpp-float {
        bottom: calc(82px + env(safe-area-inset-bottom)) !important;
    }

    body.woocommerce-checkout .gshop-checkout-trust.is-footer-trust {
        min-height: 24px !important;
        padding: 4px 5px !important;
    }
}

@keyframes gshop-cart-pulse {
    0%, 100% { transform: scale(1); }
    45% { transform: scale(1.08); box-shadow: 0 0 0 5px rgba(217, 0, 0, .12); }
}

@keyframes gshop-cart-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.28); }
}

@keyframes gshop-cart-success-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .gshop-mobile-header-cart.is-updated,
    .gshop-mobile-header-cart.is-updated .gshop-mobile-header-cart__count,
    .gshop-cart-success.is-visible { animation: none; }
}
