/**
 * style.css - Полные стили для страницы колодца
 * Кабельный коллектор / Канализационный колодец
 */

/* ==================== ПЕРЕМЕННЫЕ ==================== */
:root {
    --brand: #242c59;
    --brand-rgb: 36, 44, 89;
    --brand-light: #3a4580;
    --brand-lighter: #5a66a3;
    --brand-soft: #f0f2fa;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 1rem;
    --radius-lg: 1.5rem;
}

/* ==================== БАЗОВЫЕ СТИЛИ ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* ==================== КОНТЕЙНЕР ==================== */
.page-well {
    max-width: 100%;
    overflow-x: hidden;
}

.container-well {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ==================== ЗАГОЛОВКИ ==================== */
.well-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--brand);
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    position: relative;
}

.well-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--brand);
    border-radius: 4px;
}

h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--brand);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--brand);
    border-radius: 3px;
}

/* ==================== КАРТОЧКА ТОВАРА ==================== */
.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 2.5rem;
}

/* Галерея */
.product-gallery {
    position: relative;
    min-width: 0;
}

/* Главный слайдер */
.main-swiper {
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    /* background: var(--brand-soft); */
    margin-bottom: 1rem;
    position: relative;
}

.main-swiper .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    cursor: pointer;
}

.main-slide-img {
    width: 100%;
    max-height: 450px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.main-slide-img:hover {
    transform: scale(1.02);
}

/* Навигация главного слайдера */
.gallery-prev,
.gallery-next {
    background: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

.gallery-prev::after,
.gallery-next::after {
    font-size: 18px;
    font-weight: bold;
    color: var(--brand);
}

.gallery-prev:hover,
.gallery-next:hover {
    background: var(--brand);
}

.gallery-prev:hover::after,
.gallery-next:hover::after {
    color: white;
}

/* Слайдер миниатюр */
.thumbs-swiper {
    width: 100%;
    margin-top: 1rem;
    padding: 0 0.25rem;
}

.thumbs-swiper .swiper-slide {
    width: 80px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    border-radius: 0.5rem;
    overflow: hidden;
}

.thumbs-swiper .swiper-slide-thumb-active {
    opacity: 1;
}

.thumb-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    transition: border 0.2s ease;
}

.thumbs-swiper .swiper-slide-thumb-active .thumb-img {
    border-color: var(--brand);
}

/* Информация о товаре */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.specs-card {
    background: var(--brand-soft);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.specs-list {
    list-style: none;
}

.specs-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.specs-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.spec-label {
    font-weight: 600;
    color: var(--brand);
    min-width: 160px;
}

.tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--brand-lighter);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    cursor: help;
    margin-left: 0.25rem;
}

.description-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

.description-text p {
    margin-bottom: 1rem;
}

.description-text p:last-child {
    margin-bottom: 0;
}

/* ==================== ЯКОРНАЯ НАВИГАЦИЯ ==================== */
.anchor-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0 2.5rem;
    background: transparent;
    transition: all 0.3s ease;
}

.anchor-nav.anchor-nav--sticky {
    position: fixed;
    z-index: 99;
    background: white;
    box-shadow: var(--shadow-md);
    padding: 0.75rem 1rem;
    margin: 0;
    border-radius: 0.75rem;
}

.anchor-nav-placeholder {
    display: block;
    width: 100%;
}

