/* Základní styly */
body {
    font-family: "Mulish";
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body h1, h2, h3, h4, h5 {
    font-family: "Chakra Petch";
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 250px);
    gap: 8px;
    margin-bottom: 20px;
}

.image-container {
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
}

.image-container:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

.image-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-gallery img:hover {
    transform: scale(1.1);
}

.main-content {
    display: flex;
    flex-wrap: wrap;
    margin-top: 20px;
}

.listing-details {
    flex: 2;
    padding-right: 20px;
}

.listing-details p {
    margin-top: 0;
}

.booking-box-wrapper {
    flex: 1;
    height: fit-content;
    position: sticky;
    top: 20px;
}

h1 {
    margin-top: 0;
    margin-bottom: 10px;
}

.info-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.info-section:last-child {
    border-bottom: none;
}

.info-section h2, h3, h4 {
    margin-top: 10px;
    margin-bottom: 10px;
}

.info-section ul {
    margin-top: 0;
}

/* Vlastní Carousel pro mobilní zařízení */
.mobile-carousel {
    display: none;
    width: 100%;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

.carousel-inner {
    display: flex;
    transition: transform 0.1s ease-out;
    cursor: grab;
}

.carousel-item {
    min-width: calc(100% / 1.2);
    box-sizing: border-box;
}

.carousel-item img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.prevImage, .nextImage, .closeModal {
    border: none!important;
}

.prevImage:hover, .nextImage:hover, .closeModal:hover {
    background-color: transparent!important;
}

.prevImage:focus, .nextImage:focus, .closeModal:focus,
.prevImage:target, .nextImage:target, .modalImage:target {
    background-color: transparent!important;
    border: none!important;
    outline: none!important;
}

/* Styly pro modal galerie */
#imageModal {
    display: flex;
    align-items: center;
    justify-content: center;
}

#imageModal > div {
    width: auto !important;
    max-width: 95vw !important;
    height: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#modalImage {
    height: 70vh !important;
    width: auto !important;
    max-width: 90vw;
    object-fit: contain;
    display: block;
}

#prevImage, #nextImage {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#prevImage {
    left: 20px;
}

#nextImage {
    right: 20px;
}

#prevImage:hover, #nextImage:hover {
    background: rgba(0, 0, 0, 0.8) !important;
}

#closeModal {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 40px;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

#closeModal:hover {
    background: rgba(0, 0, 0, 0.8) !important;
}

/* Styly pro listing-details */
.listing-details h1 {
    font-size: 2em;
    margin-bottom: 20px;
    font-weight: bold;
}

.listing-details p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
}

.listing-details .info-section h4 {
    font-size: 1.3em;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    font-weight: bold;
}

.listing-details .info-section ul {
    list-style: disc;
    margin-left: 0;
}

.listing-details .info-section li {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
    list-style: none;
}

/* Rezervační formulář */
.rezervace-form {
    max-width: 600px;
    margin: 0 auto;
}

.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: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
}

.btn-check,
.btn-submit {
    background: #0073aa;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-check:hover,
.btn-submit:hover {
    background: #005582;
}

.btn-check {
    background: #28a745;
}

.btn-check:hover {
    background: #218838;
}

#availability-result,
#form-result {
    margin: 20px 0;
    padding: 15px;
    border-radius: 4px;
    display: none;
}

.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Mobilní styly */
@media (max-width: 768px) {
    .image-gallery {
        display: none !important;
    }
    
    .container {
        padding: 20px 10px;
    }

    .mobile-carousel {
        display: block;
        --mobile-slides-to-show: 1.2;
        --space-between: 8px;
    }

    .mobile-carousel .carousel-inner {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        scrollbar-width: none;
        will-change: scroll-position;
        -ms-overflow-style: none;
        transform: none !important;
        transition: none !important;
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        scroll-snap-type: x mandatory;
        gap: 8px;
    }

    .mobile-carousel .carousel-inner::-webkit-scrollbar {
        display: none;
    }

    .mobile-carousel .carousel-item {
        min-width: calc((100% - (var(--mobile-slides-to-show) - 1) * var(--space-between)) / var(--mobile-slides-to-show));
        scroll-snap-align: start;
        border-radius: 10px;
        overflow: hidden;
    }

    .listing-details {
        padding-right: 0;
        margin-bottom: 80px;
    }

    .booking-box-wrapper {
        display: none;
    }

    /* Mobilní rezervační lišta */
    .booking-box-mobile-wrapper {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 100;
        background-color: white;
        box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-nav {
        padding: 0 10px;
    }
    
    .prev, .next {
        font-size: 20px;
        padding: 5px 10px;
    }
}

/* Skrýt mobilní karusel na větších obrazovkách */
@media (min-width: 769px) {
    .mobile-carousel {
        display: none !important;
    }
    .image-gallery {
        display: grid !important;
    }
    .booking-box-mobile-wrapper {
        display: none !important;
    }
}