/* ============================================
   CATALOG.CSS
   Стили для каталога РосАква-М
   Версия: адаптивная, Bootstrap 5.3.3
   ============================================ */

/* ===== 1. КАРТОЧКИ ТОВАРОВ ===== */
.card-model {
    transition: all 0.25s ease;
    border: none;
    border-radius: 1.25rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03), 0 2px 6px rgba(0, 0, 0, 0.05);
    background: white;
    height: 100%;
    overflow: hidden;
}

.card-model:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.12);
}

.card-img-placeholder {
    background: #eef2fa;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c8ea0;
    font-size: 2.5rem;
    border-bottom: 1px solid #e9ecef;
}

.badge-capacity {
    background-color: #eef2fa;
    color: #17719d;
    font-weight: 600;
    padding: 0.4rem 0.9rem;
    border-radius: 40px;
    font-size: 1.25rem;
}

.price-text {
    font-size: 1.65rem;
    font-weight: 800;
    color: #17719d;
    letter-spacing: -0.3px;
}

.model-name {
    font-weight: 700;
    color: #0b2b3b;
}

/* ===== 2. КНОПКИ В КАРТОЧКАХ ===== */
.btn-group-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.btn-primary-special {
    background: #17719d;
    border: none;
    border-radius: 40px;
    font-weight: 600;
    padding: 0.6rem 1rem;
    transition: 0.2s;
    font-size: 0.85rem;
    width: 100%;
    color: white;
}

.btn-primary-special:hover {
    background: #0e5a7e;
    transform: scale(0.97);
    color: white;
}

.btn-outline-special {
    border: 1.5px solid #17719d;
    color: #17719d;
    background: white;
    border-radius: 40px;
    font-weight: 600;
    transition: 0.2s;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    width: 100%;
    margin-bottom: 10px;
}

.btn-outline-special:hover {
    background: #17719d;
    color: white;
}

/* ===== 3. ЗАГОЛОВКИ ===== */
.section-title {
    border-left: 5px solid #17719d;
    padding-left: 1rem;
    font-weight: 700;
}

.price-large {
    font-size: 1.8rem;
    font-weight: 800;
    color: #17719d;
}

/* ===== 4. ТАБЛИЦА ===== */
.table-responsive-custom {
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
}

.table thead {
    background: #1e2f3a;
    color: white;
}

.table-hover tbody tr:hover {
    background-color: #f0f6fa;
}

.table-img-thumb {
    width: 50px;
    height: 50px;
    background: #eef2fa;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c8ea0;
    font-size: 1.2rem;
}

/* Кнопки в таблице */
.request-btn-sm,
.specs-btn-sm {
    background: none;
    border: 1px solid #17719d;
    color: #17719d;
    border-radius: 30px;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: 0.2s;
    margin: 0 2px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.request-btn-sm {
    background: #17719d;
    color: white;
}

.request-btn-sm:hover,
.specs-btn-sm:hover {
    background: #17719d;
    color: white;
    transform: translateY(-2px);
}

/* ===== 5. OFFCANVAS (БОКОВАЯ ПАНЕЛЬ) ===== */
.offcanvas {
    --bs-offcanvas-width: 800px;
}

.offcanvas-header {
    background: linear-gradient(135deg, #0b2b3b 0%, #17719d 100%);
    color: white;
}

.btn-close-white {
    filter: brightness(0) invert(1);
}

.request-form-side {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    height: 100%;
}

.request-form-side .form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 10px 15px;
}

.request-form-side .form-control:focus {
    border-color: #17719d;
    box-shadow: 0 0 0 0.2rem rgba(23, 113, 157, 0.25);
}

/* Таблица характеристик в offcanvas */
.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid #e9ecef;
}

.specs-table td {
    padding: 12px 8px;
    vertical-align: top;
}

.specs-table td:first-child {
    font-weight: 600;
    color: #17719d;
    width: 40%;
    background-color: #f8f9fa;
}

.specs-description {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.specs-image {
    background: #eef2fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    margin-bottom: 1rem;
    min-height: 300px;
    overflow: hidden;
}

.specs-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 16px;
}

/* ===== 6. ФОРМА ТЕЛЕФОНА И КАПЧА ===== */
.phone-mask {
    letter-spacing: 0.5px;
    font-family: 'Open Sans', monospace;
}

.phone-mask:focus {
    border-color: #17719d;
    box-shadow: 0 0 0 0.2rem rgba(23, 113, 157, 0.25);
}

.phone-mask.error,
.email-input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* reCAPTCHA в offcanvas */
#specsDynamicContent .g-recaptcha {
    transform: scale(0.88);
    transform-origin: 0 0;
    margin-bottom: 0.5rem;
}

/* ===== 7. Z-INDEX КОНФЛИКТЫ ===== */
.modal {
    z-index: 1050 !important;
}

.offcanvas {
    z-index: 1060 !important;
}

.offcanvas-backdrop {
    z-index: 1059 !important;
}

.modal-backdrop {
    z-index: 1049 !important;
}

.offcanvas.show {
    visibility: visible;
    z-index: 1060;
}

.offcanvas-backdrop.show {
    z-index: 1059;
    opacity: 0.5;
}

.offcanvas-body {
    position: relative;
    z-index: 1061;
}