.anchor-btn {
    background: white;
    border: 1px solid var(--border);
    padding: 0.75rem 1.75rem;
    border-radius: 3rem;
    font-weight: 500;
    color: var(--brand);
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.anchor-btn:hover {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.anchor-target {
    scroll-margin-top: 120px;
}

/* ==================== ПРЕИМУЩЕСТВА ==================== */
.features-block {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2.5rem;
    text-align: center;
}

.features-block h2 {
    display: inline-block;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
}

.feature-item {
    text-align: center;
    padding: 1rem;
    transition: transform 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 70px;
    height: 70px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.feature-item p {
    font-weight: 500;
    color: var(--text-primary);
}

/* ==================== КОНТЕНТ БЛОК ==================== */
.content-block {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2.5rem;
}

.content-block h2 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.content-block h2:first-child {
    margin-top: 0;
}

.content-block p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.content-block ul {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.content-block li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* ==================== СЛАЙДЕРЫ ==================== */
.slider-section {
    margin-bottom: 2.5rem;
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.slider-header h2 {
    margin-bottom: 0;
}

.slider-controls {
    display: flex;
    gap: 0.75rem;
}

.slider-btn {
    width: 44px;
    height: 44px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--brand);
    font-weight: bold;
}

.slider-btn:hover {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
    transform: scale(1.05);
}

/* Базовые стили Swiper */
.swiper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.swiper-wrapper {
    display: flex;
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition-property: transform;
    box-sizing: content-box;
}

.swiper-slide {
    flex-shrink: 0;
    width: 100%;
    height: auto;
    position: relative;
    transition-property: transform;
}

/* Карточки слайдов */
.slider-card {
    text-align: center;
    padding: 0.5rem;
}

.slider-img {
    width: 100%;
    /* aspect-ratio: 1 / 1; */
    object-fit: cover;
    /* border-radius: var(--radius); */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.slider-img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.slider-caption {
    margin-top: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
}

.portfolio-img {
    object-fit: cover;
}

/* Карточки колодцев */
.well-card {
    text-decoration: none;
    display: block;
    text-align: center;
    transition: transform 0.2s ease;
}

.well-card:hover {
    transform: translateY(-5px);
}

.well-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}

.well-card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--brand);
    margin: 0;
}

/* Карточки документов */
.doc-card {
    text-decoration: none;
    display: block;
    text-align: center;
    transition: transform 0.2s ease;
}

.doc-card:hover {
    transform: translateY(-5px);
}

.doc-img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.doc-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--brand);
}

/* ==================== ФОРМА ==================== */
.form-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-top: 1rem;
}

/* ==================== МОДАЛЬНОЕ ОКНО С ГАЛЕРЕЕЙ ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
}

.modal-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 85%;
    max-height: 70vh;
    object-fit: contain;
    transition: transform 0.2s ease;
    cursor: zoom-in;
}

/* Навигационные кнопки */
.modal-nav-prev,
.modal-nav-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-nav-prev {
    left: 20px;
}

.modal-nav-next {
    right: 20px;
}

.modal-nav-prev:hover,
.modal-nav-next:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

/* Миниатюры в модальном окне */
.modal-thumbnails {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    z-index: 1002;
    max-width: 90%;
    overflow-x: auto;
    scrollbar-width: thin;
}

.modal-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.modal-thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.modal-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.modal-thumb-item {
    width: 60px;
    height: 60px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.modal-thumb-item:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.modal-thumb-item.active {
    opacity: 1;
    border: 2px solid white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.modal-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1003;
}

.modal-close:hover {
    color: #ccc;
    transform: rotate(90deg);
}

.modal-controls {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.5rem 1rem;
    border-radius: 3rem;
    backdrop-filter: blur(10px);
    z-index: 1003;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* ==================== АДАПТАЦИЯ ==================== */
@media (max-width: 992px) {
    .product-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .container-well {
        padding: 1.5rem;
    }
    
    .well-title {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .main-swiper .swiper-slide {
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .well-title {
        font-size: 1.75rem;
    }
    
    .specs-list li {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .spec-label {
        min-width: auto;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .slider-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .slider-controls {
        align-self: flex-end;
    }
    
    .slider-section {
        padding: 1.5rem;
    }
    
    .anchor-nav {
        gap: 0.75rem;
    }
    
    .anchor-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .main-swiper .swiper-slide {
        min-height: 300px;
    }
    
    .thumbs-swiper .swiper-slide {
        width: 60px;
    }
    
    .gallery-prev,
    .gallery-next,
    .slider-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 60vh;
    }
    
    .modal-nav-prev,
    .modal-nav-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .modal-nav-prev {
        left: 10px;
    }
    
    .modal-nav-next {
        right: 10px;
    }
    
    .modal-thumb-item {
        width: 45px;
        height: 45px;
    }
    
    .modal-controls {
        top: 10px;
        padding: 0.25rem 0.75rem;
    }
    
    .zoom-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .modal-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
}

@media (max-width: 576px) {
    .container-well {
        padding: 1rem;
    }
    
    .product-layout {
        padding: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .features-block,
    .content-block,
    .slider-section,
    .form-wrapper {
        padding: 1rem;
    }
    
    .main-swiper .swiper-slide {
        min-height: 250px;
    }
    
    .main-slide-img {
        max-height: 250px;
    }
}

/* ==================== АНИМАЦИИ ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-layout,
.features-block,
.slider-section,
.content-block {
    animation: fadeIn 0.5s ease-out;
}

/* ==================== УТИЛИТЫ ==================== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }