@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f4f4f4;
    color: #333;
    overflow: hidden; /* Щоб не було скролу, слайди гортаються */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.presentation {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s;
    display: flex;
    flex-direction: column;
    padding: 40px;
    background: #fff;
}

.slide.active {
    opacity: 1;
    visibility: visible;
}

/* Титульний слайд */
.slide.title-slide {
    background: #e8e3db; /* Світло-бежевий фон */
    justify-content: center;
    align-items: center;
    text-align: center;
}

.title-slide h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #4a3f35;
    letter-spacing: 1px;
}

.title-slide p {
    font-size: 1.2rem;
    color: #6b5e51;
    margin-bottom: 10px;
    max-width: 800px;
}

.title-slide .price {
    font-size: 2.5rem;
    font-weight: 700;
    color: #d4a373;
    margin-top: 40px;
    padding: 15px 40px;
    border: 2px solid #d4a373;
    border-radius: 50px;
    display: inline-block;
}

/* Слайди з контентом */
.slide-content {
    display: flex;
    flex-direction: row;
    height: 100%;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.text-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 20px;
}

.text-section h2 {
    font-size: 2.2rem;
    margin-bottom: 25px;
    color: #4a3f35;
    border-bottom: 3px solid #d4a373;
    padding-bottom: 10px;
    display: inline-block;
}

.text-section h3 {
    font-size: 1.1rem;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #6b5e51;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.text-section ul {
    list-style-type: none;
    padding-left: 0;
}

.text-section ul li {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.text-section ul li::before {
    content: "•";
    color: #d4a373;
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: -5px;
}

.text-section p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #555;
}

/* Секція з фото */
.image-section {
    flex: 1.2;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-content: center;
    justify-content: center;
}

.image-placeholder {
    width: 48%;
    height: 250px;
    background-color: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #888;
    font-weight: 600;
    text-align: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

.image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    position: absolute;
    top: 0;
    left: 0;
}

/* Футер з навігацією */
.nav-controls {
    position: fixed;
    bottom: 30px;
    right: 40px;
    display: flex;
    gap: 15px;
    z-index: 100;
}

.nav-btn {
    background-color: #4a3f35;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 1.2rem;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.nav-btn:hover {
    background-color: #d4a373;
}

.slide-counter {
    position: fixed;
    bottom: 40px;
    left: 40px;
    font-size: 1rem;
    color: #888;
    font-weight: 600;
    z-index: 100;
}

/* Адаптивність для планшетів/телефонів */
@media (max-width: 1024px) {
    .slide { padding: 20px; }
    .slide-content {
        flex-direction: column;
        gap: 15px;
    }
    .text-section { padding-right: 0; }
    .image-section { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; height: 250px; flex: none; }
    .image-placeholder { width: 300px; height: 100%; flex-shrink: 0; }
    .title-slide h1 { font-size: 2rem; }
    .title-slide .price { font-size: 1.8rem; }
    .nav-controls { bottom: 15px; right: 15px; }
    .slide-counter { bottom: 25px; left: 15px; }
}

