/* ==============================================
   БАЗА ТА КОРПОРАТИВНІ КОЛЬОРИ
============================================== */
:root {
    --primary-color: #0377c0;
    --primary-light: #eef6fc;
    --text-dark: #222222;
    --text-muted: #666666;
    --bg-gray: #f8f9fa;
    --border-color: #eaeaea;
}

.catalog-page { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background-color: #ffffff; color: var(--text-dark); padding: 40px 0; -webkit-font-smoothing: antialiased; }

.top-nav-wrapper { width: 100%; margin-bottom: 50px; }
.top-nav-menu { 
    display: grid; 
    grid-template-columns: repeat(6, 1fr); 
    gap: 10px; 
    width: 100%; 
    padding: 0; 
    background: transparent; 
    border: none; 
}
.top-nav-link { 
    width: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    padding: 12px 10px; 
    border-radius: 40px; 
    font-size: 14px; 
    font-weight: 600; 
    color: var(--text-muted); 
    background: var(--bg-gray); 
    border: 1px solid var(--border-color); 
    text-decoration: none; 
    transition: all 0.3s ease; 
    white-space: normal; 
    line-height: 1.2; 
    box-sizing: border-box; 
}
.top-nav-link.active { background: var(--primary-color); color: #ffffff; border-color: var(--primary-color); box-shadow: 0 4px 15px rgba(3, 119, 192, 0.3); }
.top-nav-link:not(.active):hover { background: #e2e6ea; color: var(--text-dark); }

/* НАДЗАГОЛОВОК */
.parent-category-title { font-size: 38px; font-weight: 800; text-transform: uppercase; text-align: center; margin: 0 0 40px 0; letter-spacing: 1px; }

.custom-tabs-wrapper { width: 100%; background-color: #fff; }
.custom-tabs-nav-container { position: relative; border-bottom: 2px solid var(--border-color); margin-bottom: 40px; }
.custom-tabs__items { display: flex; gap: 35px; width: max-content; max-width: 100%; margin: 0 auto -2px auto; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding: 0 20px; list-style: none; -webkit-overflow-scrolling: touch; }
.custom-tabs__items::-webkit-scrollbar { display: none; } 
.custom-tabs__item { font-size: 16px; padding: 16px 0; color: var(--text-muted); font-weight: 600; cursor: pointer; transition: all 0.3s ease; border-bottom: 3px solid transparent; white-space: nowrap; letter-spacing: 0.5px; }
.custom-tabs__item:hover { color: var(--primary-color); }
.custom-tabs__item.active { color: var(--primary-color) !important; border-bottom: 3px solid var(--primary-color) !important; }

.scroll-hint { position: absolute; top: 0; bottom: 2px; width: 40px; pointer-events: none; transition: opacity 0.3s ease; display: flex; align-items: center; color: var(--primary-color); font-size: 24px; opacity: 0; z-index: 2; }
.scroll-hint-right { right: 0; background: linear-gradient(to right, rgba(255,255,255,0) 0%, #fff 80%); justify-content: flex-end; padding-right: 5px; }
.scroll-hint-left { left: 0; background: linear-gradient(to left, rgba(255,255,255,0) 0%, #fff 80%); justify-content: flex-start; padding-left: 5px; }
.scroll-hint-right::after { content: '\203A'; animation: hintBounceRight 1.5s infinite; }
.scroll-hint-left::before { content: '\2039'; animation: hintBounceLeft 1.5s infinite; }
@keyframes hintBounceRight { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@keyframes hintBounceLeft { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-4px); } }
.custom-tabs-nav-container.can-scroll-right .scroll-hint-right { opacity: 1; }
.custom-tabs-nav-container.can-scroll-left .scroll-hint-left { opacity: 1; }

.custom-tabs__block { display: none; }
.custom-tabs__block.active { display: block; animation: fadeIn 0.5s ease forwards; }
@keyframes fadeIn { 0% { opacity: 0; transform: translateY(15px); } 100% { opacity: 1; transform: translateY(0); } }

.model-presentation { width: 100%; }

.model-title { font-size: 32px; font-weight: 600; color: var(--primary-color); margin: 0 0 30px 0; text-align: center; }
.section-subtitle { font-size: 26px; font-weight: 700; color: var(--primary-color); margin: 0 0 25px 0; text-align: center; }

.model-hero-image { width: 100%; margin: 0 0 30px 0; display: block; cursor: zoom-in; }
.model-hero-image img { width: 100%; height: auto; max-height: 500px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-color); box-shadow: 0 5px 20px rgba(0,0,0,0.03); }

.model-desc { font-size: 16px; line-height: 1.7; color: var(--text-dark); text-align: left; margin-bottom: 40px; }

.drawings-section { margin-bottom: 50px; width: 100%; }
.drawings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.drawing-card { background: #fff; border: 1px solid var(--border-color); border-radius: 8px; padding: 15px; text-align: center; transition: transform 0.3s ease; }
.drawing-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.drawing-card img { width: 100%; height: 120px; object-fit: contain; margin-bottom: 15px; cursor: zoom-in; }
.drawing-card span { display: block; font-size: 14px; font-weight: 600; color: var(--text-dark); }

.price-section-wrapper { width: 100%; margin-bottom: 40px; }
.table-responsive { width: 100%; background: #ffffff; border: 1px solid var(--border-color); border-radius: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.price-table { width: 100%; border-collapse: collapse; text-align: left; min-width: 400px; margin: 0; }
.price-table th { background: var(--primary-light); color: var(--text-dark); font-size: 12px; text-transform: uppercase; font-weight: 600; padding: 10px 20px; letter-spacing: 0.5px; }
.price-table td { padding: 10px 20px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.price-table tr:nth-child(even) td { background: var(--bg-gray); }
.price-table tr:hover td { background: var(--primary-light); }
.pt-name-wrap { display: flex; flex-direction: column; gap: 2px; }
.pt-name { font-size: 15px; font-weight: 700; color: var(--text-dark); }
.pt-sku { font-size: 13px; color: var(--text-muted); }
.pt-price { text-align: right; font-size: 17px; font-weight: 800; color: var(--primary-color); white-space: nowrap; }
.pt-unit { font-size: 13px; font-weight: 400; color: var(--text-muted); }

.calculator-global-section { margin-bottom: 50px; }
.calc-global-title { font-size: 32px; color: var(--primary-color); margin-bottom: 30px; }
.calc-iframe-wrapper { width: 100%; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.calc-iframe { width: 100%; display: block; border: none; }

.model-chars-box { background: var(--bg-gray); border-left: 4px solid var(--primary-color); border-radius: 0 8px 8px 0; padding: 20px 25px; margin-bottom: 50px; }
.model-chars-box h4 { font-size: 18px; color: var(--primary-color); margin: 0 0 10px 0; font-weight: 700; }
.model-chars-content { font-size: 15px; color: var(--text-dark); line-height: 1.6; }

.gallery-section-wrapper { width: 100%; margin-bottom: 30px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.gallery-item { aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--bg-gray); display: block; border: 1px solid var(--border-color); cursor: zoom-in; position: relative; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item::after { content: ''; position: absolute; inset: 0; background: rgba(3, 119, 192, 0.1); opacity: 0; transition: opacity 0.3s ease; }
.gallery-item:hover::after { opacity: 1; }

/* ==============================================
   КОЛЬОРОВА РОЗКЛАДКА (ПАЛІТРА КИЛИМІВ)
============================================== */
.model-colors-section { margin-bottom: 50px; width: 100%; background: #ffffff; padding: 30px; border-radius: 12px; border: 1px solid var(--border-color); }
.colors-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: flex-start; }
.color-item { display: flex; flex-direction: column; align-items: center; width: 110px; text-align: center; }
.color-swatch { width: 90px; height: 90px; border-radius: 50%; overflow: hidden; border: 3px solid var(--bg-gray); box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: transform 0.3s ease, border-color 0.3s ease; cursor: zoom-in; position: relative; }
.color-swatch img { width: 100%; height: 100%; object-fit: cover; }
.color-item:hover .color-swatch { transform: translateY(-5px) scale(1.05); border-color: var(--primary-color); }
.color-name { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--text-dark); line-height: 1.3; }

@media (max-width: 992px) { 
    .top-nav-menu { grid-template-columns: repeat(3, 1fr); } 
}

@media (max-width: 768px) {
    .catalog-page { padding: 20px 0; }
    .parent-category-title { font-size: 28px; margin-bottom: 30px; }
    .top-nav-link { border-radius: 12px; padding: 10px 5px; font-size: 13px; } 
    .custom-tabs__item { font-size: 14px; padding: 12px 0; }
    .model-title { font-size: 24px; margin-bottom: 20px; }
    .section-subtitle { font-size: 22px; }
    .model-desc { font-size: 15px; }
    .drawings-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .calc-global-title { font-size: 26px; }
    
    .model-colors-section { padding: 20px; }
    .colors-grid { gap: 15px; justify-content: center; }
    .color-item { width: 90px; }
    .color-swatch { width: 75px; height: 75px; }
    .color-name { font-size: 12px; }
}

@media (max-width: 576px) { 
    .top-nav-menu { grid-template-columns: 1fr; } 
}