﻿/* Cabins Main template styles (cabinsMain.php) */
/* Герой секция */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), 
                url('https://images.unsplash.com/photo-1545324418-cc1a3fa10c00?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 60px 0;
    margin-bottom: 40px;
}

.hero-section--page-image {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-height: clamp(360px, 52vw, 560px);
    padding: clamp(64px, 8vw, 112px) 0;
    background: #10181c;
}

.hero-section--page-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(9, 18, 23, 0.88) 0%, rgba(9, 18, 23, 0.62) 42%, rgba(9, 18, 23, 0.82) 100%);
    z-index: 1;
}

.hero-section--page-image > .container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-section--page-image .hero-content {
    max-width: min(820px, 100%);
    position: relative;
}

.cabins-hero-background {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.cabins-hero-background__image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
    transform: scale(1.02);
}

.hero-content {
    max-width: 800px;
}


.hero-title {
    font-size: 42px;
    margin-bottom: 20px;
    line-height: 1.2;
    color:#fff;
}

.seo-intro {
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.6;
    text-align: left;
}

/* Основная структура с фильтром */
.main-content-wrapper {
    display: flex;
    gap: 30px;
    position: relative;
}

/* Фильтр с закреплением и скроллом */
.filter-sidebar {
    flex: 0 0 25%;
    position: relative;
}

.filter-container {
    position: sticky;
    top: 100px;
    transition: all 0.3s ease;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 10px;
}

/* Стили для скроллбара в фильтре */
.filter-container::-webkit-scrollbar {
    width: 6px;
}

.filter-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filter-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.filter-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.filter-group {
    background: var(--light-gray);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 12px;
}

.filter-title {
    font-size: 16px;
    color: var(--primary);
    font-weight: 600;
}

.filter-toggle {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-toggle:hover {
    color: var(--primary);
}

.filter-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-content.collapsed {
    max-height: 0;
}

.filter-content.expanded {
    max-height: 500px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.size-list {
    list-style: none;
    margin-bottom: 12px;
}

.size-item {
    padding: 6px 0;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    font-size: 14px;
}

.size-item:hover {
    color: var(--primary);
}

.size-item.is-active {
    color: var(--primary);
    font-weight: 600;
}

.custom-size-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: inline-block;
    margin-top: 8px;
}

.custom-size-link:hover {
    text-decoration: underline;
}

/* Range slider */
.price-range {
    width: 100%;
    margin: 15px 0;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    outline: none;
}

.range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    color: var(--gray);
    font-size: 14px;
}

/* Навигационные кнопки над превью - компактнее */
.category-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: nowrap;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 5px;
}

.category-nav::-webkit-scrollbar {
    height: 4px;
}

.category-nav::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.category-nav::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

.nav-btn {
    padding: 10px 18px;
    background: transparent;
    border: 2px solid var(--primary);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    color: var(--primary);
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    font-size: 14px;
    flex-shrink: 0;
}

.nav-btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

/* Сетка превью товаров - компактнее с кнопкой */
.products-section {
    flex: 1;
    position: relative;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 60px;
    min-height: 1200px;
}

.products-empty {
    grid-column: 1 / -1;
    background: var(--light-gray);
    border: 1px dashed #ddd;
    border-radius: var(--border-radius);
    padding: 18px;
    color: var(--gray);
}

.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 360px; /* Увеличил чтобы помещалась кнопка */
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 160px;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.image-label {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
}

.product-content {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.product-title {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--dark);
    line-height: 1.3;
    font-weight: 600;
}

.product-description {
    color: var(--gray);
    font-size: 13px;
    margin-bottom: 12px;
    flex-grow: 1;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    max-height: calc(1.4em * 4);
}

.product-price {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.product-actions {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

/* Опросник */
.quiz-section {
    background: var(--white);
    padding: 60px 0;
    border-radius: var(--border-radius);
}

.quiz-form {
    max-width: 800px;
    margin: 0 auto;
    background: var(--light-gray);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.quiz-title {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary);
    font-size: 28px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 14px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(42, 109, 57, 0.1);
}

/* Преимущества */
.advantages-section {
    padding: 80px 0;
    background: var(--white);
}

.section-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
    color: var(--primary);
    position: relative;
    padding-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.advantage-card {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: var(--transition);
    border: 2px solid transparent;
}

.advantage-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 15px 35px rgba(42, 109, 57, 0.15);
}

.advantage-icon {
    font-size: 50px;
    color: var(--accent);
    margin-bottom: 25px;
    display: block;
}

.advantage-title {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--dark);
}

/* SEO текст в две колонки */
.seo-section {
    padding: 80px 0;
    background: var(--light-gray);
}

.seo-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    line-height: 1.8;
    font-size: 17px;
}

/* Как заказать */
.order-process {
    padding: 80px 0;
    background: var(--white);
}

.timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-top: 60px;
    padding: 0 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 40px;
    left: 5%;
    right: 5%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    z-index: 1;
}

.timeline-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 0 10px;
}

.step-icon {
    width: 80px;
    height: 80px;
    background: var(--white);
    border: 3px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 30px;
    color: var(--primary);
    font-weight: bold;
    position: relative;
    transition: var(--transition);
}

.timeline-step:hover .step-icon {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* Три формы */
.triple-forms {
    padding: 80px 0;
    background: linear-gradient(135deg, #1f512b 0%, #2a6d39 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.triple-forms::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" fill="white" opacity="0.05"/></svg>');
}

.forms-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    position: relative;
    z-index: 1;
}

.form-block {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
    color: var(--dark);
}

.form-block:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.form-title {
    font-size: 24px;
    margin-bottom: 25px;
    color: var(--primary);
    position: relative;
    padding-bottom: 15px;
}

.form-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent);
}

