/* Shopping Cart Styles */

.cart-icon {
    position: relative;
    color: var(--text-color);
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.cart-icon:hover {
    color: var(--primary-color);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Cart Modal/Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    transition: right 0.3s ease;
}

.cart-overlay.active {
    right: 0;
}

.cart-container {
    position: absolute;
    right: 0;
    top: 0;
    width: 400px;
    max-width: 90%;
    height: 100%;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

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

.cart-header h3 {
    margin: 0;
    color: var(--text-color);
}

.close-cart {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

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

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

.empty-cart {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: var(--text-color);
}

.cart-item-details p {
    margin: 0 0 10px 0;
    color: var(--primary-color);
    font-weight: bold;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-controls button {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.quantity-controls button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.quantity-controls span {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
}

.remove-item {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

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

.cart-footer {
    padding: 20px;
    border-top: 2px solid #eee;
    background: #f9f9f9;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: bold;
}

.cart-total span:last-child {
    color: var(--primary-color);
}

.btn-block {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .cart-container {
        width: 100%;
        max-width: 100%;
    }

    /* Enhanced checkout button for mobile */
    #checkoutBtn {
        min-height: 50px;
        font-size: 1.1rem;
        font-weight: 600;
        touch-action: manipulation;
        /* Prevents zoom on double-tap */
        -webkit-tap-highlight-color: rgba(255, 107, 0, 0.3);
    }

    #checkoutBtn:active {
        transform: scale(0.98);
        background: #e05e00;
    }

    .cart-footer {
        padding: 20px;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        /* iOS notch support */
    }
}