/* Медіа-запити для адаптивного дизайну */

/* Планшети та маленькі екрани (до 1024px) */
@media (max-width: 1024px) {

    .prev-btn,
    .next-btn {
        width: 35px;
        height: 35px;
    }

    .gallery-images {
        width: 95%;
    }

    .gallery-images img {
        max-height: 60vh;
    }

    /* Уменьшаем размер заголовка h1 в хедере */
    .header-section h1 {
        font-size: 1.8em;
        white-space: normal;
    }
}

/* Планшети (до 768px) */
@media (max-width: 768px) {

    /* Заголовок та шапка */
    .header-content {
        flex-direction: column;
        gap: 15px;
        padding: 20px 10px;
    }

    .header-section {
        margin-left: 0;
        margin-top: 10px;
    }

    .logo {
        margin: 0 auto;
    }

    .logo img {
        width: 120px;
        height: 120px;
        margin: -20px 0;
    }

    .social-section {
        width: 100%;
        text-align: center;
        padding: 15px;
    }

    .social {
        justify-content: center;
    }

    .social a {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }

    .social-title {
        font-size: 1rem;
    }

    .language-switcher {
        margin-top: 10px;
        gap: 5px;
    }

    .language-switcher a {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .header-section h1 {
        font-size: 1.5em;
        white-space: normal;
    }

    .header-section h2 {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    header {
        padding: 15px 0;
    }

    /* Галерея цуценят */
    .puppies-grid {
        gap: 15px;
        padding: 15px 5px;
        margin: 0 auto;
    }

    .puppy-card {
        flex: 0 0 260px;
        padding: 12px;
    }

    .puppy-image {
        height: 180px;
    }

    .info-details {
        font-size: 0.9rem;
    }

    .price {
        font-size: 1.2rem;
    }

    .reserve-button {
        padding: 8px 15px;
        font-size: 0.8rem;
    }

    .puppies-container::after,
    .puppies-container::before {
        display: none;
    }

    .puppies-container {
        padding: 0 40px;
    }

    .puppies-nav {
        width: 35px;
        height: 35px;
    }

    /* Навігаційне меню */
    .main-nav ul {
        flex-wrap: wrap;
        gap: 10px;
    }

    .main-nav li {
        margin: 0 5px;
    }

    .main-nav a {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    /* Футер */
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }

    .footer-col {
        width: 100%;
        min-width: 100%;
    }

    .delivery-dropdown {
        width: 100%;
    }

    .dropdown-content {
        position: static;
        margin-top: 10px;
        max-height: 200px;
    }

    /* Модальне вікно доставки */
    .delivery-modal-content {
        padding: 20px;
        max-width: 85%;
        width: 85%;
        margin: 0 auto;
    }

    .delivery-cities-list {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .delivery-btn {
        padding: 10px 15px;
        font-size: 15px;
    }

    .footer-col.delivery .delivery-buttons,
    .delivery-buttons {
        max-width: 100%;
    }

    /* Модальне вікно */
    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .gallery-images {
        margin-top: 10px;
    }

    .gallery-image-wrapper img {
        max-height: 60vh;
    }

    /* Модальне вікно бронювання */
    #bookingModal .modal-content {
        width: 90%;
        padding: 20px;
    }

    #bookingModal h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    #bookingModal .contact-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
}

/* Мобільні телефони (до 480px) */
@media (max-width: 480px) {
    .header-section h1 {
        font-size: 1.3em;
        white-space: normal;
        line-height: 1.3;
    }

    .header-section h2 {
        font-size: 1.2rem;
    }

    .subtitle {
        font-size: 0.7rem;
    }

    .logo {
        text-align: center;
    }

    .logo img {
        width: 100px;
        height: 100px;
        margin: -15px 0;
    }

    .social-section {
        padding: 10px;
    }

    .social a {
        width: 32px;
        height: 32px;
        font-size: 18px;
        margin: 0 3px;
    }

    .social-title {
        font-size: 0.8rem;
    }

    .language-switcher {
        margin-top: 5px;
        gap: 3px;
    }

    .language-switcher a {
        width: 25px;
        height: 25px;
        font-size: 0.7rem;
        padding: 0;
    }

    /* Улучшения для галереи изображений в модальном окне */
    .modal-content {
        padding: 10px;
        width: 100%;
    }

    .nav-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }

    .gallery-images {
        width: 100%;
        margin: 0;
    }

    .modal {
        padding: 0;
    }

    .gallery-image-wrapper img {
        max-height: 90vh !important;
        max-width: 95vw !important;
        object-fit: contain !important;
    }

    /* Улучшение отображения счетчика изображений */
    .modal-image-counter {
        top: 15px !important;
        right: 65px !important;
        bottom: auto !important;
        left: auto !important;
        padding: 4px 12px !important;
        font-size: 12px !important;
        transform: none !important;
        position: absolute !important;
        background-color: rgba(0, 0, 0, 0.7) !important;
        color: white !important;
        border-radius: 20px !important;
        z-index: 1100 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
    }

    .modal-image-counter .current {
        font-size: 14px;
        font-weight: bold;
        color: #FFD700;
    }

    .modal-image-counter .photo-text {
        display: none;
        /* Скрываем слово "Фото" для экономии места */
    }

    .modal .close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    /* Улучшения для кнопок навигации в галерее на мобильных устройствах */
    .puppies-nav.prev-btn,
    .puppies-nav.next-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
        opacity: 0.9;
    }

    .puppies-nav.prev-btn {
        left: 8px;
    }

    .puppies-nav.next-btn {
        right: 8px;
    }

    /* Модальне вікно доставки */
    .delivery-modal-content {
        padding: 15px;
        max-width: 90%;
        width: 90%;
    }

    .delivery-cities-list li {
        padding: 5px 6px;
        font-size: 14px;
    }

    .delivery-modal-content h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    /* Телефони з маленьким екраном (до 380px) */
    @media (max-width: 380px) {
        .delivery-modal-content {
            padding: 15px 10px;
            width: 95%;
            max-width: 95%;
            border-width: 1px;
        }

        .delivery-modal-content h2 {
            font-size: 18px;
            margin-bottom: 12px;
        }

        .delivery-modal-content h2:after {
            width: 40px;
            height: 2px;
            bottom: -6px;
        }

        .delivery-cities-list li {
            padding: 4px 5px;
            font-size: 13px;
            margin-bottom: 0;
        }

        .delivery-cities {
            margin-top: 12px;
        }

        /* Картки цуценят */
        .puppy-card {
            padding: 10px;
            max-width: 280px;
        }

        .info-details {
            font-size: 0.85rem;
            gap: 5px;
        }

        .reserve-button {
            padding: 7px 12px;
            font-size: 0.75rem;
        }

        .status {
            font-size: 0.7rem;
            padding: 4px 10px 4px 12px;
        }
    }

    /* Дуже маленькі телефони (до 320px) */
    @media (max-width: 320px) {
        .delivery-modal-content {
            padding: 12px 8px;
        }

        .delivery-modal-content h2 {
            font-size: 16px;
            margin-bottom: 10px;
        }

        .delivery-cities-list li {
            padding: 3px 4px;
            font-size: 12px;
        }

        .delivery-cities-list li:before {
            font-size: 14px;
            margin-right: 5px;
        }

        /* Картки цуценят */
        .puppy-card {
            padding: 8px;
            max-width: 260px;
        }

        .info-details {
            font-size: 0.8rem;
            gap: 3px;
        }

        .puppy-image {
            height: 140px;
            margin-bottom: 10px;
        }

        .reserve-button {
            padding: 6px 10px;
            font-size: 0.7rem;
        }
    }

    /* Картки цуценят */
    .puppies-grid {
        padding: 10px 0;
        gap: 20px;
    }

    .puppy-card {
        flex: 0 0 100%;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
        box-sizing: border-box;
    }

    .puppies-container {
        padding: 0 15px;
    }

    .puppy-image {
        height: 160px;
    }
}

