/* ============================================
   STICKY ADD TO CART - MOBILE ONLY
   ============================================ */

/* Base styling - positioned but hidden off-screen */
.ce-sticky-add-to-cart {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 999999 !important;
    background: #ffffff !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
    /* iOS safe area support */
    padding-bottom: env(safe-area-inset-bottom) !important;
    /* Ensure it's above everything */
    pointer-events: auto !important;
    display: block !important;
}

/* Show when active - slides up into view */
.ce-sticky-add-to-cart.active {
    transform: translateY(0) !important;
}

/* Debug helper - add this class via console to force show */
.ce-sticky-add-to-cart.force-show {
    transform: translateY(0) !important;
    display: block !important;
}

/* Container */
.ce-sticky-cart-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    max-width: 100%;
}

/* Product Info Section */
.ce-sticky-cart-info {
    flex: 1;
    min-width: 0;
}

.ce-sticky-cart-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.ce-sticky-cart-price .amount {
    color: #e74c3c;
}

.ce-sticky-cart-stock {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ce-sticky-cart-stock.in-stock {
    color: #27ae60;
}

.ce-sticky-cart-stock.out-of-stock {
    color: #e74c3c;
}

.ce-sticky-cart-stock .stock-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    border-radius: 50%;
    font-size: 10px;
}

.ce-sticky-cart-stock.in-stock .stock-icon {
    background: #d4edda;
    color: #155724;
}

.ce-sticky-cart-stock.out-of-stock .stock-icon {
    background: #f8d7da;
    color: #721c24;
}

/* Button Section */
.ce-sticky-cart-button {
    flex-shrink: 0;
}

.ce-sticky-atc-btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 700;
    background: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.ce-sticky-atc-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.ce-sticky-atc-btn:active {
    transform: translateY(0);
}

.ce-sticky-atc-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    box-shadow: none;
}

/* View Cart button (after adding to cart) */
.ce-sticky-atc-btn.ce-view-cart-btn {
    background: #27ae60;
}

.ce-sticky-atc-btn.ce-view-cart-btn:hover {
    background: #229954;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

/* Loading state */
.ce-sticky-atc-btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.ce-sticky-atc-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #ffffff;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ce-spin 0.6s linear infinite;
}

@keyframes ce-spin {
    to { transform: rotate(360deg); }
}

/* Success feedback */
.ce-sticky-atc-btn.success {
    background: #27ae60;
}

/* ============================================
   RESPONSIVE - MOBILE ONLY
   ============================================ */

/* Hide on desktop (larger than 768px) */
@media (min-width: 769px) {
    .ce-sticky-add-to-cart {
        display: none !important;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    
    /* Smaller devices */
    @media (max-width: 480px) {
        .ce-sticky-cart-content {
            padding: 0.875rem;
            gap: 0.75rem;
        }
        
        .ce-sticky-cart-price {
            font-size: 1rem;
        }
        
        .ce-sticky-atc-btn {
            padding: 0.75rem 1.25rem;
            font-size: 0.875rem;
        }
    }
    
    /* Very small devices */
    @media (max-width: 360px) {
        .ce-sticky-cart-content {
            padding: 0.75rem;
            gap: 0.5rem;
        }
        
        .ce-sticky-cart-price {
            font-size: 0.9375rem;
        }
        
        .ce-sticky-cart-stock {
            font-size: 0.6875rem;
        }
        
        .ce-sticky-atc-btn {
            padding: 0.625rem 1rem;
            font-size: 0.8125rem;
        }
    }
}

/* ============================================
   LANDSCAPE MODE
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .ce-sticky-cart-content {
        padding: 0.5rem 1rem;
    }
    
    .ce-sticky-cart-price {
        font-size: 0.9375rem;
        margin-bottom: 0.125rem;
    }
    
    .ce-sticky-cart-stock {
        font-size: 0.6875rem;
    }
    
    .ce-sticky-atc-btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus states */
.ce-sticky-atc-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ce-sticky-add-to-cart {
        transition: none;
    }
    
    .ce-sticky-atc-btn {
        transition: none;
    }
    
    .ce-sticky-atc-btn.loading::after {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .ce-sticky-add-to-cart {
        border-top: 2px solid currentColor;
    }
    
    .ce-sticky-atc-btn {
        border: 2px solid currentColor;
    }
}