/* =========================================================
   KRETA RESTAURANT
   DIGITAL SPEISEKARTE – FLIPBOOK
   flipbook.css
========================================================= */


/* =========================================================
   1. ОСНОВНА СЕКЦИЯ
========================================================= */

.flipbook-section {

    position: relative;

    width: 100%;

    min-height: 900px;

    padding: 100px 30px 120px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    overflow: hidden;

    background:

        radial-gradient(
            circle at 20% 20%,
            rgba(255,255,255,0.8),
            transparent 35%
        ),

        radial-gradient(
            circle at 80% 80%,
            rgba(212,175,55,0.12),
            transparent 35%
        ),

        linear-gradient(
            135deg,
            #f8f4ea,
            #e8dfcf
        );

}


/* =========================================================
   2. ДЕКОРАТИВНИ ЕЛЕМЕНТИ
========================================================= */

.flipbook-section::before {

    content: "🫒";

    position: absolute;

    top: 70px;

    left: 7%;

    font-size: 80px;

    opacity: 0.12;

    transform: rotate(-20deg);

    pointer-events: none;

}


.flipbook-section::after {

    content: "🌿";

    position: absolute;

    bottom: 60px;

    right: 8%;

    font-size: 90px;

    opacity: 0.10;

    transform: rotate(20deg);

    pointer-events: none;

}


/* =========================================================
   3. ЗАГЛАВИЕ
========================================================= */

.flipbook-intro {

    position: relative;

    z-index: 5;

    text-align: center;

    max-width: 700px;

    margin-bottom: 50px;

}


.flipbook-icon {

    display: block;

    font-size: 3rem;

    margin-bottom: 10px;

    animation: flipbookFloat 3s ease-in-out infinite;

}


.flipbook-intro h2 {

    margin: 0 0 15px;

    font-size: clamp(
        2rem,
        5vw,
        3.5rem
    );

    color: #0d5eaf;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    letter-spacing: 1px;

}


.flipbook-intro p {

    margin: 0;

    color: #555;

    font-size: 1.1rem;

    line-height: 1.7;

}


/* =========================================================
   4. ОСНОВЕН WRAPPER
========================================================= */

.flipbook-wrapper {

    position: relative;

    z-index: 10;

    width: 100%;

    max-width: 1250px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 30px;

}


/* =========================================================
   5. FLIPBOOK
========================================================= */

.flipbook {

    position: relative;

    width: min(
        900px,
        80vw
    );

    height: min(
        600px,
        55vw
    );

    min-height: 450px;

    display: flex;

    perspective: 2500px;

    background: #6f4b2b;

    padding: 18px;

    border-radius: 8px;

    box-shadow:

        0 35px 70px
        rgba(0,0,0,0.30),

        0 10px 25px
        rgba(0,0,0,0.20);

}


/* =========================================================
   6. СТРАНИЦИ
========================================================= */

.flip-page {

    position: relative;

    width: 50%;

    height: 100%;

    overflow: hidden;

    background: #f8f0dc;

    box-shadow:
        inset 0 0 30px
        rgba(0,0,0,0.08);

}


.flip-page img {

    width: 100%;

    height: 100%;

    display: block;

    object-fit: cover;

    user-select: none;

    -webkit-user-drag: none;

    transition:
        transform 0.4s ease;

}


/* =========================================================
   7. ЛЯВА СТРАНИЦА
========================================================= */

.left-page {

    border-radius:
        5px
        0
        0
        5px;

    transform-origin: right center;

}


/* =========================================================
   8. ДЯСНА СТРАНИЦА
========================================================= */

.right-page {

    border-radius:
        0
        5px
        5px
        0;

    transform-origin: left center;

}


/* =========================================================
   9. ЛИНИЯ В СРЕДАТА
========================================================= */

.flipbook::before {

    content: "";

    position: absolute;

    top: 18px;

    bottom: 18px;

    left: 50%;

    width: 4px;

    transform:
        translateX(-50%);

    z-index: 20;

    background:

        linear-gradient(
            to right,
            rgba(0,0,0,0.18),
            rgba(255,255,255,0.5),
            rgba(0,0,0,0.18)
        );

    box-shadow:

        0 0 8px
        rgba(0,0,0,0.25);

    pointer-events: none;

}


