/* Sticky Add to Cart - Main Styles */
.sticky-add-to-cart {
    position: fixed;
    bottom: -200px;
    left: 0;
    right: 0;
    background: var(--satc-bg-color, #ffffff);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    padding: 15px 20px;
    z-index: 9999;
    transition: bottom 0.3s ease, opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    opacity: 0;
    visibility: hidden;
}

.sticky-add-to-cart.visible {
    bottom: 0;
    opacity: 1;
    visibility: visible;
}

.sticky-product-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sticky-product-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 5px;
    flex-shrink: 0;
}

.sticky-product-details {
    display: flex;
    flex-direction: column;
}

.sticky-product-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1d;
    margin: 0 0 5px 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sticky-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #b99974;
    margin: 0;
}

.sticky-variations {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.sticky-size-option {
    padding: 10px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    background: white;
    white-space: nowrap;
    flex-shrink: 0;
}

.sticky-size-option:hover {
    border-color: #b99974;
}

.sticky-size-option.active {
    background: var(--satc-button-color, #1d1d1d);
    color: white;
    border-color: var(--satc-button-color, #1d1d1d);
}

.sticky-cart-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hide quantity wrapper */
.sticky-quantity-wrapper {
    display: none !important;
}

.sticky-add-button {
    padding: 12px 40px;
    background: var(--satc-button-color, #1d1d1d);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.sticky-add-button:hover {
    background: var(--satc-button-hover-color, #b99974);
    transform: translateY(-2px);
}

/* Button text visibility */
.sticky-button-text-mobile {
    display: none;
}

.sticky-button-text-full {
    display: inline;
}

/* Hide total price */
.sticky-total-price {
    display: none !important;
}

/* Loading state */
.sticky-add-to-cart.loading .sticky-add-button {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mobile adjustments - TWO ROWS LAYOUT */
@media (max-width: 768px) {
    .sticky-add-to-cart {
        flex-direction: column;
        padding: 12px 30px;
        padding-left: max(30px, env(safe-area-inset-left, 30px));
        padding-right: max(30px, env(safe-area-inset-right, 30px));
        padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
        gap: 10px;
    }
    
    /* ROW 1: Image + Name + Price */
    .sticky-product-info {
        width: 100%;
        gap: 12px;
        flex-shrink: 0;
    }
    
    .sticky-product-image {
        width: 50px;
        height: 50px;
        padding: 4px;
        flex-shrink: 0;
    }
    
    .sticky-product-details {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
    
    .sticky-product-title {
        font-size: 12px;
        margin: 0 0 3px 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .sticky-product-price {
        font-size: 13px;
        font-weight: 700;
        white-space: nowrap;
    }
    
    /* ROW 2: Sizes + Button IN SAME LINE */
    .sticky-variations {
        flex: 1;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 2px 0;
        display: flex;
        flex-wrap: nowrap;
    }
    
    .sticky-variations::-webkit-scrollbar {
        display: none;
    }
    
    .sticky-size-option {
        padding: 8px 14px;
        font-size: 11px;
        flex-shrink: 0;
        min-width: fit-content;
    }
    
    .sticky-cart-actions {
        width: 100%;
        display: flex;
        gap: 10px;
        align-items: center;
    }
    
    .sticky-add-button {
        padding: 11px 20px;
        font-size: 13px;
        font-weight: 600;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    /* Show short text on mobile */
    .sticky-button-text-mobile {
        display: inline;
    }
    
    .sticky-button-text-full {
        display: none;
    }
}

/* iPhone SE and smaller */
@media (max-width: 375px) {
    .sticky-add-to-cart {
        padding: 10px 25px;
        padding-left: max(25px, env(safe-area-inset-left, 25px));
        padding-right: max(25px, env(safe-area-inset-right, 25px));
        gap: 8px;
    }
    
    .sticky-product-info {
        gap: 10px;
    }
    
    .sticky-product-image {
        width: 45px;
        height: 45px;
    }
    
    .sticky-product-title {
        font-size: 11px;
    }
    
    .sticky-product-price {
        font-size: 12px;
    }
    
    .sticky-size-option {
        padding: 7px 12px;
        font-size: 10px;
    }
    
    .sticky-add-button {
        padding: 10px 16px;
        font-size: 12px;
    }
}

/* Hide on mobile if disabled */
body.satc-hide-mobile .sticky-add-to-cart {
    display: none !important;
}

/* Hide on desktop if disabled */
@media (min-width: 769px) {
    body.satc-hide-desktop .sticky-add-to-cart {
        display: none !important;
    }
}

/* Animation */
@keyframes slideUp {
    from {
        bottom: -200px;
        opacity: 0;
    }
    to {
        bottom: 0;
        opacity: 1;
    }
}

.sticky-add-to-cart.visible {
    animation: slideUp 0.3s ease forwards;
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .sticky-add-to-cart {
        padding-left: max(20px, env(safe-area-inset-left, 20px));
        padding-right: max(20px, env(safe-area-inset-right, 20px));
        padding-bottom: max(15px, env(safe-area-inset-bottom, 15px));
    }
    
    @media (max-width: 768px) {
        .sticky-add-to-cart {
            padding-left: max(30px, env(safe-area-inset-left, 30px));
            padding-right: max(30px, env(safe-area-inset-right, 30px));
            padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
        }
    }
    
    @media (max-width: 375px) {
        .sticky-add-to-cart {
            padding-left: max(25px, env(safe-area-inset-left, 25px));
            padding-right: max(25px, env(safe-area-inset-right, 25px));
            padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
        }
    }
}
