/* Общие стили */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1;
    color: #333;
    background-color: #f8f9fa;    
    padding: 20px;
}

.container {
    max-width: none;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex: 1;
}

nav {
    background: #2c3e50;
    padding: 0.5rem; 
    border-radius: 8px;
    position: sticky;
    top: 20px; /* Прилипает когда доходит до верха экрана */
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    margin-right: 20px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: #34495e;
}

nav a.active {
    background-color: #3498db;
}

/* Заголовки */
h1 {
    color: #2c3e50;
    margin-bottom: none;
    text-align: center;
    font-size: 1,2rem;
     line-height: 1,2;
}

h2 {
    color: #34495e;
    margin: 25px 0 15px 0;
    font-size: 1.2rem;
}

/* Текст */
p {
    margin-bottom: 15px;
    line-height: 1;
    color: #282828;
    font-size: 1.2rem;
}

/* Фотогалерея */
.galleries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.gallery-card {
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    background: white;
}

.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.gallery-preview {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #ecf0f1;
}

.gallery-name {
    padding: 5px;
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
    color: #2c3e50;
    background: #ffffff;
}

/* Фото в галерее - ИСПРАВЛЕННЫЙ РАЗДЕЛ */
.photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 25px 0;
    justify-items: center;
    align-items: start;
}

.photo-item {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    background: white;
    padding: 10px;
    max-width: 100%;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    height: fit-content;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* ОСНОВНЫЕ ИСПРАВЛЕНИЯ ДЛЯ РАЗМЕРОВ ФОТО */
.photo-item img {
    max-width: 100%;
    max-height: 400px; /* Ограничение максимальной высоты */
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
    transition: transform 0.3s ease;
    object-fit: contain;
}

.photo-item:hover img {
    transform: scale(1.02);
}

/* Стили для разных ориентаций с ограничениями */
.photo-landscape {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
}

.photo-portrait {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
}

.photo-square {
    max-width: 300px;
    max-height: 300px;
    width: 100%;
    height: auto;
}

/* Контейнер для изображения */
.photo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: fit-content;
}

/* Адаптивные стили */
@media (max-width: 768px) {
    .photos {
        /* МАССОНОВСКАЯ РАСКЛАДКА ДЛЯ ПЛАНШЕТОВ */
        column-count: 2;
        column-gap: 15px;
        display: block; /* Отключаем grid */
    }
    
    .photo-item {
        break-inside: avoid; /* Важно: предотвращает разрыв фото между колонками */
        margin-bottom: 15px;
        display: block; /* Меняем flex на block */
    }
    
    .photo-item img {
        max-height: none; /* Убираем ограничения для естественного размера */
        width: 100%;
        height: auto;
    }
    
    /* Автоматические пропорции для разных ориентаций */
    .photo-landscape {
        max-height: none;
        aspect-ratio: 16/9;
    }
    
    .photo-portrait {
        max-height: none;
        aspect-ratio: 3/4;
    }
    
    .photo-square {
        max-width: 100%;
        max-height: none;
        aspect-ratio: 1;
    }
}

@media (max-width: 480px) {
    .photos {
        /* МАССОНОВСКАЯ РАСКЛАДКА ДЛЯ ТЕЛЕФОНОВ */
        column-count: 2;
        column-gap: 12px;
        margin: 15px 0;
    }
    
    .photo-item {
        padding: 6px;
        margin-bottom: 12px;
        border-radius: 8px;
    }
    
    .photo-item img {
        border-radius: 6px;
    }
    
    /* Убираем трансформации при наведении на мобильных */
    .photo-item:hover {
        transform: none;
        box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    }
    
    .photo-item:hover img {
        transform: none;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 360px) {
    .photos {
        column-count: 2;
        column-gap: 8px;
    }
    
    .photo-item {
        margin-bottom: 8px;
        padding: 4px;
    }
}

/* СТИЛИ ДЛЯ ПОЛНОЭКРАННОГО ПРОСМОТРА */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
}

.fullscreen-overlay.active {
    display: flex;
}

.fullscreen-image {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    cursor: default;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s ease;
    z-index: 1001;
}

.fullscreen-close:hover {
    background: rgba(255,255,255,0.3);
}

.fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s ease;
    z-index: 1001;
}

.fullscreen-prev {
    left: 20px;
}

.fullscreen-next {
    right: 20px;
}

.fullscreen-nav:hover {
    background: rgba(255,255,255,0.3);
}

.fullscreen-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 1rem;
    background: rgba(0,0,0,0.5);
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 1001;
}

