/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: 'Montserrat', sans-serif;
    color: #333;
    background-color: #f5f5f5;
    line-height: 1.6;
}
a {
    color: inherit;
    text-decoration: none;
}
img {
    max-width: 100%;
    height: auto;
}

/* Навигация */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: #4CAF50;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}
nav .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}
nav ul {
    display: flex;
    list-style: none;
}
nav ul li {
    margin-left: 30px;
}
nav ul li a {
    font-size: 1rem;
    color: #fff;
    transition: color 0.3s;
}
nav ul li a:hover {
    color: #f1f1f1;
}
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #fff;
}

/* Мобильное меню */
@media (max-width: 768px) {
    nav .container {
        padding: 5px 20px;
    }
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #4CAF50;
        position: absolute;
        top: 100%;
        left: 0;
        padding: 10px 0;
    }
    nav ul.showing {
        display: flex;
    }
    nav ul li {
        margin: 5px 0;
        text-align: center;
    }
    .menu-toggle {
        display: block;
    }
    nav .logo {
        font-size: 1.2rem;
    }
}

/* Шапка сайта */
header {
    background: url('images/shapka-sayta-s-novym-tekstom.jpg') no-repeat center/cover;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    position: relative;
    text-align: center;
    padding-top: 80px;
}
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}
.header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
    margin-bottom: 80px;
}
.header-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}
.header-content p {
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}
.header-content a.button {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 30px;
    background-color: #fff;
    color: #4CAF50;
    border-radius: 50px;
    font-size: 1.2rem;
    transition: background-color 0.3s, transform 0.3s;
    text-decoration: none;
}
.header-content a.button:hover {
    background-color: #f1f1f1;
    transform: translateY(-5px);
}
.header-content a {
    color: #4CAF50;
    text-decoration: underline;
    font-weight: bold;
}
.header-content a:hover {
    color: #45a049;
}

/* Анимация стрелки вниз */
.scroll-down {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: #fff;
    animation: bounce 2s infinite;
    z-index: 1;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translate(-50%, 0);}
    40% {transform: translate(-50%, -15px);}
    60% {transform: translate(-50%, -10px);}
}

/* Основной контент */
main {
    padding: 80px 0;
}
section {
    scroll-margin-top: 80px;
}

/* Заголовок раздела */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 60px;
    position: relative;
}
.section-title::after {
    content: '';
    width: 80px;
    height: 4px;
    background-color: #4CAF50;
    position: absolute;
    left: 50%;
    bottom: -15px;
    transform: translateX(-50%);
}

/* Продукты */
.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 350px));
    gap: 40px;
    padding: 0 20px;
    justify-content: center;
}
.product-card {
    background-color: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    will-change: transform;
    max-width: 350px;
    margin: 0 auto;
}
.product-card:hover {
    transform: translateY(-10px);
}
.product-card img {
    width: 100%;
    height: auto;
    transition: opacity 0.3s ease;
    transform-origin: center;
}
.product-card img.fade-out {
    opacity: 0;
}
.product-card img.fade-in {
    opacity: 1;
}
.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.product-info h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 10px;
}
.product-info h3 {
    font-size: 1rem;
    color: #777;
    margin-bottom: 15px;
}
.product-info ul {
    list-style: none;
    margin-bottom: 15px;
}
.product-info ul li {
    font-size: 1rem;
    color: #555;
    margin-bottom: 5px;
}
.product-info p {
    flex-grow: 1;
    font-size: 1rem;
    color: #555;
    margin-bottom: 20px;
}
.product-info a {
    text-align: center;
    background-color: #4CAF50;
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.3s;
    text-decoration: none;
}
.product-info a:hover {
    background-color: #45a049;
    transform: translateY(-5px);
}

