/* Cart Modal Styles */

/* Cart Button in Header */
.cart-button {
    background: transparent;
    border: 1px solid var(--noir-gray, #ccc);
    color: var(--noir-white, white);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    height: auto;
    line-height: 1;
}

.cart-button:hover {
    background: #1a4d2e;
    border-color: #1a4d2e;
    transform: translateY(-1px);
}

.cart-count {
    background: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    min-width: 18px;
    text-align: center;
}

.mobile-cart {
    background: none;
    border: none;
    color: var(--noir-white, white);
    font-size: 1rem;
    padding: 10px 0;
    text-align: center;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Cart Modal Overlay */
.cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

/* Cart Modal */
.cart-modal {
    background: var(--noir-charcoal, #2a2a2a);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Cart Modal Header */
.cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-modal-header h2 {
    color: var(--noir-white, white);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.cart-modal-close {
    background: none;
    border: none;
    color: var(--noir-white, white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* Cart Modal Content */
.cart-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 25px;
    max-height: 50vh;
}

.cart-loading,
.cart-empty,
.cart-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--noir-light-gray, #ccc);
    font-size: 1.1rem;
}

/* Cart Modal Items */
.cart-modal-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 15px;
}

.cart-modal-item:last-child {
    border-bottom: none;
}

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

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

.cart-item-details h4 {
    color: var(--noir-white, white);
    margin: 0 0 5px 0;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-size {
    color: var(--noir-light-gray, #ccc);
    margin: 0 0 5px 0;
    font-size: 0.85rem;
}

.cart-item-price {
    color: #2d5016;
    margin: 0;
    font-weight: 500;
    font-size: 0.9rem;
}

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

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

.quantity-btn {
    background: #007bff;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.quantity {
    color: var(--noir-white, white);
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

.cart-item-subtotal {
    color: var(--noir-white, white);
    font-weight: 600;
    font-size: 0.95rem;
    text-align: right;
    min-width: 60px;
}

/* Cart Modal Footer */
.cart-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

.cart-total {
    text-align: center;
    margin-bottom: 15px;
}

.cart-total strong {
    color: var(--noir-white, white);
    font-size: 1.3rem;
}

.cart-modal-buttons {
    display: flex;
    gap: 12px;
}

.continue-shopping-btn,
.checkout-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.continue-shopping-btn {
    background: #6c757d;
    color: white;
}

.continue-shopping-btn:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.checkout-btn {
    background: #28a745;
    color: white;
}

.checkout-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-modal {
        max-width: 95%;
        max-height: 90vh;
    }

    .cart-modal-header {
        padding: 15px 20px;
    }

    .cart-modal-content {
        padding: 0 20px;
    }

    .cart-modal-footer {
        padding: 15px 20px;
    }

    .cart-modal-item {
        flex-wrap: wrap;
        gap: 10px;
    }

    .cart-item-details h4 {
        white-space: normal;
    }

    .cart-modal-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .cart-modal {
        max-width: 100%;
        max-height: 95vh;
        margin: 0;
    }

    .cart-modal-header h2 {
        font-size: 1.3rem;
    }

    .cart-modal-item img {
        width: 50px;
        height: 50px;
    }
}