/* Shopping Cart Styles */

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
}

/* Cart Icon Container */
.cart-icon-container {
    position: relative;
    cursor: pointer;
    padding: 8px;
}

.cart-icon-container:hover {
    opacity: 0.8;
}

/* Add to Cart Button */
.btn-add-to-cart {
    background: #6c63ff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-add-to-cart:hover {
    background: #5a52d5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

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

.btn-add-to-cart svg {
    width: 18px;
    height: 18px;
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.cart-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.cart-notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #333;
}

.cart-notification-content svg {
    color: #4CAF50;
    flex-shrink: 0;
}

/* Mini Cart Dropdown */
.mini-cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-width: 90vw;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    margin-top: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.mini-cart-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mini-cart-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
}

.mini-cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-cart-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

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

#miniCartItems {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
}

/* Mini Cart Item */
.mini-cart-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.mini-cart-item:hover {
    background: #f8f9fa;
}

.mini-cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

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

.mini-cart-item-details h4 {
    font-size: 14px;
    margin: 0 0 4px 0;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-cart-item-details p {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.mini-cart-remove {
    background: #ff4444;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.mini-cart-remove:hover {
    background: #cc0000;
    transform: scale(1.1);
}

.mini-cart-more {
    text-align: center;
    color: #666;
    font-size: 13px;
    margin: 8px 0;
}

/* Mini Cart Empty State */
.mini-cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.mini-cart-empty svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.mini-cart-empty p {
    margin: 0;
    font-size: 14px;
}

/* Mini Cart Footer */
.mini-cart-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

.mini-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 16px;
}

.mini-cart-subtotal strong {
    font-size: 18px;
    color: #6c63ff;
}

.btn-view-cart,
.btn-checkout {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.btn-view-cart {
    background: #f5f5f5;
    color: #333;
}

.btn-view-cart:hover {
    background: #e8e8e8;
}

.btn-checkout {
    background: #6c63ff;
    color: white;
    margin-bottom: 0;
}

.btn-checkout:hover {
    background: #5a52d5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

/* Quantity Controls */
.quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 4px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #6c63ff;
    color: white;
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .mini-cart-dropdown {
        width: calc(100vw - 40px);
        right: 20px;
    }

    .cart-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Floating Cart Icon */
.floating-cart-icon {
    display: none; /* Hidden by default, shown in responsive-styles.css */
    position: fixed;
    top: 50%;
    right: 25px;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: var(--main-gradient, linear-gradient(135deg, #898fa0, #706d9c, #926ecc));
    color: white;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.15));
    z-index: 995; /* Below chat widget (1000) but above most content */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 0;
}

.floating-cart-icon:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 12px 28px rgba(114, 109, 156, 0.4);
    color: white;
    opacity: 1;
}

.floating-cart-icon svg {
    stroke: white;
}

.floating-cart-icon .cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    display: flex; /* Overrides default display:none */
}