/* Секция заказа */
.order-section {
    background-color: #4CAF50;
    color: #fff;
    padding: 60px 20px;
    text-align: center;
    margin: 80px 0;
    position: relative;
    overflow: hidden;
}
.order-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    transform: skewX(-15deg);
    animation: slide 5s infinite;
}
@keyframes slide {
    0% {left: -100%;}
    50% {left: 100%;}
    100% {left: 100%;}
}
.order-section h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}
.order-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}
.order-section a {
    display: inline-block;
    padding: 15px 30px;
    background-color: #fff;
    color: #4CAF50;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.3s;
    position: relative;
    z-index: 1;
    text-decoration: none;
}
.order-section a:hover {
    background-color: #f1f1f1;
    transform: translateY(-5px);
}

/* О галстуках Bertoldi */
.about-section {
    padding: 40px 20px;
    background-color: #fff;
    text-align: center;
}
.about-section h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 40px;
    position: relative;
}
.about-section h2::after {
    content: '';
    width: 80px;
    height: 4px;
    background-color: #4CAF50;
    position: absolute;
    left: 50%;
    bottom: -15px;
    transform: translateX(-50%);
}
.about-section p {
    font-size: 1.2rem;
    color: #555;
    max-width: 800px;
    margin: 0 auto 40px auto;
    line-height: 1.8;
    text-align: center;
}
.about-section h3 {
    font-size: 2rem;
    color: #333;
    margin-top: 60px;
    margin-bottom: 20px;
    position: relative;
}
.about-section h3::after {
    content: '';
    width: 60px;
    height: 3px;
    background-color: #4CAF50;
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
}

/* Стили для раздела "Внимание к деталям" */
.details-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
    padding: 40px;
    max-width: 1600px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-item img {
    width: 100%;
    height: 600px;
    object-fit: cover;
    display: block;
    border-radius: 30px;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: translateY(-10px);
}

.image-text {
    margin-top: 30px;
    color: #333;
    font-size: 1.3rem;
    text-align: center;
    font-weight: 500;
    line-height: 1.4;
}

/* Медиа-запросы для адаптивности */
@media (max-width: 1400px) {
    .details-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    .gallery-item img {
        height: 500px;
    }
}

