/* Стили корзины (header/footer в common.css) */
.empty-cart-message {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-cart-message i {
    font-size: 40px;
    margin-bottom: 15px;
    color: #ddd;
}

/* Шапка и подвал таблицы корзины */
.cart-header th {
    background: #f5f5f5;
    padding: 12px 15px;
    text-align: center;
    font-weight: 500;
}

/* Колонки и контент таблицы корзины */
.product-image img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.product-category {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-bottom: 3px;
}

.qty-input {
    width: 60px;
    padding: 6px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.remove-btn {
    background: none;
    border: none;
    color: #ff5252;
    cursor: pointer;
    font-size: 1.1em;
    padding: 5px;
}

.remove-btn:hover {
    color: #d50000;
}

#checkout-btn {
    width: auto;
    min-width: 160px;
    height: auto;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #005b96;
    white-space: nowrap;
}

#checkout-btn:hover {
    background-color: #004074;
}

#checkout-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.sink-dimensions-column {
    display: table-cell; /* По умолчанию показываем колонку */
}

.product-sink-dimensions {
    white-space: nowrap;
    text-align: center;
}

/* Мобильная корзина: карточный вид с 768px, заголовок строго над своим значением */
@media (max-width: 768px) {
    .cart-container .products-table,
    .cart-container .products-table thead,
    .cart-container .products-table tbody,
    .cart-container .products-table tr,
    .cart-container .products-table td,
    .cart-container .products-table th {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .cart-container .products-table thead {
        display: none;
    }

    .cart-container .products-table tbody tr {
        margin-bottom: 16px;
        padding: 12px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.08);
        border: 1px solid #eee;
    }

    .cart-container .products-table tbody td {
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
        text-align: left;
    }

    .cart-container .products-table tbody td:last-of-type {
        border-bottom: none;
    }

    .cart-container .products-table tbody td::before {
        content: attr(data-label);
        display: block;
        font-weight: 700;
        font-size: 15px;
        color: #3c3c3c;
        margin-bottom: 6px;
    }

    .cart-container .products-table tbody td[data-label=""]::before {
        display: none;
    }

    .cart-container .product-image img {
        max-width: 120px;
        height: auto;
    }

}

/* Модальное окно оформления заказа (перекрывает базовые стили модалок) */
#order-modal.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#order-modal.modal.show {
    display: flex;
}

#order-modal .modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 2px 15px rgba(0,0,0,0.3);
}

#order-modal .modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    font-family: var(--font-universal);
}

#order-modal .modal-close:hover {
    color: #ff9900;
}

#order-modal .modal-content h2 {
    font-family: var(--font-h);
    color: var(--text-color-dark);
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.order-form {
    margin-top: 20px;
}

.order-form .form-group {
    margin-bottom: 20px;
}

.order-form .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-color-dark);
    font-family: var(--font-universal);
}

.order-form .form-group input,
.order-form .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--font-universal);
    color: #3c3c3c;
    background-color: #f9f9f9;
}

.order-form .form-group input:focus,
.order-form .form-group textarea:focus {
    outline: none;
    border-color: #005b96;
    background-color: #fff;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

.submit-order-btn {
    background-color: #005b96;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-family: var(--font-universal);
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.submit-order-btn:hover {
    background-color: #004074;
}

.submit-order-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.cancel-order-btn {
    background-color: #999;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-universal);
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.cancel-order-btn:hover {
    background-color: #777;
}

@media (max-width: 588px) {
    #order-modal .modal-content {
        padding: 20px 15px;
    }
    
    #order-modal .modal-content h2 {
        font-size: 18px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .submit-order-btn,
    .cancel-order-btn {
        width: 100%;
        text-align: center;
    }
}

/* Индикатор загрузки на кнопке отправки заказа */
.submit-order-btn.loading {
    position: relative;
    color: transparent !important;
}

.submit-order-btn.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: cart-spin 0.8s linear infinite;
}

@keyframes cart-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Сообщения об ошибках в форме заказа */
.error-message {
    color: #d50000;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.form-group.error input,
.form-group.error textarea {
    border-color: #d50000;
}

.form-group.error .error-message {
    display: block;
}
