/* Smart Sticky Add to Cart Pro - Public CSS */

.ssatc-sticky-container {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 9990;
    background-color: var(--ssatc-bg, #ffffff);
    color: var(--ssatc-text, #1e293b);
    border-top: 1px solid var(--ssatc-border, #e5e7eb);
    box-sizing: border-box;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    transform: translateY(100%);
    opacity: 0;
    font-family: inherit;
}

.ssatc-sticky-container * {
    box-sizing: border-box;
}

/* Visibility State */
.ssatc-sticky-container.ssatc-visible {
    transform: translateY(0);
    opacity: 1;
}

/* Position Variants */
.ssatc-pos-bottom {
    bottom: 0;
}

.ssatc-pos-top {
    top: 0;
    bottom: auto;
    border-top: none;
    border-bottom: 1px solid var(--ssatc-border, #e5e7eb);
    transform: translateY(-100%);
}

.ssatc-pos-top.ssatc-visible {
    transform: translateY(0);
}

.ssatc-pos-floating {
    bottom: 20px;
    left: 50%;
    right: auto;
    width: 92%;
    max-width: 1140px;
    transform: translate(-50%, 120%);
    border-radius: var(--ssatc-radius, 12px);
    border: 1px solid var(--ssatc-border, #e5e7eb);
}

.ssatc-pos-floating.ssatc-visible {
    transform: translate(-50%, 0);
}

/* Shadows */
.ssatc-shadow-subtle {
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.ssatc-shadow-strong {
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.12);
}

/* Inner Layout */
.ssatc-inner-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 24px;
    min-height: var(--ssatc-height, 70px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Left Column: Product Info */
.ssatc-col-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.ssatc-thumbnail {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: calc(var(--ssatc-radius, 6px) - 2px);
    overflow: hidden;
    cursor: pointer;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    transition: transform 0.2s ease;
}

.ssatc-thumbnail:hover {
    transform: scale(1.05);
}

.ssatc-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ssatc-details {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ssatc-product-title {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.35;
    color: var(--ssatc-text, #1e293b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.ssatc-submeta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.ssatc-rating .star-rating {
    display: inline-block;
    font-size: 11px;
    color: #f59e0b;
}

.ssatc-reviews-count {
    color: #64748b;
    font-size: 11px;
    margin-left: 3px;
}

.ssatc-stock-alert-badge {
    color: #ef4444;
    font-weight: 700;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    background: #fef2f2;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid #fee2e2;
    animation: ssatc-pulse 2s infinite;
}

.ssatc-social-proof-badge {
    color: #0d9488;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    background: #f0fdfa;
    padding: 2px 8px;
    border-radius: 20px;
}

@keyframes ssatc-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* Right Column: Actions */
.ssatc-col-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Price Box */
.ssatc-price-box {
    font-size: 18px;
    font-weight: 800;
    color: var(--ssatc-price, #057a55);
    white-space: nowrap;
    margin-right: 4px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.ssatc-price-box del {
    font-size: 13px;
    color: #94a3b8;
    font-weight: normal;
    margin-right: 4px;
}

.ssatc-price-box ins {
    text-decoration: none;
    color: var(--ssatc-sale-price, #e02424);
}

.ssatc-price-box .woocommerce-price-suffix {
    font-size: 11px;
    color: #64748b;
    font-weight: normal;
}

/* Quantity Stepper */
.ssatc-quantity-stepper {
    display: flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: var(--ssatc-radius, 6px);
    background: #ffffff;
    height: 42px;
    overflow: hidden;
}

.ssatc-qty-btn {
    border: none;
    background: #f8fafc;
    color: #334155;
    width: 32px;
    height: 100%;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    user-select: none;
}

.ssatc-qty-btn:hover {
    background: #e2e8f0;
}

.ssatc-qty-input {
    width: 40px;
    height: 100%;
    border: none;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
    padding: 0;
    -moz-appearance: textfield;
}

.ssatc-qty-input::-webkit-outer-spin-button,
.ssatc-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Action Buttons */
.ssatc-btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 20px;
    border-radius: var(--ssatc-radius, 6px);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.ssatc-btn-cart {
    background-color: var(--ssatc-btn-cart-bg, #f95721);
    color: var(--ssatc-btn-cart-text, #ffffff);
}

.ssatc-btn-cart:hover {
    background-color: var(--ssatc-btn-cart-hover, #e0420f);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 87, 33, 0.35);
}

.ssatc-btn-buy {
    background-color: var(--ssatc-btn-buy-bg, #ff5722);
    color: var(--ssatc-btn-buy-text, #ffffff);
}

.ssatc-btn-buy:hover {
    background-color: var(--ssatc-btn-buy-hover, #e64a19);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.35);
}

.ssatc-btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ssatc-spin 0.6s linear infinite;
}

.ssatc-btn-action.loading .ssatc-btn-icon,
.ssatc-btn-action.loading .ssatc-btn-text {
    opacity: 0.2;
}

.ssatc-btn-action.loading .ssatc-btn-spinner {
    display: inline-block;
    position: absolute;
}

@keyframes ssatc-spin {
    to { transform: rotate(360deg); }
}

/* Extra Icons */
.ssatc-extra-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ssatc-extra-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ssatc-extra-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: scale(1.08);
}

.ssatc-close-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Shake Animation when Options need selection */
@keyframes ssatc-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.ssatc-shake {
    animation: ssatc-shake 0.5s ease-in-out;
}

/* Text Switching for Desktop / Mobile */
.ssatc-mobile-text {
    display: none;
}

.ssatc-desktop-text {
    display: inline;
}

/* Device Visibility Classes */
@media (min-width: 1025px) {
    .ssatc-hide-desktop { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .ssatc-hide-tablet { display: none !important; }
}

@media (max-width: 767px) {
    .ssatc-hide-mobile { display: none !important; }

    /* Switch text visibility */
    .ssatc-desktop-text {
        display: none !important;
    }
    .ssatc-mobile-text {
        display: inline !important;
    }

    /* Mobile Offset for WoodMart Mobile Navbar */
    .ssatc-pos-bottom {
        bottom: var(--ssatc-mobile-offset, 60px) !important;
    }

    .ssatc-inner-wrapper {
        padding: 8px 12px;
        gap: 8px;
        min-height: auto;
    }

    .ssatc-thumbnail {
        width: 42px;
        height: 42px;
    }

    .ssatc-product-title {
        font-size: 12px;
        max-width: 130px;
    }

    .ssatc-price-box {
        font-size: 14px;
        margin-right: 0;
    }

    .ssatc-btn-action {
        height: 38px;
        padding: 0 12px;
        font-size: 12px;
    }

    .ssatc-btn-icon {
        display: none;
    }
}
