/* ===================================
   Home Page - Product Listings
   =================================== */

/* Product Card Styles */
.product-card {
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 240px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.product-card:hover .product-image {
    transform: scale(1.08);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    padding: 12px;
}

/* Product Badge */
.product-badge {
    position: absolute;
    top: 35px;
    right: 12px;
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Product Content */
.product-content {
    padding: 1.25rem;
    background: var(--white);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.625rem;
    min-height: 48px;
    text-align: center;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-author {
    color: var(--gray-500);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    text-align: center;
}

.product-author i {
    font-size: 12px;
    margin-right: 5px;
    color: var(--primary-color);
}

/* Price Section */
.price-section {
    padding: 0.75rem 0;
    margin: auto 0 1rem 0;
    text-align: center;
}

.list-price {
    color: var(--gray-400);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.list-price span {
    text-decoration: line-through;
    font-weight: 400;
}

.current-price {
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
}

/* Details Button */
.details-btn {
    background: var(--primary-light);
    color: var(--primary-color);
    border: 2px solid transparent;
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1.25rem;
    font-weight: 700;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.details-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.3);
}

/* Add to Cart Button */
.add-to-cart-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.add-to-cart-btn:hover {
    transform: scale(1.15);
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.add-to-cart-btn i {
    font-size: 20px;
    font-weight: bold;
}

.add-to-cart-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.add-to-cart-btn.in-cart {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.add-to-cart-btn.in-cart:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

/* Product Column */
.product-col {
    margin-bottom: 2rem;
}

/* Loading Indicator */
#loadingIndicator {
    padding: 3rem 0;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 4px;
    border-color: var(--primary-color);
    border-right-color: transparent;
}

.loading-text {
    color: var(--gray-500);
    font-weight: 600;
    font-size: 1rem;
    margin-top: 1rem;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -500px;
    width: 480px;
    height: 100vh;
    background: var(--white);
    box-shadow: -6px 0 20px rgba(0, 0, 0, 0.25);
    z-index: 1050;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1040;
    display: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.cart-overlay.active {
    display: block;
}

.cart-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 2px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
}

.cart-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
}

.cart-title i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.cart-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 1.5rem;
    color: var(--white);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    line-height: 1;
    transition: var(--transition);
}

.cart-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background-color: var(--gray-50);
}

.cart-items-container::-webkit-scrollbar {
    width: 8px;
}

.cart-items-container::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.cart-items-container::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.cart-items-container::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    background: var(--white);
    transition: var(--transition);
}

.cart-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.cart-item-image {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: var(--border-radius-sm);
    background: var(--gray-50);
    padding: 0.5rem;
    border: 1px solid var(--gray-200);
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.cart-item-price {
    color: var(--accent-color);
    font-weight: 800;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-item-quantity .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: var(--border-radius-sm);
}

.cart-item-quantity span {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-700);
    min-width: 30px;
    text-align: center;
}

.cart-item-remove {
    background: transparent;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.25rem;
    transition: var(--transition);
    border-radius: var(--border-radius-sm);
}

.cart-item-remove:hover {
    background-color: rgba(239, 68, 68, 0.1);
    transform: scale(1.1);
}

.cart-footer {
    padding: 1.5rem 1.75rem;
    border-top: 2px solid var(--gray-200);
    background: var(--white);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--gray-900);
}

.cart-subtotal-amount {
    color: var(--accent-color);
    font-size: 1.5rem;
}

.btn-checkout {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
    color: var(--white);
    border: none;
    padding: 1rem;
    font-weight: 700;
    border-radius: var(--border-radius);
    font-size: 1.125rem;
    transition: var(--transition);
}

.btn-checkout:hover {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--black) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

.btn-checkout i {
    margin-right: 0.5rem;
}

.btn-view-cart {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.875rem;
    font-weight: 700;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.btn-view-cart:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
}

.cart-empty i {
    font-size: 5rem;
    color: var(--gray-300);
    margin-bottom: 1.5rem;
}

.cart-empty p {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Floating Cart Button */
.floating-cart-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: var(--white);
    border: none;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s ease;
}

.floating-cart-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 12px 32px rgba(124, 58, 237, 0.7);
}

.floating-cart-btn i {
    font-size: 28px;
}

.floating-cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 800;
    border: 3px solid var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.floating-cart-btn.pulse {
    animation: pulseCart 0.6s ease;
}

@keyframes pulseCart {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .product-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .floating-cart-btn {
        bottom: 24px;
        right: 24px;
        width: 64px;
        height: 64px;
    }

    .floating-cart-btn i {
        font-size: 26px;
    }

    .floating-cart-badge {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .product-image-wrapper {
        height: 200px;
    }

    .product-title {
        font-size: 0.95rem;
        min-height: 44px;
    }

    .product-col {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .product-image-wrapper {
        height: 180px;
    }

    .add-to-cart-btn {
        width: 38px;
        height: 38px;
    }

    .add-to-cart-btn i {
        font-size: 18px;
    }

    .product-badge {
        font-size: 10px;
        padding: 5px 10px;
    }

    .floating-cart-btn {
        width: 58px;
        height: 58px;
        bottom: 20px;
        right: 20px;
    }

    .floating-cart-btn i {
        font-size: 24px;
    }
}