/* Пристрої з ландшафтною орієнтацією */
@media (orientation: landscape) and (max-height: 600px) {
    .modal.mobile-view .modal-image-counter {
        bottom: 10px;
    }

    .modal.mobile-view .close {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 16px;
    }

    /* Модальне вікно бронювання */
    #bookingModal .modal-content {
        display: flex;
        flex-direction: column;
        height: 100vh;
        overflow: auto;
        padding: 15px;
        margin: 0;
        width: 100%;
        border-radius: 0;
    }
}

/* Кнопка прокрутки вгору */
@media (max-width: 768px) {
    .scroll-to-top {
        width: 36px;
        height: 36px;
        bottom: 15px;
        right: 15px;
    }

    .scroll-to-top i {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .scroll-to-top {
        width: 32px;
        height: 32px;
        bottom: 12px;
        right: 12px;
    }

    .scroll-to-top i {
        font-size: 16px;
    }
}

/* Дополнительные стили для ландшафтной ориентации на мобильных устройствах */
@media (orientation: landscape) and (max-height: 450px) {
    .modal.mobile-view .gallery-image-wrapper img {
        max-height: 80vh !important;
        max-width: 90vw !important;
    }

    .modal.mobile-view .modal-content {
        padding: 5px;
    }

    .modal.mobile-view .puppies-nav.prev-btn,
    .modal.mobile-view .puppies-nav.next-btn {
        top: 50%;
        transform: translateY(-50%);
    }

    .modal.mobile-view .gallery-images {
        max-height: calc(100vh - 40px);
    }

    .modal.mobile-view .modal-image-counter {
        top: 10px !important;
        right: 55px !important;
    }
}

/* Дополнительные стили для очень маленьких мобильных устройств */
@media (max-width: 360px) {
    .modal.mobile-view .gallery-image-wrapper img {
        max-height: 85vh !important;
    }

    .modal.mobile-view .puppies-nav.prev-btn,
    .modal.mobile-view .puppies-nav.next-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .modal.mobile-view .close {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
}