@media (max-width: 992px) {
    .gallery-item img {
        height: 450px;
    }
    
    .image-text {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .details-gallery {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 20px;
    }

    .gallery-item img {
        height: 400px;
    }

    .image-text {
        font-size: 1.1rem;
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .gallery-item img {
        height: 350px;
        border-radius: 20px;
    }

    .image-text {
        font-size: 1rem;
        margin-top: 15px;
    }
}

/* Фотогалерея */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 60px 20px;
}
.gallery img {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}
.gallery img:hover {
    transform: scale(1.05);
}

/* Стили для раздела "Контакты" */

/* VK иконка — синий цвет */
.about-section p .vk-icon {
    color: #4680C2; /* Синий цвет VK */
    margin-right: 10px;
    font-size: 1.2rem;
    vertical-align: middle;
    transition: color 0.3s;
}

/* WhatsApp иконка — зеленый цвет */
.about-section p .wa-icon {
    color: #25D366; /* Зеленый цвет WhatsApp */
    margin-right: 10px;
    font-size: 1.2rem;
    vertical-align: middle;
    transition: color 0.3s;
}

/* Стили для ссылок */
.about-section p a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

/* Изменение цвета текста ссылки при наведении */
.about-section p a:hover {
    color: #4CAF50; /* Зеленый при наведении */
}


/* Футер */
footer {
    background-color: #333;
    color: #fff;
    padding: 40px 20px;
    text-align: center;
}

/* Мобильные стили */
@media (max-width: 992px) {
    .details-section {
        gap: 20px;
    }
    .detail-item {
        max-width: 45%;
        margin: 10px;
    }
}
@media (max-width: 768px) {
    /* Навигация */
    nav .container {
        padding: 5px 20px;
    }
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #4CAF50;
        position: absolute;
        top: 100%;
        left: 0;
        padding: 10px 0;
    }
    nav ul.showing {
        display: flex;
    }
    nav ul li {
        margin: 5px 0;
        text-align: center;
    }
    .menu-toggle {
        display: block;
    }
    nav .logo {
        font-size: 1.2rem;
    }

    /* Шапка сайта */
    header {
        height: auto;
        padding: 100px 0 50px 0;
    }
    .header-content h1 {
        font-size: 2rem;
    }
    .header-content p {
        font-size: 1rem;
    }
    .header-content a.button {
        padding: 12px 20px;
        font-size: 1rem;
    }

    /* Продукты */
    .products {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .product-card {
        flex-direction: column;
    }
    .product-info h2 {
        font-size: 1.3rem;
    }
    .product-info h3 {
        font-size: 1rem;
    }
    .product-info p {
        font-size: 0.9rem;
    }

    /* Секция заказа */
    .order-section {
        margin: 60px 0;
        padding: 40px 20px;
    }
    .order-section h2 {
        font-size: 2rem;
    }
    .order-section p {
        font-size: 1rem;
    }
    .order-section a {
        font-size: 1rem;
        padding: 12px 20px;
    }

    /* О галстуках Bertoldi */
    .about-section {
        padding: 60px 20px;
    }
    .about-section h2 {
        font-size: 2rem;
    }
    .about-section p {
        font-size: 1rem;
    }

    /* Раздел "Внимание к деталям" */
    .details-section {
        flex-direction: column;
        align-items: center;
    }
    .detail-item {
        max-width: 80%;
        margin: 10px 0;
    }
    
    /* Галерея */
    .gallery {
        grid-template-columns: 1fr;
        padding: 40px 20px;
    }

    /* Футер */
    footer {
        padding: 30px 20px;
    }
}

/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 480px) {
    /* Навигация */
    nav .container {
        padding: 5px 20px;
    }
    nav .logo {
        font-size: 1.2rem;
        flex-grow: 1;
    }
    .menu-toggle {
        display: flex;
        align-items: center;
    }
    .menu-toggle i {
        font-size: 1.5rem;
    }

    /* Шапка сайта */
    .header-content h1 {
        font-size: 1.8rem;
    }
    .header-content p {
        font-size: 0.9rem;
    }

    /* Кнопки */
    .header-content a.button,
    .order-section a {
        font-size: 0.9rem;
        padding: 10px 15px;
    }

    /* Текст */
    .product-info h2 {
        font-size: 1.2rem;
    }
    .product-info p {
        font-size: 0.8rem;
    }
    .order-section h2,
    .about-section h2 {
        font-size: 1.8rem;
    }
    .order-section p,
    .about-section p {
        font-size: 0.9rem;
    }
}

/* Добавьте поддержку container queries для лучшей производительности на мобильных устройствах */
@container (min-width: 768px) {
    .products {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Оптимизация анимаций */
@media (prefers-reduced-motion: no-preference) {
    .scroll-down {
        animation: bounce 2s infinite;
    }
}

/* Оптимизация для мобильных устройств */
@media (max-width: 768px) {
    .products {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-info a {
        padding: 22px 30px;
        min-height: 44px;
    }
    
    /* Стили для маленьких экранов */
    @media (max-width: 480px) {
        .header-content h1 {
            font-size: 1.8rem;
        }
        
        .product-info h2 {
            font-size: 1.2rem;
        }
        
        .product-info p,
        .order-section p,
        .about-section p {
            font-size: 0.9rem;
        }
    }
}

/* Оптимизация для маленьких экранов */
@media (max-width: 320px) {
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .product-info h2 {
        font-size: 1.1rem;
    }
    
    .product-info ul li {
        font-size: 0.9rem;
    }
    
    .product-card {
        margin: 0 10px;
    }
    
    .product-info {
        padding: 15px;
    }
}

/* Стили для кнопок заказа */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    background-color: #4CAF50;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.3s;
    min-height: 44px;
}

.button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.button i {
    font-size: 1.2em;
}

/* Контакты тоже должны быть центрированы */
.about-section address {
    text-align: center;
}

.about-section address p {
    margin-bottom: 10px;
}

/* Стили для селектора цветов */
.color-selector {
    text-align: center;
    margin-bottom: 40px;
}

.color-selector h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    justify-items: center;
    gap: 10px; 
    margin: 0 auto;
    max-width: 1200px;
    padding: 0 20px;
}

.color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s ease;
}

