/* ===== STICKY ADD TO CART BAR - CLEAN VERSION ===== */
:root {
    --sticky-primary-color: #2c5aa0;
    --sticky-primary-hover: #1e3f73;
    --sticky-warning-color: #f59e0b;
    --sticky-warning-hover: #d97706;
    --sticky-gray-color: #6b7280;
    --sticky-gray-hover: #4b5563;
    --sticky-border-color: #e2e8f0;
    --sticky-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    --sticky-text-color: #1e293b;
    --sticky-bg-color: #ffffff;
    --sticky-sale-color: #dc2626;
    --sticky-original-color: #94a3b8;
}

/* Main sticky bar container */
.sticky-add-to-cart {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--sticky-bg-color);
    border-top: 1px solid var(--sticky-border-color);
    box-shadow: var(--sticky-shadow);
    z-index: 99999;
    display: none;
    padding: 12px 0;
    animation: slideUp 0.3s ease-out;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Inner content wrapper */
.sticky-add-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    gap: 16px;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Left section - product info */
.sticky-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.sticky-product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    -webkit-user-drag: none;
    flex-shrink: 0;
}

.sticky-title {
    font-weight: 600;
    font-size: 16px;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sticky-text-color);
    -webkit-font-smoothing: antialiased;
    flex: 1;
}

/* Right section - price and button */
.sticky-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    min-width: 0;
}

.sticky-price {
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-shrink: 1;
    font-size: 18px;
    color: var(--sticky-text-color);
    white-space: nowrap;
}

/* Price variations */
.sticky-price ins,
.sticky-price .sale-price {
    text-decoration: none;
    color: var(--sticky-sale-color);
    font-size: 18px;
}

.sticky-price del,
.sticky-price .original-price {
    color: var(--sticky-original-color);
    text-decoration: line-through;
    font-size: 15px;
}

/* Button base styles */
.sticky-add-to-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 160px;
    white-space: nowrap;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: var(--sticky-primary-color);
    color: #ffffff;
    flex-shrink: 0;
}

.sticky-add-to-cart-btn:hover {
    background-color: var(--sticky-primary-hover);
    transform: translateY(-1px);
}

.sticky-add-to-cart-btn:active {
    transform: translateY(0);
}

/* Button states with icons */
.sticky-add-to-cart-btn.add-to-cart-state::before {
    content: "+";
    font-size: 18px;
    font-weight: 600;
}

.sticky-add-to-cart-btn.select-options-state::before,
.sticky-add-to-cart-btn.read-more-state::before {
    content: none;
}

/* Button state variations */
.sticky-add-to-cart-btn.select-options-state {
    background-color: var(--sticky-warning-color);
}

.sticky-add-to-cart-btn.select-options-state:hover {
    background-color: var(--sticky-warning-hover);
}

.sticky-add-to-cart-btn.read-more-state {
    background-color: var(--sticky-gray-color);
}

.sticky-add-to-cart-btn.read-more-state:hover {
    background-color: var(--sticky-gray-hover);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet styles (769px - 1024px) */
@media (max-width: 1024px) {
    .sticky-add-inner {
        max-width: 100%;
        padding: 0 16px;
    }
}

/* Mobile styles (0 - 768px) */
@media (max-width: 768px) {
    .sticky-add-to-cart {
        padding: 8px 0;
    }
    
    .sticky-add-inner {
        gap: 8px;
        padding: 0 12px;
    }
    
    .sticky-left {
        display: none;
    }
    
    .sticky-right {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
        position: relative;
        min-height: 40px;
    }
    
    .sticky-price {
        font-size: 16px;
    }
    
    .sticky-price ins,
    .sticky-price .sale-price {
        font-size: 16px;
    }
    
    .sticky-price del,
    .sticky-price .original-price {
        font-size: 13px;
    }
    
    .sticky-add-to-cart-btn {
        padding: 8px 16px;
        font-size: 12px;
        min-height: 36px;
        min-width: 140px;
    }
    
    .sticky-add-to-cart-btn.add-to-cart-state::before {
        font-size: 16px;
    }
    
    /* Hide empty price elements */
    .sticky-price:empty,
    .sticky-price[style*="display: none"],
    .sticky-price[style*="visibility: hidden"] {
        display: none !important;
    }
    
    /* Center button when alone */
    .sticky-price:empty ~ .sticky-add-to-cart-btn,
    .sticky-price[style*="display: none"] ~ .sticky-add-to-cart-btn,
    .sticky-price[style*="visibility: hidden"] ~ .sticky-add-to-cart-btn,
    .sticky-right.alone-button .sticky-add-to-cart-btn {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        min-width: 200px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin: 0;
    }
}

/* Small mobile styles (0 - 480px) */
@media (max-width: 480px) {
    .sticky-add-to-cart {
        padding: 6px 0;
    }
    
    .sticky-add-inner {
        padding: 0 8px;
    }
    
    .sticky-right {
        min-height: 36px;
    }
    
    .sticky-price {
        font-size: 15px;
    }
    
    .sticky-price ins,
    .sticky-price .sale-price {
        font-size: 15px;
    }
    
    .sticky-price del,
    .sticky-price .original-price {
        font-size: 12px;
    }
    
    .sticky-add-to-cart-btn {
        padding: 7px 14px;
        font-size: 11px;
        min-width: 120px;
    }
    
    .sticky-add-to-cart-btn.add-to-cart-state::before {
        font-size: 14px;
    }
    
    /* Adjust centered button for small screens */
    .sticky-price:empty ~ .sticky-add-to-cart-btn,
    .sticky-price[style*="display: none"] ~ .sticky-add-to-cart-btn,
    .sticky-price[style*="visibility: hidden"] ~ .sticky-add-to-cart-btn,
    .sticky-right.alone-button .sticky-add-to-cart-btn {
        min-width: 180px;
    }
}

/* ===== LARGE DESKTOP OPTIMIZATION ===== */
@media (min-width: 1400px) {
    .sticky-add-inner {
        max-width: 1320px;
        padding: 0 40px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
    .sticky-add-to-cart {
        animation: none;
    }
    
    .sticky-add-to-cart-btn {
        transition: none;
    }
}

/* ===== ACCESSIBILITY ===== */
.sticky-add-to-cart-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.sticky-add-to-cart-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sticky-add-to-cart {
        border-top: 2px solid #000000;
    }
    
    .sticky-product-image {
        border: 2px solid #000000;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .sticky-add-to-cart {
        display: none !important;
    }
}