/* =========================================================
   10. ЕФЕКТ СЯНКА НА СТРАНИЦИТЕ
========================================================= */

.left-page::after,
.right-page::after {

    content: "";

    position: absolute;

    top: 0;

    bottom: 0;

    width: 40px;

    pointer-events: none;

    opacity: 0.25;

}


.left-page::after {

    right: 0;

    background:

        linear-gradient(
            to left,
            rgba(0,0,0,0.25),
            transparent
        );

}


.right-page::after {

    left: 0;

    background:

        linear-gradient(
            to right,
            rgba(0,0,0,0.25),
            transparent
        );

}


/* =========================================================
   11. БУТОНИ ЗА ПРЕЛИСТВАНЕ
========================================================= */

.flipbook-button {

    width: 60px;

    height: 60px;

    flex-shrink: 0;

    border: none;

    border-radius: 50%;

    display: flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

    font-size: 1.5rem;

    color: white;

    background:

        linear-gradient(
            135deg,
            #0d5eaf,
            #08477f
        );

    box-shadow:

        0 10px 25px
        rgba(0,0,0,0.25);

    transition:

        transform 0.3s ease,

        box-shadow 0.3s ease,

        background 0.3s ease;

}


.flipbook-button:hover {

    transform:
        scale(1.1);

    background:

        linear-gradient(
            135deg,
            #d4af37,
            #b89018
        );

    color: #222;

    box-shadow:

        0 15px 30px
        rgba(0,0,0,0.30);

}


.flipbook-button:active {

    transform:
        scale(0.95);

}


.flipbook-button:disabled {

    opacity: 0.35;

    cursor: not-allowed;

    transform: none;

}


/* =========================================================
   12. КОНТРОЛИ
========================================================= */

.flipbook-controls {

    position: relative;

    z-index: 20;

    margin-top: 35px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 15px;

    flex-wrap: wrap;

}


.flipbook-control {

    min-width: 48px;

    height: 48px;

    padding: 0 15px;

    border: none;

    border-radius: 25px;

    cursor: pointer;

    font-size: 1rem;

    font-weight: bold;

    color: white;

    background: #0d5eaf;

    transition:

        transform 0.3s ease,

        background 0.3s ease;

}


.flipbook-control:hover {

    background: #d4af37;

    color: #222;

    transform:
        translateY(-3px);

}


#pageNumber {

    min-width: 130px;

    text-align: center;

    padding: 12px 20px;

    border-radius: 25px;

    color: #333;

    font-weight: bold;

    background: rgba(
        255,
        255,
        255,
        0.8
    );

    box-shadow:

        0 5px 15px
        rgba(0,0,0,0.08);

}


/* =========================================================
   13. СЪВЕТ
========================================================= */

.flipbook-hint {

    position: relative;

    z-index: 5;

    margin-top: 25px;

    color: #666;

    font-size: 0.95rem;

    text-align: center;

}


/* =========================================================
   14. АНИМАЦИЯ ПРИ ПРЕЛИСТВАНЕ
========================================================= */

.flip-next-animation {

    animation:

        pageFlipNext
        0.7s
        ease-in-out;

}


.flip-prev-animation {

    animation:

        pageFlipPrev
        0.7s
        ease-in-out;

}


@keyframes pageFlipNext {

    0% {

        transform:
            rotateY(0deg);

        opacity: 1;

    }

    50% {

        transform:
            rotateY(-12deg);

        opacity: 0.7;

    }

    100% {

        transform:
            rotateY(0deg);

        opacity: 1;

    }

}


@keyframes pageFlipPrev {

    0% {

        transform:
            rotateY(0deg);

        opacity: 1;

    }

    50% {

        transform:
            rotateY(12deg);

        opacity: 0.7;

    }

    100% {

        transform:
            rotateY(0deg);

        opacity: 1;

    }

}


/* =========================================================
   15. ZOOM
========================================================= */

.flipbook.zoomed {

    cursor:
        zoom-out;

}


.flipbook.zoomed img {

    transform:
        scale(1.5);

    cursor:
        zoom-out;

}


