/* =============================================
 *  Sticky Mobile Add to Cart v3.0
 *  STRUCTURAL STYLES ONLY
 *  All customizable properties (colors, sizes,
 *  radius, padding) are generated by PHP as
 *  direct CSS rules in a <style> tag
 * ============================================= */

#sticky-mobile-atc-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl;
    box-sizing: border-box;
}

#sticky-mobile-atc-bar.visible {
    transform: translateY(0);
}

@media (max-width: 767px) {
    #sticky-mobile-atc-bar {
        display: block;
    }
}

.sticky-atc-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 100%;
}

.sticky-atc-product-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.sticky-atc-image {
    flex-shrink: 0;
    overflow: hidden;
}

.sticky-atc-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sticky-atc-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}

.sticky-atc-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sticky-atc-price {
    line-height: 1.3;
}

.sticky-atc-price-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sticky-atc-regular-price {
    text-decoration: line-through;
}

.sticky-atc-sale-price {
    font-weight: 700;
    text-decoration: none;
}

.sticky-atc-current-price {
    font-weight: 700;
}

/* ── Button structural ── */
#sticky-mobile-atc-bar .sticky-atc-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    min-height: 46px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.2;
    text-decoration: none !important;
    box-shadow: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#sticky-mobile-atc-bar .sticky-atc-btn:active {
    transform: scale(0.96);
}

#sticky-mobile-atc-bar .sticky-atc-btn.no-click-anim:active {
    transform: none;
}

#sticky-mobile-atc-bar .sticky-atc-btn:disabled {
    cursor: not-allowed;
    box-shadow: none !important;
}

#sticky-mobile-atc-bar .sticky-atc-btn:disabled:active {
    transform: none;
}

/* ── Button icon ── */
.sticky-atc-btn-icon {
    display: flex;
    align-items: center;
    line-height: 1;
}

.sticky-atc-btn-icon svg {
    width: 18px;
    height: 18px;
}

/* ── Loading State ── */
#sticky-mobile-atc-bar .sticky-atc-btn.loading .sticky-atc-btn-text,
#sticky-mobile-atc-bar .sticky-atc-btn.loading .sticky-atc-btn-icon {
    display: none;
}

#sticky-mobile-atc-bar .sticky-atc-btn.loading .sticky-atc-spinner {
    display: flex !important;
}

/* ── Success State ── */
#sticky-mobile-atc-bar .sticky-atc-btn.added .sticky-atc-btn-text,
#sticky-mobile-atc-bar .sticky-atc-btn.added .sticky-atc-btn-icon {
    display: none;
}

#sticky-mobile-atc-bar .sticky-atc-btn.added .sticky-atc-checkmark {
    display: flex !important;
    font-size: 18px;
    animation: stickyCheckPop 0.3s ease;
}

@keyframes stickyCheckPop {
    0%   { transform: scale(0); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.sticky-atc-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sticky-atc-spinner svg {
    animation: stickySpin 0.8s linear infinite;
}

@keyframes stickySpin {
    to { transform: rotate(360deg); }
}

/* ── Layout: Button Only ── */
.sticky-atc-layout-button-only .sticky-atc-inner {
    justify-content: center;
}

.sticky-atc-layout-button-only .sticky-atc-btn.full-width {
    width: 100%;
    flex: 1;
}

/* ── Hide WC "View Cart" link ── */
#sticky-mobile-atc-bar a.added_to_cart,
#sticky-mobile-atc-bar .wc-forward {
    display: none !important;
}

body.satc-hide-view-cart a.added_to_cart.wc-forward {
    display: none !important;
}

/* ── Body padding ── */
@media (max-width: 767px) {
    body.has-sticky-atc {
        padding-bottom: 76px !important;
    }
}
