/* ========== СТИЛИ ДЛЯ СТРАНИЦЫ КАТАЛОГА ========== */

.catalog-page {
    padding: 60px 0;
    background-color: #FCC200;
}

.catalog-title {
    font-family: 'Dela Gothic One', cursive;
    font-size: 48px;
    color: #ffffff;
    text-align: center;
    margin-bottom: 50px;
}

/* Сетка карточек (единая, без категорий) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* Карточка товара */
.product-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Область изображения (одинаковая высота) */
.product-image {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 12px;
    margin-bottom: 15px;
}

.product-image img {
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
}

/* Название товара */
.product-name {
    font-size: 18px;
    font-weight: 700;
    color: #292929;
    margin-bottom: 10px;
    line-height: 1.3;
    min-height: 48px;
}

/* Размер / доп. информация */
.product-size {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* Цена */
.product-price {
    font-size: 24px;
    font-weight: 800;
    color: #E63946;
    margin-bottom: 20px;
}

/* Блок с кнопками */
.product-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
    flex-wrap: wrap;
    justify-content: center;
}

/* Базовая кнопка */
.product-btn {
    background-color: transparent;
    border: 2px solid #E63946;
    border-radius: 40px;
    padding: 10px 40px;
    font-size: 16px;
    font-weight: 600;
    color: #E63946;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
}

.product-btn:hover {
    background-color: #E63946;
    color: white;
}

/* Кнопка "Заказать" (красная с белым текстом) */
.order-btn {
    background-color: #E63946;
    color: white;
    border: 2px solid #E63946;
}

.order-btn:hover {
    background-color: #b32d3a;
    border-color: #b32d3a;
}

.loading {
    text-align: center;
    font-size: 20px;
    padding: 50px;
    color: #666;
}

/* ========== МОДАЛЬНОЕ ОКНО ========== */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    max-width: 500px;
    width: 90%;
    padding: 30px;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
}

.modal-content {
    position: relative;
}

.modal .close {
    position: absolute;
    top: -20px;
    right: -10px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s;
}

.modal .close:hover {
    color: #E63946;
}

.modal h3 {
    font-family: 'Dela Gothic One', cursive;
    font-size: 28px;
    color: #E63946;
    margin-bottom: 20px;
    text-align: center;
}

.modal-product-info p {
    margin: 8px 0;
    font-size: 18px;
    color: #292929;
    font-weight: 500;
}

.price-choice {
    margin: 25px 0;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 16px;
}

.price-choice p {
    font-size: 16px;
    font-weight: 600;
    color: #292929;
    margin-bottom: 12px;
}

.price-choice label {
    display: block;
    margin: 10px 0;
    font-size: 16px;
    cursor: pointer;
}

/* ===== ПОЛЯ ВВОДА В МОДАЛЬНОМ ОКНЕ (для знаков и огнетушителей) ===== */
.form-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 20px 0;
}

.form-fields input,
.form-fields textarea {
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    background-color: #fafafa;
    transition: all 0.3s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

/* Состояние при наведении */
.form-fields input:hover,
.form-fields textarea:hover {
    background-color: #ffffff;
    border-color: #ccc;
}

/* Состояние при фокусе (когда кликнули на поле) */
.form-fields input:focus,
.form-fields textarea:focus {
    border-color: #E63946;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.1);
}

/* Placeholder (подсказка внутри поля) */
.form-fields input::placeholder,
.form-fields textarea::placeholder {
    color: #999;
    font-size: 15px;
}

/* Обязательное поле – если пустое и невалидное */
.form-fields input:invalid:not(:placeholder-shown),
.form-fields textarea:invalid:not(:placeholder-shown) {
    border-color: #ff6b6b;
    background-color: #fff5f5;
}

/* Обязательное поле – если валидное */
.form-fields input:valid:not(:placeholder-shown),
.form-fields textarea:valid:not(:placeholder-shown) {
    border-color: #51cf66;
    background-color: #f5fff5;
}

/* Стиль для текстового поля (textarea) */
.form-fields textarea {
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.modal-actions button {
    background-color: #E63946;
    border: none;
    border-radius: 40px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-actions button:first-child {
    background-color: #E63946;
}

.modal-actions button:first-child:hover {
    background-color: #b32d3a;
}

#cancelOrder {
    background-color: #ccc;
    color: #333;
}

#cancelOrder:hover {
    background-color: #aaa;
}

/* Адаптивность */
@media (max-width: 768px) {
    .catalog-page {
        padding: 40px 20px;
    }

    .catalog-title {
        font-size: 32px;
        margin-bottom: 30px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-card {
        padding: 15px;
    }

    .product-name {
        font-size: 16px;
    }

    .product-price {
        font-size: 20px;
    }

    .product-actions {
        flex-direction: column;
        gap: 8px;
    }

    .modal {
        width: 95%;
        padding: 20px;
    }

    .modal h3 {
        font-size: 24px;
    }

    .form-fields input,
    .form-fields textarea {
        padding: 12px 14px;
        font-size: 15px;
        border-radius: 10px;
    }
}