/* ============================================================================
   PRODUCTS.CSS - ОПТИМІЗОВАНА ВЕРСІЯ
   ============================================================================ */

/* ============================================================================
   БАЗОВІ СТИЛІ
   ============================================================================ */

.products-page {
    max-width: 1400px;
    margin: 140px auto;
    padding: 0 !important;
    min-height: 100vh;
    background: #fff;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================================
   УЛЬТРАКОМПАКТНИЙ HERO + ФІЛЬТРИ (в один рядок)
   ============================================================================ */

.hero-products--ultra-compact {
    padding: 12px 0 !important;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.hero-products--ultra-compact .hero-content {
    padding: 0 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Заголовок зліва, Фільтри справа */
.hero-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.hero-title-block {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.hero-products--ultra-compact .hero-icon {
    font-size: 2rem !important;
    margin: 0 !important;
    line-height: 1;
    animation: none; /* Вимкнено bounce */
}

.hero-products--ultra-compact h1 {
    font-size: 1.75rem !important;
    margin: 0 !important;
    line-height: 1.2;
    white-space: nowrap;
    color: #1a1a1a;
}

/* Фільтри inline */
.hero-filters-block {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group-inline label {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
}

.filter-select-compact {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    min-width: 140px;
    transition: border-color 0.2s ease;
}

.filter-select-compact:hover {
    border-color: #007bff;
}

.filter-select-compact:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

.filter-reset-compact {
    padding: 6px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-reset-compact:hover {
    background: #e0e0e0;
    transform: rotate(180deg);
}

/* ============================================================================
   BREADCRUMBS
   ============================================================================ */

.breadcrumbs {
    padding: 8px 0;
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
}

.breadcrumbs .container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumbs a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumbs a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.breadcrumbs .separator {
    color: #999;
}

.breadcrumbs .current {
    color: #666;
}

/* ============================================================================
   СПИСОК ПРОДУКТІВ
   ============================================================================ */

.products-list {
    padding: 16px 0;
    background: #f8f8f8;
}

.products-count {
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

.products-count strong {
    color: #007bff;
    font-weight: 700;
}

.vist-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 0;
    margin: 0;
}

/* ============================================================================
   СТАН "НЕМАЄ ПРОДУКТІВ"
   ============================================================================ */

.no-products {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.no-products-icon {
    font-size: 5rem;
    margin-bottom: 24px;
    opacity: 0.3;
}

.no-products h2 {
    font-size: 1.8rem;
    margin-bottom: 16px;
    color: #333;
}

.no-products p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 24px;
}

.contact-phone {
    display: inline-block;
    margin-top: 24px;
    padding: 16px 32px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.contact-phone:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

/* ============================================================================
   СЕКЦІЯ "ЧОМУ VIST"
   ============================================================================ */

.why-vist-section {
    background: #fff;
    padding: 60px 20px;
}

.why-vist-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    color: #1a1a1a;
    font-weight: 700;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.benefit-card {
    background: #f8f8f8;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.benefit-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: #007bff;
    background: white;
}

.benefit-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.benefit-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #1a1a1a;
    font-weight: 600;
}

.benefit-card p {
    color: #666;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* ============================================================================
   CTA СЕКЦІЯ
   ============================================================================ */

.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 16px;
    font-weight: 700;
}

.cta-section p {
    font-size: 1.1rem;
    margin-bottom: 32px;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: white;
    color: #667eea;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255,255,255,0.3);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: #667eea;
}

/* ============================================================================
   SLIDE-IN ПАНЕЛЬ
   ============================================================================ */

.slide-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.slide-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.slide-panel {
    position: fixed;
    top: 0;
    right: -600px;
    width: 600px;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    box-shadow: -2px 0 20px rgba(0,0,0,0.2);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.slide-panel.active {
    right: 0;
}

.panel-header {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    flex: 1;
    padding-right: 16px;
}

.btn-close-panel {
    width: 40px;
    height: 40px;
    border: none;
    background: #f0f0f0;
    color: #666;
    font-size: 2rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close-panel:hover {
    background: #e0e0e0;
    color: #333;
    transform: rotate(90deg);
}

.panel-image-gallery {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.main-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8f8f8;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
}

.thumbnail-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.thumbnail {
    aspect-ratio: 1 / 1;
    background: #f8f8f8;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.thumbnail:hover {
    border-color: #007bff;
    transform: translateY(-2px);
}

.thumbnail.active {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.2);
}

.panel-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    position: sticky;
    top: 89px;
    background: #fff;
    z-index: 9;
}

.tab-button {
    flex: 1;
    padding: 16px;
    border: none;
    background: transparent;
    color: #666;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    color: #007bff;
    background: rgba(0,123,255,0.05);
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.panel-content {
    padding: 24px;
    flex: 1;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.specs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.specs-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.specs-table tr:last-child {
    border-bottom: none;
}

.specs-table td {
    padding: 16px;
}

.specs-table td:first-child {
    background: #f8f8f8;
    font-weight: 600;
    width: 40%;
    border-right: 1px solid #e0e0e0;
}

.spec-key-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spec-key-label span:first-child {
    font-size: 1.2rem;
}

.description-content {
    line-height: 1.6;
    color: #666;
}

.price-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    color: white;
}

.price-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
}

.panel-cta {
    padding: 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    position: sticky;
    bottom: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.btn-cta {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-order {
    background: #007bff;
    color: white;
}

.btn-order:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.btn-request {
    background: #fff;
    color: #007bff;
    border: 2px solid #007bff;
}

.btn-request:hover {
    background: #007bff;
    color: white;
}

/* ============================================================================
   АДАПТИВНІСТЬ
   ============================================================================ */

@media (max-width: 1024px) {
    .hero-filter-row {
        gap: 16px;
    }
    
    .filter-select-compact {
        min-width: 120px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .hero-filter-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .hero-title-block,
    .hero-filters-block {
        width: 100%;
    }
    
    .hero-filters-block {
        justify-content: space-between;
    }
    
    .hero-products--ultra-compact .hero-icon {
        font-size: 1.75rem !important;
    }
    
    .hero-products--ultra-compact h1 {
        font-size: 1.5rem !important;
    }
    
    .slide-panel {
        width: 100%;
        right: -100%;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-products--ultra-compact {
        padding: 10px 0 !important;
    }
    
    .hero-products--ultra-compact .hero-content {
        padding: 0 16px;
    }
    
    .hero-products--ultra-compact .hero-icon {
        font-size: 1.5rem !important;
    }
    
    .hero-products--ultra-compact h1 {
        font-size: 1.25rem !important;
        white-space: normal;
    }
    
    .hero-filters-block {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .filter-group-inline {
        justify-content: space-between;
    }
    
    .filter-select-compact {
        min-width: 0;
        flex: 1;
    }
    
    .filter-reset-compact {
        width: 100%;
    }
    
    .vist-products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .panel-content,
    .panel-image-gallery,
    .panel-cta {
        padding: 16px;
    }
    
    .thumbnail-images {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .btn-cta {
        width: 100%;
    }
    
    .panel-cta {
        flex-direction: column;
    }
}

/* ============================================================================
   ПРИХОВУВАННЯ СТАРИХ ЕЛЕМЕНТІВ
   ============================================================================ */

.products-filters,
.category-tabs,
.hero-products:not(.hero-products--ultra-compact) {
    display: none !important;
}
/* ============================================================================
   УЛЬТРАКОМПАКТНІ КАРТКИ ПРОДУКТІВ
   Додайте в кінець products-CLEAN.css
   ============================================================================ */

/* Перевизначаємо базові стилі картки для компактності */
.vist-products-grid {
    gap: 16px !important;  /* Було 24px */
    margin-top: 0 !important;
}

.vist-product-card {
    padding: 12px !important;  /* Було 20px */
    gap: 8px !important;  /* Було 16px */
    min-height: auto !important;
}

/* Зображення продукту - компактніше */
.vist-card-image {
    height: 180px !important;  /* Було 240px */
    margin-bottom: 8px !important;  /* Було 16px */
}

.vist-card-image img {
    max-height: 160px !important;  /* Було 220px */
}

/* Тип продукту - менший */
.vist-card-type {
    font-size: 0.7rem !important;  /* Було 0.75rem */
    padding: 3px 8px !important;  /* Було 4px 12px */
    margin-bottom: 6px !important;  /* Було 8px */
}

/* Заголовок - компактніший */
.vist-card-title {
    font-size: 1rem !important;  /* Було 1.2rem */
    line-height: 1.3 !important;  /* Було 1.4 */
    margin-bottom: 4px !important;  /* Було 8px */
    min-height: 40px !important;  /* Було 56px - 2 рядки */
    -webkit-line-clamp: 2 !important;
}

/* Підзаголовок - менший */
.vist-card-subtitle {
    font-size: 0.8rem !important;  /* Було 0.9rem */
    margin-bottom: 6px !important;  /* Було 12px */
    line-height: 1.3 !important;
    max-height: 32px !important;  /* 2 рядки */
}

/* Список характеристик - компактніший */
.vist-card-specs {
    gap: 4px !important;  /* Було 6px */
    margin-bottom: 8px !important;  /* Було 12px */
    font-size: 0.8rem !important;  /* Було 0.85rem */
}

.vist-card-specs li {
    padding: 4px 8px !important;  /* Було 6px 12px */
}

/* Мета інформація - компактніша */
.vist-card-meta {
    gap: 8px !important;  /* Було 12px */
    margin-bottom: 8px !important;  /* Було 12px */
    font-size: 0.8rem !important;  /* Було 0.85rem */
}

/* Статус - менший */
.vist-status {
    padding: 3px 8px !important;  /* Було 4px 12px */
    font-size: 0.75rem !important;  /* Було 0.8rem */
}

/* Ціна - менша */
.vist-price {
    font-size: 1.2rem !important;  /* Було 1.4rem */
}

/* Кнопка - компактніша */
.vist-btn-card {
    padding: 10px 20px !important;  /* Було 12px 24px */
    font-size: 0.9rem !important;  /* Було 0.95rem */
    margin-top: auto !important;
}

/* ============================================================================
   ОПТИМІЗАЦІЯ ВІДСТУПІВ СТОРІНКИ
   ============================================================================ */

/* Видаляємо зайві відступи */
.products-list {
    padding: 8px 0 !important;  /* Було 16px */
}

.products-list .container {
    padding: 0 16px !important;  /* Було 0 20px */
}

/* Хлібні крихти ще компактніші */
.breadcrumbs--compact {
    padding: 6px 0 !important;  /* Було 8px */
}

/* Hero ще компактніший */
.hero-products--ultra-compact {
    padding: 8px 0 !important;  /* Було 12px */
}

/* ============================================================================
   АДАПТИВНІСТЬ
   ============================================================================ */

@media (max-width: 1200px) {
    .vist-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    .vist-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
        gap: 12px !important;
    }
    
    .vist-card-image {
        height: 160px !important;
    }
    
    .vist-card-image img {
        max-height: 140px !important;
    }
    
    .vist-card-title {
        font-size: 0.95rem !important;
    }
}

@media (max-width: 480px) {
    .vist-products-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .vist-product-card {
        padding: 12px !important;
    }
    
    .vist-card-image {
        height: 200px !important;
    }
    
    .vist-card-title {
        font-size: 1rem !important;
        min-height: 42px !important;
    }
}

/* ============================================================================
   ФІКСОВАНА ВИСОТА КАРТКИ (щоб вмістити на екран)
   ============================================================================ */

/* Для desktop - фіксована висота */
@media (min-width: 769px) {
    .vist-product-card {
        height: 480px !important;  /* Фіксована висота */
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Зображення займає фіксовану висоту */
    .vist-card-image {
        flex-shrink: 0 !important;
    }
    
    /* Контент росте */
    .vist-card-content {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Характеристики займають що залишилось */
    .vist-card-specs {
        flex: 1 !important;
        overflow: hidden !important;
    }
    
    /* Мета і кнопка внизу */
    .vist-card-meta {
        margin-top: auto !important;
    }
}

/* ============================================================================
   ВИДАЛЕННЯ НЕПОТРІБНИХ ЕЛЕМЕНТІВ
   ============================================================================ */

/* Приховуємо products-count ПОВНІСТЮ */
.products-count {
    display: none !important;
}

/* ============================================================================
   ПІДСУМОК: Заощаджено простору
   ============================================================================ */

/*
БУЛО (одна картка):
- Padding: 20px
- Image: 240px
- Gaps: ~40px
- Content: ~150px
ВИСОТА КАРТКИ: ~450px + відступи = ~480px

СТАЛО (одна картка):
- Padding: 12px
- Image: 180px
- Gaps: ~20px
- Content: ~120px
ВИСОТА КАРТКИ: ~332px + відступи = ~360px

ЗАОЩАДЖЕНО НА КАРТЦІ: ~120px (25%)

На екрані 1920x1080:
БУЛО: ~2 картки по висоті
СТАЛО: ~3 картки по висоті ✅
*/