/* Добавляем курсор-указатель для фото */
.photo-item {
    cursor: pointer;
}

/* Адаптация полноэкранного режима для мобильных */
@media (max-width: 768px) {
    .fullscreen-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .fullscreen-nav {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    .fullscreen-prev {
        left: 10px;
    }
    
    .fullscreen-next {
        right: 10px;
    }
    
    .fullscreen-counter {
        top: 10px;
        left: 10px;
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}

/* Видео */
.videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.video-card {
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 20px;
    background: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

video {
    width: 100%;
    border-radius: 8px;
    background: #000;
}

.video-name {
    margin-top: 15px;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
}

/* Сообщения об отсутствии контента */
.no-galleries,
.no-videos,
.no-photos {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 30px 0;
}

.no-galleries code,
.no-videos code {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
}

/* Ссылки */
.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 25px;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.back-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Форма обратной связи */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Группы чекбоксов и радиокнопок */
.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
}

.checkbox-item input,
.radio-item input {
    width: auto;
    margin-right: 10px;
}

/* Кнопки */
.btn {
    background: #3498db;
    color: white;
    padding: 14px 35px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Результаты формы */
.results-list {
    list-style: none;
    margin: 25px 0;
}

.result-item {
    padding: 18px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    align-items: center;
    transition: background-color 0.3s;
}

.result-item:hover {
    background-color: #f8f9fa;
}

.field-name {
    font-weight: bold;
    width: 200px;
    color: #2c3e50;
    flex-shrink: 0;
}

.field-value {
    flex: 1;
    color: #555;
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    nav {
        text-align: center;
    }
    
    nav a {
        display: inline-block;
        margin: 5px;
        padding: 10px 15px;
    }
    
    .galleries,
    .photos,
    .videos {
        grid-template-columns: 1fr;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .field-name {
        width: 100%;
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    .gallery-preview {
        height: 180px;
    }
    
    .photo-item img {
        height: 220px;
    }
    
    .video-card {
        padding: 15px;
    }
}

/*Стили таблицы*/

.table-container {
    overflow-x: auto;
    margin: 30px 0;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.price-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 16px;
    /* min-width: 600px; */
}

.price-table th {
    background: #2c3e50;
    color: white;
    padding: 15px 12px;
    text-align: center;
    font-weight: bold;
    border: none;
}

.price-table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
    vertical-align: top;
    text-align: center
}

.price-table tr:nth-child(even) {
    background: #f8f9fa;
}

.price-table tr:hover {
    background: #e8f4f8;
    transition: background 0.3s;
}

.price-table th:first-child {
    border-radius: 8px 0 0 0;
}

.price-table th:last-child {
    border-radius: 0 8px 0 0;
}

.no-data, .error {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
    color: #7f8c8d;
}

.file-info {
    background: #e8f4f8;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 14px;
}

/* таблица для очень маленьких экранов */
@media (max-width: 480px) {
    .price-table {
        font-size: 18px;
    }
    
    .price-table th,
    .price-table td {
        padding: 8px 6px;
    }
}

/* Стили для категорий образцов */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.category-card {
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    background: white;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.category-preview {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #000;
}

.category-preview.no-preview {
    background: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #7f8c8d;
}

.category-name {
    padding: 20px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
    background: #f8f9fa;
}

.no-categories {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 30px 0;
    grid-column: 1 / -1;
}

/* Стили для подвала с соцсетями */
.site-footer {
    background: #2c3e50;
    color: #ffffff !important;
    padding: 30px 20px;
    margin-top: 40px;
    width: 100%;
    border-radius: 10px 10px 0 0;
}

span p {
    color: #ffffff !important;
}

.footer-content {
    max-width: none;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-main {
    flex: 1;
    text-align: left;
}

.footer-main p {
    margin: 8px 0;
    color: #ffffff !important;
    line-height: 1.5;
    font-weight: 500;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
}

.social-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    color: #c7c6c6 !important;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #ffffff !important;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.social-link.vk:hover {
    background: #244e7d;
}

.social-link.telegram:hover {
    background: #297093;
}

.social-icon {
    font-size: 18px;
}

/* Стили для кликабельных контактов */
.contact-link {
    color: #bdc3c7 !important;
    text-decoration: none;
    transition: color 0.3s ease;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
}

.contact-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid #3498db;
}


/* Адаптивность для подвала */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 25px;
    }
    
    .footer-main {
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .social-link {
        padding: 8px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .social-links {
        flex-direction: column;
        width: 100%;
    }
    
    .social-link {
        justify-content: center;
    }
    
    .site-footer {
        padding: 25px 15px;
    }
}