/* GhostDraw Cart System Styles */

/* Cart Button */
.cart-button {
    position: relative;
}

.cart-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    color: var(--ghost-white);
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 50px;
    height: 44px;
}

.cart-btn:hover {
    border-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,255,136,0.2);
}

.cart-icon {
    font-size: 18px;
}

.cart-count {
    background: var(--accent-color);
    color: var(--primary-bg);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    position: absolute;
    top: -8px;
    right: -8px;
}

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 400px;
    height: 100%;
    background: var(--secondary-bg);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.cart-overlay.active .cart-sidebar {
    transform: translateX(0);
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    color: var(--ghost-white);
    font-size: 1.2rem;
    font-weight: 600;
}

.cart-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.cart-close:hover {
    color: var(--ghost-white);
}

.cart-items {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.cart-item {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 15px 35px 15px 15px;
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 15px;
    align-items: start;
    position: relative;
}

.item-info h4 {
    color: var(--ghost-white);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.item-price {
    color: var(--text-secondary);
    font-size: 13px;
}

.item-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-bg);
    border-radius: 6px;
    padding: 4px;
}

.qty-btn {
    background: var(--glass-bg);
    border: 1px solid var(--border-subtle);
    color: var(--ghost-white);
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.qty-btn:hover {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: var(--primary-bg);
}

.quantity {
    color: var(--ghost-white);
    font-size: 16px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.remove-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.remove-item:hover {
    color: #ff6b6b;
}

.item-total {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 14px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border-subtle);
    background: var(--primary-bg);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ghost-white);
}

.total-amount {
    color: var(--accent-color);
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    text-align: center;
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 15px 20px;
    z-index: 10001;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

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

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ghost-white);
}

.notification-icon {
    color: var(--accent-color);
    font-weight: bold;
}

/* Checkout Modal */
.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.checkout-modal.active {
    opacity: 1;
    visibility: visible;
}

.checkout-content {
    background: var(--secondary-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

.checkout-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkout-header h2 {
    color: var(--ghost-white);
    font-size: 1.5rem;
    font-weight: 600;
}

.checkout-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.checkout-close:hover {
    color: var(--ghost-white);
}

.checkout-body {
    padding: 20px;
}

.checkout-section {
    margin-bottom: 30px;
}

.checkout-section h3 {
    color: var(--ghost-white);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.checkout-section input {
    width: 100%;
    padding: 12px 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--ghost-white);
    font-size: 14px;
    margin-bottom: 10px;
    transition: border-color 0.3s ease;
}

.checkout-section input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.checkout-section input::placeholder {
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.checkout-summary {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--ghost-white);
}

.total-line {
    border-top: 1px solid var(--border-subtle);
    padding-top: 10px;
    margin-top: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.total-line span:last-child {
    color: var(--accent-color);
}

.checkout-footer {
    padding: 20px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.checkout-footer button {
    padding: 12px 24px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-right {
        gap: 20px;
    }
    
    .cart-sidebar {
        width: 100%;
        max-width: 350px;
    }
    
    .checkout-content {
        width: 95%;
        margin: 20px;
    }
    
    .checkout-footer {
        flex-direction: column;
    }
    
    .cart-notification {
        right: 10px;
        left: 10px;
        transform: translateY(-100%);
    }
    
    .cart-notification.show {
        transform: translateY(0);
    }
    
    /* Prevent zoom on tap for all interactive elements */
    button, .qty-btn, .remove-item, .cart-btn, .cart-close, .checkout-close {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Ensure minimum touch target size */
    .qty-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .quantity-controls {
        gap: 12px;
        padding: 6px;
    }
}

@media (max-width: 480px) {
    .cart-item {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }
    
    .item-controls {
        flex-direction: row;
        justify-content: space-between;
    }
}