.request-form-side,
.specs-table,
.specs-description,
.specs-image {
    position: relative;
    z-index: 1062;
}

.offcanvas .btn,
.offcanvas button,
.offcanvas input,
.offcanvas select,
.offcanvas textarea {
    position: relative;
    z-index: 1063;
}

/* ===== 8. АДАПТИВНЫЙ ПЕРЕКЛЮЧАТЕЛЬ ВИДА ===== */
.catalog-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.catalog-header-wrapper .section-title {
    margin: 0;
    font-size: 1.75rem;
    flex: 1;
    min-width: 250px;
}

.btn-group-wrapper {
    flex-shrink: 0;
}

/* ===== 9. АДАПТИВНАЯ ТАБЛИЦА ===== */
.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
}

.table-responsive-custom {
    min-width: 600px;
}

#productsTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#productsTable th,
#productsTable td {
    padding: 12px 10px;
    vertical-align: middle;
}

#productsTable th {
    white-space: nowrap;
}

/* ============================================
   10. МЕДИА-ЗАПРОСЫ (АДАПТАЦИЯ)
   ============================================ */

/* Планшеты (768px и меньше) */
@media (max-width: 768px) {
    /* Карточки */
    .price-text {
        font-size: 1.3rem;
    }
    
    /* Offcanvas */
    .offcanvas {
        --bs-offcanvas-width: 100%;
    }
    
    .specs-image {
        min-height: 250px;
    }
    
    .specs-image img {
        max-height: 300px;
    }
    
    /* reCAPTCHA */
    #specsDynamicContent .g-recaptcha {
        transform: scale(0.77);
        transform-origin: 0 0;
    }
    
    /* Переключатель вида */
    .catalog-header-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .catalog-header-wrapper .section-title {
        text-align: center;
        font-size: 1.5rem;
    }
    
    .btn-group-wrapper .btn-group {
        width: 100%;
        display: flex;
    }
    
    .btn-group-wrapper .btn {
        flex: 1;
        white-space: nowrap;
        font-size: 14px;
        padding: 8px 12px;
    }
    
    /* Таблица */
    #productsTable {
        font-size: 13px;
    }
    
    #productsTable th,
    #productsTable td {
        padding: 10px 8px;
    }
    
    .table-img-thumb {
        width: 40px;
        height: 40px;
    }
    
    .table-img-thumb img {
        width: 35px !important;
        height: 35px !important;
    }
    
    .badge {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .specs-btn-sm,
    .request-btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Телефоны (576px и меньше) */
@media (max-width: 576px) {
    /* Переключатель вида */
    .catalog-header-wrapper {
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .catalog-header-wrapper .section-title {
        font-size: 1.2rem;
    }
    
    .btn-group-wrapper .btn {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .btn-group-wrapper .btn i {
        margin-right: 4px;
        font-size: 12px;
    }
    
    /* Таблица */
    #productsTable {
        font-size: 12px;
    }
    
    #productsTable th,
    #productsTable td {
        padding: 8px 6px;
    }
    
    .table-img-thumb {
        width: 35px;
        height: 35px;
    }
    
    .table-img-thumb img {
        width: 30px !important;
        height: 30px !important;
    }
    
    .badge {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .specs-btn-sm,
    .request-btn-sm {
        padding: 3px 6px;
        font-size: 10px;
        margin: 2px;
    }
    
    .specs-btn-sm i,
    .request-btn-sm i {
        font-size: 10px;
    }
    
    .fw-bold.fs-6 {
        font-size: 13px !important;
    }
    
    /* Минимальная ширина колонок таблицы */
    .table-responsive-wrapper {
        overflow-x: auto;
    }
    
    #productsTable th:nth-child(1),
    #productsTable td:nth-child(1) {
        min-width: 50px;
    }
    
    #productsTable th:nth-child(2),
    #productsTable td:nth-child(2) {
        min-width: 100px;
    }
    
    #productsTable th:nth-child(3),
    #productsTable td:nth-child(3) {
        min-width: 80px;
    }
    
    #productsTable th:nth-child(4),
    #productsTable td:nth-child(4) {
        min-width: 80px;
    }
    
    #productsTable th:nth-child(5),
    #productsTable td:nth-child(5) {
        min-width: 100px;
    }
}

/* Маленькие телефоны (480px и меньше) */
@media (max-width: 480px) {
    .btn-group-wrapper .btn {
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .btn-group-wrapper .btn i {
        font-size: 11px;
    }
}

/* Очень узкие экраны (380px и меньше) */
@media (max-width: 380px) {
    #productsTable {
        font-size: 11px;
    }
    
    #productsTable th,
    #productsTable td {
        padding: 6px 4px;
    }
    
    .specs-btn-sm,
    .request-btn-sm {
        padding: 2px 5px;
        font-size: 9px;
    }
    
    .badge {
        font-size: 9px;
        padding: 2px 5px;
    }
}

/* Экстремально узкие (320px и меньше) */
@media (max-width: 320px) {
    .btn-group-wrapper .btn {
        font-size: 10px;
        padding: 5px 8px;
    }
    
    .btn-group-wrapper .btn i {
        margin-right: 3px;
        font-size: 10px;
    }
}