/**
 * Modern Cart System CSS - Glassmorphism Edition
 * Redesigned to match the header aesthetics
 */

:root {
    --cart-glass-bg: rgba(18, 22, 30, 0.95);
    --cart-border: rgba(255, 255, 255, 0.08);
    --cart-blur: 24px;
    --cart-primary: #00a8ff;
    --cart-secondary: rgba(255, 255, 255, 0.6);
    --cart-text: #ffffff;
}

/* Cart Toggle Button */
.cart-toggle {
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-toggle:hover {
    color: var(--cart-primary) !important;
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.7rem;
    line-height: 18px;
    text-align: center;
    background: #ff4757;
    color: white;
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
    animation: cartBounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cartBounce {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Cart Dropdown Container */
.cart-dropdown {
    position: relative;
    display: inline-block;
}

/* Glass Dropdown Content */
.cart-dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    width: 340px;
    max-height: 500px;
    overflow-y: auto;
    background: var(--cart-glass-bg);
    backdrop-filter: blur(var(--cart-blur));
    -webkit-backdrop-filter: blur(var(--cart-blur));
    border: 1px solid var(--cart-border);
    border-radius: 16px;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    margin-top: 15px;
    padding: 18px;
}

/* Show State */
.cart-dropdown-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Empty State */
.cart-empty-state {
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cart-empty-state i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cart-empty-state p {
    color: var(--cart-secondary);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.cart-browse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.1), rgba(0, 168, 255, 0.05));
    border: 1px solid rgba(0, 168, 255, 0.2);
    color: #00a8ff;
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cart-browse-btn:hover {
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.2), rgba(0, 168, 255, 0.1));
    border-color: rgba(0, 168, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 168, 255, 0.15);
    color: #fff;
}

/* Cart Items List */
.cart-items-list {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
    /* Space for scrollbar */
}

/* Item Row */
.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.cart-item-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding-right: 15px;
}

.cart-item-name {
    color: var(--cart-text);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-qty {
    color: var(--cart-secondary);
    font-size: 0.75rem;
    margin-top: 2px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-item-price {
    color: var(--cart-primary);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.cart-remove-btn {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.cart-remove-btn:hover {
    background: #ff4757;
    color: #fff;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.4);
}

/* Footer Section */
.cart-footer-section {
    position: relative;
    border-top: 1px solid var(--cart-border);
    padding-top: 15px;
    margin-top: 10px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 5px;
}

.cart-total-row span:first-child {
    color: var(--cart-secondary);
    font-size: 0.9rem;
}

.cart-total-price {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 168, 255, 0.3);
}

/* Checkout Button */
.cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #00a8ff, #0097e6);
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 10px;
    box-shadow: 0 5px 15px rgba(0, 168, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 168, 255, 0.35);
    color: #fff;
    filter: brightness(1.1);
}

/* Clear Cart Button */
.cart-clear-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: rgba(255, 71, 87, 0.05);
    border: 1px solid rgba(255, 71, 87, 0.2);
    color: #ff6b81;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-clear-btn:hover {
    background: rgba(255, 71, 87, 0.15);
    border-color: rgba(255, 71, 87, 0.4);
    color: #ff4757;
}

/* Scrollbar Styling */
.cart-items-list::-webkit-scrollbar {
    width: 4px;
}

.cart-items-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 2px;
}

.cart-items-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.cart-items-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 480px) {
    .cart-dropdown-content {
        width: 300px;
        right: -50px;
        /* Offset for mobile alignment if needed */
    }
}