.color-option:hover {
    transform: translateY(-3px);
}

.color-preview {
    width: 240px;
    height: 240px;
    border-radius: 10px;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
    overflow: hidden;
}

.color-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.color-option.active .color-preview {
    border-color: #4CAF50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.2);
}

.color-name {
    font-size: 0.9rem;
    color: #333;
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 768px) {
    .color-options {
        gap: 30px;
    }
    
    .color-preview {
        width: 180px;
        height: 180px;
    }
}

/* Большие десктопные экраны */
@media (min-width: 1921px) {
    .color-preview {
        width: 250px; /* from 300 */
        height: 250px; /* from 300 */
    }
    .color-options {
        max-width: 2000px;
        gap: 40px;
    }
}

/* Стандартные десктопные экраны */
@media (max-width: 1920px) {
    .color-preview {
        width: 200px; /* from 240 */
        height: 200px; /* from 240 */
    }
    .color-options {
        max-width: 1600px;
        gap: 30px;
    }
}

/* Маленькие десктопные экраны и планшеты в альбомной ориентации */
@media (max-width: 1366px) {
    .color-preview {
        width: 170px; /* from 200 */
        height: 170px; /* from 200 */
    }
    .color-options {
        max-width: 1200px;
        gap: 25px;
    }
}

/* Планшеты в портретной ориентации */
@media (max-width: 1024px) {
    .color-preview {
        width: 150px; /* from 180 */
        height: 150px; /* from 180 */
    }
    .color-options {
        max-width: 900px;
        gap: 20px;
    }
}

/* Большие мобильные устройства */
@media (max-width: 768px) {
    .color-preview {
        width: 140px; /* from 160 */
        height: 140px; /* from 160 */
    }
    .color-options {
        max-width: 700px;
        gap: 15px;
    }
    .color-name {
        font-size: 1rem;
    }
}

/* Средние мобильные устройства */
@media (max-width: 576px) {
    .color-preview {
        width: 120px; /* from 140 */
        height: 120px; /* from 140 */
    }
    .color-options {
        gap: 10px;
        padding: 0 10px;
    }
}

/* Маленькие мобильные устройства */
@media (max-width: 375px) {
    .color-preview {
        width: 100px; /* from 120 */
        height: 100px; /* from 120 */
    }
    .color-options {
        gap: 8px;
        padding: 0 5px;
    }
    .color-name {
        font-size: 0.9rem;
    }
}

/* Очень маленькие экраны */
@media (max-width: 320px) {
    .color-preview {
        width: 90px; /* from 100 */
        height: 90px; /* from 100 */
    }
    .color-options {
        gap: 5px;
    }
}

/* Оптимизация для устройств в ландшафтной ориентации */
@media (orientation: landscape) and (max-height: 600px) {
    .color-preview {
        width: 120px;
        height: 120px;
    }
    .color-options {
        gap: 10px;
    }
    .color-selector {
        margin-bottom: 20px;
    }
}

/* Анимация для кнопок выбора цвета */
.color-option {
    transition: transform 0.2s ease;
}

.color-option:hover {
    transform: translateY(-3px);
}

.color-option.active {
    animation: pulse 1s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.highlight {
    color: #4CAF50;
    font-weight: bold;
}

/* Responsive grid for color options */
@media (max-width: 768px) {
    .color-options {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .color-options {
        grid-template-columns: repeat(2, 1fr);
    }
}
