﻿:root {
    --primary-color: #0071bc;
    --accent-color: #2ecc71;
    --accent-dark: #27ae60;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --bg-light: #f5f7fa;
    --bg-highlight: #fff8e6;
    --discount-green: #008a3e;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background-color: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 2147483640;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.float-cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-title {
    font-size: 0.9rem !important;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px 8px;
    transition: color 0.2s;
}

.cart-close:hover {
    color: var(--text-color);
}

.float-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.float-cart-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.float-cart-item:last-child {
    border-bottom: none;
}

.item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    display: flex;
    align-items: normal;
    justify-content: space-evenly;
    flex-shrink: 0;
    font-size: 2rem;
    color: #999;
}

.item-details {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 0.75rem;
}

.item-specs {
    font-size: 0.65rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.floating-item-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.65rem;
}

.qty-btn:not(:disabled):hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.qty-value {
    min-width: 20px;
    text-align: center;
    font-weight: 500;
    font-size: 0.75rem;
}

.item-total {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.7rem !important;
}

.item-remove {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
    font-size: 0.8rem;
}

.item-remove:hover {
    color: #e74c3c;
}

.cart-footer {
    border-top: 1px solid var(--border-color);
    padding: 20px;
    background-color: white;
}

.cart-summary {
    margin-bottom: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.summary-row.total {
    font-size: 1rem;
    font-weight: 600;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 12px;
}

.discount-row {
    background-color: #fff8e6;
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0;
}

.discount-amount {
    color: var(--discount-green);
    font-weight: 500;
}

.float-checkout-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 12px;
    text-decoration: none;
    display: block;
    text-align: center;
}

.float-checkout-btn:hover {
    background-color: var(--accent-dark);
}

.float-view-cart-btn {
    width: 100%;
    padding: 8px;
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
    text-align: center;
}

.float-view-cart-btn:hover {
    background-color: #f0f8ff;
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart-icon {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 16px;
}

.empty-cart-text {
    color: var(--text-light);
    margin-bottom: 24px;
}

.continue-shopping-btn {
    display: inline-block;
    padding: 8px 24px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.continue-shopping-btn:hover {
    background-color: #005fa3;
    color: #fff;
}


@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}

/* === Floating Cart Skeleton Loader === */

.skeleton-loader {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skeleton-item {
    display: flex;
    gap: 12px;
    align-items: center;
}

.skeleton-img {
    width: 80px;
    height: 80px;
    background: #e0e0e0;
    border-radius: 8px;
    flex-shrink: 0;
    animation: skeleton-loading 1.2s infinite ease-in-out;
}

.skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 12px;
    background: #e0e0e0;
    border-radius: 4px;
    width: 100%;
    animation: skeleton-loading 1.2s infinite ease-in-out;
}

    .skeleton-line.short {
        width: 60%;
    }

.skeleton-summary {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.skeleton-summary-line {
    height: 14px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
    animation: skeleton-loading 1.2s infinite ease-in-out;
}

@keyframes skeleton-loading {
    0% {
        background-color: #f0f0f0;
    }

    50% {
        background-color: #e0e0e0;
    }

    100% {
        background-color: #f0f0f0;
    }
}

.item-image.loader {
    background: #f0f0f0;
    position: relative;
}

    .item-image.loader::after {
        content: "";
        width: 28px;
        height: 28px;
        border: 3px solid #ccc;
        border-top-color: var(--primary-color);
        border-radius: 50%;
        animation: spin 0.7s linear infinite;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.cart-close {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
}

.close-text {
    font-size: 0.7rem;
    color: var(--text-light);
}

#floatingCartContainer {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#floatingCartContainer .float-cart-items {
    flex: 1;
    overflow-y: auto;
}

.cart-sidebar.disabled-loading {
    pointer-events: none; /* Prevents all clicks inside the sidebar */    
}