.image-placeholder {
    padding: 0;
    border: 0;
    cursor: zoom-in;
    box-shadow: 0 8px 24px rgba(40, 32, 24, .12);
    transition: transform .2s ease, box-shadow .2s ease;
    flex: 0 1 calc(50% - 8px);
    min-width: 0;
    height: clamp(150px, 27vh, 250px);
    background: #eee;
}
.image-placeholder:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(40, 32, 24, .18);
}
.image-placeholder img {
    display: block;
    object-fit: cover;
    transition: transform .3s ease;
}
.image-placeholder:hover img { transform: scale(1.04); }
.image-caption {
    position: absolute;
    inset: auto 0 0;
    padding: 10px 12px;
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    text-align: left;
    background: linear-gradient(transparent, rgba(0,0,0,.72));
    z-index: 1;
}
.image-placeholder:focus-visible, .nav-btn:focus-visible, .lightbox-close:focus-visible {
    outline: 3px solid #d4a373;
    outline-offset: 3px;
}
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 13, 11, .92);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img {
    display: block;
    max-width: min(94vw, 1500px);
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0,0,0,.4);
}
.lightbox-close {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,.15);
    font-size: 1.8rem;
    cursor: pointer;
}
.lightbox-caption {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    color: #fff;
    text-align: center;
    font-size: .9rem;
}
@media (max-width: 1024px) {
    body {
        display: block;
        height: auto;
        min-height: 100vh;
        overflow: hidden;
    }
    .presentation { min-height: 100vh; height: 100dvh; }
    .slide {
        height: 100%;
        min-height: 100%;
        padding: 18px 16px 78px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .slide-content {
        height: auto;
        min-height: 100%;
        flex-direction: column;
        gap: 18px;
        justify-content: flex-start;
    }
    .text-section { flex: none; padding: 0; }
    .text-section h2 { font-size: clamp(1.45rem, 5vw, 2rem); margin-bottom: 14px; }
    .text-section h3 { font-size: .95rem; margin-top: 14px; }
    .text-section p, .text-section ul li { font-size: .9rem; line-height: 1.55; }
    .image-section {
        flex: none;
        height: auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        align-content: start;
        overflow: visible;
    }
    .image-placeholder {
        width: 100%;
        height: clamp(135px, 26vw, 220px);
        flex: none;
    }
    .title-slide h1 { font-size: clamp(1.7rem, 7vw, 2.5rem); }
    .title-slide p { font-size: 1rem; }
    .title-slide .price { font-size: clamp(1.5rem, 6vw, 2rem); margin-top: 22px; padding: 12px 26px; }
    .nav-controls { bottom: 12px; right: 12px; gap: 10px; }
    .nav-btn { width: 44px; height: 44px; font-size: 1rem; }
    .slide-counter {
        bottom: 25px;
        left: 14px;
        padding: 5px 9px;
        background: rgba(255,255,255,.88);
        border-radius: 20px;
    }
    .slide-content[style*="flex-direction: column"] { padding-top: 10px; }
}
@media (max-width: 480px) {
    .slide { padding: 16px 12px 72px; }
    .image-section { grid-template-columns: 1fr; }
    .image-placeholder { height: 210px; }
    .title-slide { padding: 24px !important; text-align: center; }
    .title-slide .price { padding: 10px 20px; }
    .lightbox { padding: 12px; }
    .lightbox img { max-width: 96vw; max-height: 82vh; }
    .lightbox-caption { bottom: 10px; font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}



/* Слайд только с изображениями */
/*.slide:has(> .slide-content > .image-section):not(:has(.text-section)) {*/
/*    padding: 20px;*/
/*}*/

/*.slide:has(> .slide-content > .image-section):not(:has(.text-section))*/
/*.slide-content {*/
/*    width: 100%;*/
/*    max-width: none;*/
/*    height: 100%;*/
/*    min-height: 0;*/
/*    gap: 0;*/
/*}*/

/*.slide:has(> .slide-content > .image-section):not(:has(.text-section))*/
/*.image-section {*/
/*    --image-gap: 15px;*/

/*    display: grid;*/
/*    grid-template-columns: repeat(2, minmax(0, 1fr));*/
/*    grid-template-rows: repeat(3, minmax(0, 1fr));*/
/*    grid-auto-flow: row;*/
/*    gap: var(--image-gap);*/

/*    flex: 1;*/
/*    width: 100%;*/
/*    height: 100%;*/
/*    min-height: 0;*/
/*    align-content: stretch;*/
/*    justify-content: stretch;*/
/*    overflow: hidden;*/
/*}*/

/*.slide:has(> .slide-content > .image-section):not(:has(.text-section))*/
/*.image-placeholder {*/
/*    position: relative;*/
/*    width: 100%;*/
/*    height: 100%;*/
/*    min-width: 0;*/
/*    min-height: 0;*/
/*    flex: none;*/
/*    padding: 0;*/
/*    margin: 0;*/
/*    overflow: hidden;*/
/*}*/

/*.slide:has(> .slide-content > .image-section):not(:has(.text-section))*/
/*.image-placeholder img {*/
/*    position: absolute;*/
/*    inset: 0;*/
/*    display: block;*/
/*    width: 100%;*/
/*    height: 100%;*/
/*    object-fit: cover;*/
/*}*/

/*!* Автоматическое распределение всех блоков по площади *!*/
/*@media (min-width: 481px) {*/
/*    .slide:has(> .slide-content > .image-section):not(:has(.text-section))*/
/*    .image-section {*/
/*        grid-template-rows: none;*/
/*        grid-auto-rows: 1fr;*/
/*    }*/
/*}*/

/*!* Телефон *!*/
/*@media (max-width: 480px) {*/
/*    .slide:has(> .slide-content > .image-section):not(:has(.text-section))*/
/*    .image-section {*/
/*        grid-template-columns: minmax(0, 1fr);*/
/*        grid-template-rows: none;*/
/*        grid-auto-rows: 210px;*/
/*        overflow-y: auto;*/
/*    }*/
/*}*/



/* ==========================================
   АДАПТИВНАЯ СЕТКА ИЗОБРАЖЕНИЙ
   Для слайдов без .text-section
   ========================================== */

.slide:has(> .slide-content > .image-section):not(:has(.text-section)) {
    padding: 20px;
}

.slide:has(> .slide-content > .image-section):not(:has(.text-section))
.slide-content {
    display: flex;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    gap: 0;
}

.slide:has(> .slide-content > .image-section):not(:has(.text-section))
.image-section {
    --grid-gap: 12px;

    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    grid-auto-rows: 1fr;
    gap: var(--grid-gap);

    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;

    align-content: stretch;
    justify-content: stretch;
    overflow: hidden;
}

.slide:has(> .slide-content > .image-section):not(:has(.text-section))
.image-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    flex: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.slide:has(> .slide-content > .image-section):not(:has(.text-section))
.image-placeholder img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Небольшие экраны */
@media (max-width: 600px) {
    .slide:has(> .slide-content > .image-section):not(:has(.text-section)) {
        padding: 12px 12px 72px;
    }

    .slide:has(> .slide-content > .image-section):not(:has(.text-section))
    .image-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-rows: minmax(0, 1fr);
        gap: 8px;
        overflow-y: auto;
    }
}