.form-block p {
    margin-bottom: 25px;
    color: var(--gray);
    line-height: 1.6;
}

.form-block form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-actions {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #f0f0f0;
}

.form-block .btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
}

.calculation-block {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.calculation-block .form-title {
    color: white;
}

.calculation-block .form-title::after {
    background: var(--accent);
}

.calculation-block p {
    color: rgba(255,255,255,0.9);
}

/* Галерея */
.gallery-section {
    padding: 80px 0;
    background: var(--light-gray);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.gallery-item {
    display: block;
    height: 220px;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    text-decoration: none;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.gallery-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 15px;
    font-size: 14px;
    transform: translateY(100%);
    transition: var(--transition);
}

.gallery-item:hover .gallery-label {
    transform: translateY(0);
}

.gallery-empty {
    margin-top: 40px;
    padding: 18px 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    text-align: center;
    color: var(--gray);
    border: 1px solid #e0e0e0;
}

/* Финальный SEO текст */
.final-seo {
    padding: 80px 0;
    background: var(--white);
}

.final-seo-content {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
    font-size: 17px;
}

.final-seo-content h2 {
    color: var(--primary);
    margin-bottom: 30px;
    text-align: center;
}

.final-seo-content p {
    margin-bottom: 25px;
    text-align: justify;
}

/* Модальные окна */
.cabins-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(9, 18, 14, 0.68);
    z-index: 1200;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
    backdrop-filter: blur(4px);
}

.cabins-modal.active {
    display: flex;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cabins-modal-content {
    background: var(--white);
    border: 1px solid rgba(42, 109, 57, 0.14);
    border-radius: 14px;
    box-shadow: 0 28px 70px rgba(0,0,0,0.32);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    max-width: 620px;
    overflow: hidden;
    position: relative;
    width: min(100%, 620px);
    animation: modalSlideIn 0.28s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(18px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.cabins-modal-header {
    display: flex;
    flex: 0 0 auto;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 0;
    padding: 22px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
}

.cabins-modal-title {
    color: inherit;
    font-size: clamp(20px, 3vw, 26px);
    line-height: 1.2;
    margin: 0;
}

.cabins-close-modal {
    flex: 0 0 auto;
    background: rgba(255,255,255,0.14);
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: var(--white);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.cabins-close-modal:hover {
    background: rgba(255,255,255,0.24);
    color: var(--white);
}

.cabins-close-modal:focus-visible {
    outline: 3px solid rgba(255,255,255,0.55);
    outline-offset: 2px;
}

#customSizeForm {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    padding: 28px;
}

#customSizeForm .form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 18px;
}

#customSizeForm .form-group {
    margin: 0 0 18px;
}

#customSizeForm .form-row .form-group {
    margin: 0;
}

#customSizeForm label {
    color: #2b3830;
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}

#customSizeForm .form-control {
    background: var(--white);
    border: 1px solid #d8e0da;
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(0,0,0,0.02);
    color: var(--dark);
    font-size: 15px;
    line-height: 1.3;
    min-height: 48px;
    padding: 12px 14px;
    width: 100%;
}

#customSizeForm .form-control:hover {
    border-color: #bac8bf;
}

#customSizeForm .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42, 109, 57, 0.14);
    outline: none;
}

#customSizeForm .form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

#customSizeForm .btn-primary {
    align-items: center;
    background: var(--accent);
    border: 0;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(230, 126, 34, 0.22);
    color: var(--white);
    display: inline-flex;
    font-size: 16px;
    font-weight: 700;
    justify-content: center;
    line-height: 1.2;
    min-height: 50px;
    padding: 14px 24px;
    white-space: normal;
    width: 100%;
}

#customSizeForm .btn-primary:hover,
#customSizeForm .btn-primary:focus-visible {
    background: var(--accent-hover);
    box-shadow: 0 12px 24px rgba(211, 84, 0, 0.24);
    color: var(--white);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .cabins-modal {
        align-items: flex-start;
        padding: 12px;
    }

    .cabins-modal-content {
        border-radius: 12px;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }

    .cabins-modal-header {
        padding: 18px;
    }

    #customSizeForm {
        padding: 20px 18px;
    }

    #customSizeForm .form-row {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 14px;
    }

    #customSizeForm .form-group {
        margin-bottom: 14px;
    }

    #customSizeForm .form-control {
        font-size: 16px;
    }
}

/* Адаптивность */
@media (max-width: 1200px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .hero-section--page-image {
        min-height: clamp(320px, 72vw, 460px);
        padding: 56px 0;
    }

    .hero-section--page-image::before {
        background: linear-gradient(180deg, rgba(9, 18, 23, 0.84) 0%, rgba(9, 18, 23, 0.58) 38%, rgba(9, 18, 23, 0.84) 100%);
    }

    .main-content-wrapper {
        flex-direction: column;
    }
    
    .filter-sidebar {
        width: 100%;
        flex: none;
    }
    
    .filter-container {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
    
    .forms-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .timeline {
        flex-direction: column;
        gap: 40px;
    }
    
    .timeline::before {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-section--page-image {
        min-height: 300px;
        padding: 48px 0;
    }

    .hero-section--page-image .hero-content {
        max-width: 100%;
    }

    .hero-section--page-image .seo-intro {
        font-size: 16px;
        margin-bottom: 24px;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }
    
    .seo-two-column {
        grid-template-columns: 1fr;
    }
    
    .category-nav {
        justify-content: flex-start;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 450px) {
    .advantages-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}
