/* Контакты */
#contact {
    padding: 3rem 0;
    text-align: center;
}

#contact h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1E3F1B;
    margin-bottom: 2rem;
}

#contact a {
  color: var(--brand);
  text-decoration: none;
}

#contact a:hover {
    text-decoration: underline;
}

/* Стили для виджета Яндекс Карт */
.yandex-maps-widget {
    position: relative;
    overflow: hidden;
    margin-top: 2rem;
    width: 100%;
    max-width: 560px;
    height: 400px;
    margin-left: auto;
    margin-right: auto;
}

.yandex-maps-widget iframe {
    width: 100%;
    height: 100%;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
}

.yandex-maps-widget a {
    color: #eee;
    font-size: 12px;
    position: absolute;
}

.yandex-maps-widget a:first-of-type {
    top: 0px;
}

.yandex-maps-widget a:nth-of-type(2) {
    top: 14px;
}

.yandex-maps-widget a:nth-of-type(3) {
    top: 28px;
}

/* Стили для виджета ВКонтакте */
#vk_groups {
  width: 100%;
  max-width: 100vw;
  height: calc(100vh - 150px);
  min-height: 500px;
  overflow: hidden;
}

#vk_groups iframe {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 500px;
  border: none;
}

@media (max-width: 1200px) {
  #vk_groups {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  #vk_groups {
    height: 80vh;
    min-height: 400px;
    max-width: 100%;
  }
}

/* Стили для изображений в разделе "Как нас найти" */
.gallery-way {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.gallery-way-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.gallery-way-item img:hover {
    transform: scale(1.05);
}

/* Планшеты средние: 768px-1024px */
@media (min-width: 768px) and (max-width: 1024px) {
    #contact {
        padding: 2.5rem 0;
    }
    
    #contact h2 {
        font-size: 2rem;
        margin-bottom: 1.8rem;
    }
    
    #contact p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
    
    .yandex-maps-widget {
        max-width: 100%;
        height: 350px;
        margin-top: 1.5rem;
    }
    
    .gallery-way {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .gallery-way-item img {
        height: 200px;
    }
}

/* Планшеты малые: 621px-767px */
@media (min-width: 621px) and (max-width: 767px) {
    #contact {
        padding: 2rem 0;
    }
    
    #contact h2 {
        font-size: 1.7rem;
        margin-bottom: 1.5rem;
    }
    
    #contact p {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }
    
    .yandex-maps-widget {
        max-width: 100%;
        height: 300px;
        margin-top: 1.2rem;
    }
    
    .gallery-way {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-top: 1.2rem;
    }
    
    .gallery-way-item img {
        height: 180px;
    }
}

/* Большие телефоны: 481px-620px */
@media (min-width: 481px) and (max-width: 620px) {
    #contact {
        padding: 1.5rem 0;
    }
    
    #contact h2 {
        font-size: 1.5rem;
        margin-bottom: 1.2rem;
    }
    
    #contact p {
        font-size: 0.85rem;
        margin-bottom: 0.7rem;
    }
    
    .yandex-maps-widget {
        max-width: 100%;
        height: 280px;
        margin-top: 1rem;
    }
    
    .gallery-way {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        margin-top: 1rem;
    }
    
    .gallery-way-item img {
        height: 150px;
    }
}

/* Мобильные устройства: 320px-480px */
@media (max-width: 480px) {
    #contact {
        padding: 1.2rem 0;
    }
    
    #contact h2 {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }
    
    #contact p {
        font-size: 0.8rem;
        margin-bottom: 0.6rem;
        line-height: 1.5;
    }
    
    .yandex-maps-widget {
        max-width: 100%;
        height: 250px;
        margin-top: 0.8rem;
    }
    
    .yandex-maps-widget a {
        font-size: 10px;
    }
    
    #vk_groups {
        height: 60vh;
        min-height: 300px;
    }
    
    #vk_groups iframe {
        min-height: 300px;
    }
    
    .gallery-way {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        margin-top: 0.8rem;
    }
    
    .gallery-way-item img {
        height: 200px;
    }
    
    .gallery-way-item img:hover {
        transform: scale(1.02);
    }
}
