/**
 * Side Cart Frontend Styles
 * Styles for the floating cart button and side cart panel
 */

/* Side Cart Styles */
.ckfylt25-floating-cart-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #0073aa;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    transition: all 0.3s ease;
    font-size: 20px;
}

.ckfylt25-floating-cart-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.ckfylt25-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.ckfylt25-floating-cart-button.ckfylt25-cart-empty {
    opacity: 0.6;
    pointer-events: none;
}

/* Side Cart Panel */
.ckfylt25-side-cart-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background-color: white;
    z-index: 10001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.ckfylt25-side-cart-panel.ckfylt25-side-cart-open {
    right: 0;
}

/* Side Cart Header */
.ckfylt25-side-cart-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ckfylt25-side-cart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ckfylt25-side-cart-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ckfylt25-side-cart-close:hover {
    color: #333;
}

/* Side Cart Content */
.ckfylt25-side-cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ckfylt25-side-cart-items {
    margin-bottom: 20px;
}

.ckfylt25-side-cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.ckfylt25-side-cart-empty p {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.ckfylt25-side-cart-empty span {
    font-size: 48px;
    opacity: 0.5;
}

/* Cart Items */
.ckfylt25-cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.ckfylt25-cart-item:last-child {
    border-bottom: none;
}

.ckfylt25-cart-item-image {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    flex-shrink: 0;
}

.ckfylt25-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.ckfylt25-cart-item-details {
    flex: 1;
    min-width: 0;
}

.ckfylt25-cart-item-name {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    color: #333;
}

.ckfylt25-cart-item-price {
    font-weight: 600;
    color: #0073aa;
    margin-bottom: 8px;
}

.ckfylt25-cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ckfylt25-quantity-btn {
    width: 25px;
    height: 25px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #666;
}

.ckfylt25-quantity-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.ckfylt25-quantity-value {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.ckfylt25-cart-item-remove {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    margin-left: 10px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.ckfylt25-cart-item-remove:hover {
    background-color: #ff4444;
    color: white;
}

/* Side Cart Footer */
.ckfylt25-side-cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background-color: #f9f9f9;
}

.ckfylt25-total-section {
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

.ckfylt25-side-cart-checkout {
    width: 100%;
    padding: 12px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.ckfylt25-side-cart-checkout:hover {
    background-color: #005a87;
}

/* Overlay */
.ckfylt25-side-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.ckfylt25-side-cart-overlay.ckfylt25-overlay-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ckfylt25-side-cart-panel {
        width: 100%;
        right: -100%;
    }
    
    .ckfylt25-floating-cart-button {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .ckfylt25-cart-count {
        width: 20px;
        height: 20px;
        font-size: 11px;
        min-width: 20px;
    }
}

@media (max-width: 480px) {
    .ckfylt25-side-cart-header,
    .ckfylt25-side-cart-content,
    .ckfylt25-side-cart-footer {
        padding: 15px;
    }
    
    .ckfylt25-cart-item {
        padding: 10px 0;
    }
    
    .ckfylt25-cart-item-image {
        width: 50px;
        height: 50px;
        margin-right: 10px;
    }
    
    .ckfylt25-cart-item-details h4 {
        font-size: 13px;
    }
    
    .ckfylt25-cart-item-price {
        font-size: 13px;
    }
}

/* Animation for cart items */
.ckfylt25-cart-item {
    animation: slideInFromRight 0.3s ease;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading state */
.ckfylt25-side-cart-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.ckfylt25-side-cart-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

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

/* Popup Cart Modal Styles */
.ckfylt25-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.ckfylt25-modal-overlay.ckfylt25-modal-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ckfylt25-modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.ckfylt25-modal-overlay.ckfylt25-modal-active .ckfylt25-modal-content {
    transform: scale(1);
}

.ckfylt25-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.ckfylt25-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.ckfylt25-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.ckfylt25-modal-close:hover {
    color: #333;
    background-color: #f0f0f0;
}

.ckfylt25-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    max-height: 400px;
}

.ckfylt25-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
}

.ckfylt25-total-section {
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
    text-align: center;
}

.ckfylt25-checkout-btn {
    width: 100%;
    padding: 15px 25px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ckfylt25-checkout-btn:hover {
    background-color: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.ckfylt25-cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.ckfylt25-cart-empty p {
    margin: 0;
    font-size: 16px;
    color: #999;
}

/* Floating button for both types */
#ckfylt25-floating-cart {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    transition: all 0.3s ease;
    font-size: 20px;
    border: none;
}

#ckfylt25-floating-cart:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.ckfylt25-cart-icon {
    font-size: 20px;
}

/* Side cart panel for side cart type */
#ckfylt25-side-cart {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    z-index: 10001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

#ckfylt25-side-cart.ckfylt25-side-cart-open {
    right: 0;
}

/* Responsive for popup modal */
@media (max-width: 768px) {
    .ckfylt25-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .ckfylt25-modal-header,
    .ckfylt25-modal-body,
    .ckfylt25-modal-footer {
        padding: 15px 20px;
    }
    
    #ckfylt25-floating-cart {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
    
    .ckfylt25-cart-icon {
        font-size: 18px;
    }
    
    #ckfylt25-side-cart {
        width: 100%;
        right: -100%;
    }
}