.flipbook.zoomed {

    overflow: auto;

}


/* =========================================================
   16. ПЪЛЕН ЕКРАН
========================================================= */

.flipbook-fullscreen {

    position: fixed;

    inset: 0;

    z-index: 9999;

    width: 100vw;

    height: 100vh;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 40px;

    background:

        rgba(
            10,
            20,
            30,
            0.96
        );

}


.flipbook-fullscreen .flipbook {

    width: 90vw;

    height: 85vh;

    max-width: 1400px;

    max-height: 900px;

}


/* =========================================================
   17. ЛЕКО ДВИЖЕНИЕ НА КНИГАТА
========================================================= */

.flipbook {

    animation:

        bookAppear
        1s
        ease-out;

}


@keyframes bookAppear {

    from {

        opacity: 0;

        transform:
            translateY(40px)
            scale(0.95);

    }

    to {

        opacity: 1;

        transform:
            translateY(0)
            scale(1);

    }

}


/* =========================================================
   18. FLOAT АНИМАЦИЯ
========================================================= */

@keyframes flipbookFloat {

    0% {

        transform:
            translateY(0);

    }

    50% {

        transform:
            translateY(-8px);

    }

    100% {

        transform:
            translateY(0);

    }

}


/* =========================================================
   19. TABLET
========================================================= */

@media
(max-width: 1000px) {

    .flipbook-section {

        padding:
            80px
            20px
            100px;

    }


    .flipbook-wrapper {

        gap: 15px;

    }


    .flipbook-button {

        width: 50px;

        height: 50px;

    }


    .flipbook {

        width: 80vw;

        height: 55vw;

        min-height: 400px;

    }

}


/* =========================================================
   20. MOBILE
========================================================= */

@media
(max-width: 700px) {

    .flipbook-section {

        min-height: 750px;

        padding:
            70px
            15px
            80px;

    }


    .flipbook-intro {

        margin-bottom: 30px;

    }


    .flipbook-intro h2 {

        font-size:
            2rem;

    }


    .flipbook-intro p {

        font-size:
            0.95rem;

    }


    .flipbook-wrapper {

        gap: 8px;

    }


    .flipbook {

        width:
            calc(
                100vw - 90px
            );

        height:
            calc(
                (100vw - 90px) * 1.35
            );

        min-height: 450px;

        max-height: 600px;

        padding: 8px;

    }


    .flipbook::before {

        top: 8px;

        bottom: 8px;

    }


    .flipbook-button {

        width: 42px;

        height: 42px;

        font-size:
            1rem;

    }


    .flipbook-controls {

        margin-top: 25px;

        gap: 8px;

    }


    .flipbook-control {

        min-width: 42px;

        height: 42px;

        padding: 0 12px;

    }


    #pageNumber {

        min-width: 110px;

        padding:
            10px 12px;

        font-size:
            0.9rem;

    }


    .flipbook-hint {

        max-width:
            300px;

        line-height:
            1.5;

    }

}


/* =========================================================
   21. МНОГО МАЛЪК ЕКРАН
========================================================= */

@media
(max-width: 450px) {

    .flipbook-section {

        padding:
            60px
            8px
            70px;

    }


    .flipbook-wrapper {

        gap: 4px;

    }


    .flipbook {

        width:
            calc(
                100vw - 70px
            );

        height:
            480px;

    }


    .flipbook-button {

        width: 32px;

        height: 32px;

        font-size:
            0.8rem;

    }


    .flipbook-intro h2 {

        font-size:
            1.7rem;

    }


    .flipbook-icon {

        font-size:
            2.3rem;

    }

}


/* =========================================================
   22. ACCESSIBILITY
========================================================= */

.flipbook-button:focus,
.flipbook-control:focus {

    outline:
        3px solid
        rgba(
            13,
            94,
            175,
            0.4
        );

    outline-offset:
        3px;

}


/* =========================================================
   23. REDUCE MOTION
========================================================= */

@media
(prefers-reduced-motion: reduce) {

    .flipbook,
    .flipbook-icon,
    .flipbook-button,
    .flipbook-control {

        animation: none;

        transition: none;

    }

}