/* ==========================================================================
   Catalog dang sach lat - xem assets/scripts/catalog-flipbook.js
   Mau theo he mau site: nen nau ca phe, chu kem, nut do thuong hieu.
   ========================================================================== */

html.cfb-lock,
html.cfb-lock body {
    overflow: hidden
}

.cfb {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    background: rgba(30, 15, 10, .95);
    color: var(--main-light-color, #e4d3a4);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease
}

.cfb.is-open {
    opacity: 1;
    visibility: visible
}

/* ---------- thanh tren ---------- */
.cfb__bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
    padding: 14px 24px
}

.cfb__title {
    margin-right: auto;
    font-family: "Proza Libre", iCielProza, serif;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: .04em;
    text-transform: uppercase
}

.cfb__count {
    min-width: 76px;
    font-size: 14px;
    letter-spacing: .08em;
    text-align: center
}

.cfb__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid rgba(228, 211, 164, .5);
    border-radius: 19px;
    background: transparent;
    color: var(--main-light-color, #e4d3a4);
    font: inherit;
    font-size: 13px;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease
}

.cfb__btn:hover,
.cfb__btn:focus-visible {
    background: var(--main-site-bakground, #a13a27);
    border-color: var(--main-site-bakground, #a13a27);
    color: #fff
}

.cfb__btn svg,
.cfb__nav svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round
}

.cfb__close {
    width: 38px;
    padding: 0;
    font-size: 24px;
    line-height: 1
}

/* ---------- vung sach ---------- */
.cfb__stage {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 8px 84px 32px;
    perspective: 2600px;
    overflow: hidden
}

.cfb__book {
    position: relative;
    transition: transform .7s cubic-bezier(.4, 0, .2, 1)
}

.cfb__leaf {
    position: absolute;
    top: 0;
    height: 100%;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform .7s cubic-bezier(.4, 0, .2, 1);
    cursor: pointer
}

.cfb--spread .cfb__leaf {
    left: 50%;
    width: 50%
}

.cfb__leaf.is-flipped {
    transform: rotateY(-180deg)
}

/* 1 trang (dien thoai): to da lat mo dan sau khi qua nua vong */
.cfb--single .cfb__leaf {
    left: 0;
    width: 100%;
    transition: transform .7s cubic-bezier(.4, 0, .2, 1), opacity .2s ease
}

.cfb--single .cfb__leaf.is-flipped {
    opacity: 0;
    transition: transform .7s cubic-bezier(.4, 0, .2, 1), opacity .2s ease .5s
}

.cfb__face {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #faf6ee;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .35)
}

.cfb__face--back {
    transform: rotateY(180deg)
}

.cfb__face canvas {
    display: block;
    width: 100%;
    height: 100%
}

/* Bong o gay sach */
.cfb__face:after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none
}

.cfb--spread .cfb__face--front:after {
    background: linear-gradient(90deg, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0) 7%)
}

.cfb--spread .cfb__face--back:after {
    background: linear-gradient(270deg, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0) 7%)
}

/* Trang chua ve xong */
.cfb__face.is-empty:before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 2px solid rgba(161, 58, 39, .2);
    border-top-color: var(--main-site-bakground, #a13a27);
    border-radius: 50%;
    animation: cfb-spin .8s linear infinite
}

@keyframes cfb-spin {
    to {
        transform: rotate(360deg)
    }
}

/* ---------- nut lat ---------- */
.cfb__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin-top: -25px;
    padding: 0;
    border: 1px solid rgba(228, 211, 164, .5);
    border-radius: 50%;
    background: transparent;
    color: var(--main-light-color, #e4d3a4);
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease
}

.cfb__nav:hover:not([disabled]),
.cfb__nav:focus-visible {
    background: var(--main-site-bakground, #a13a27);
    border-color: var(--main-site-bakground, #a13a27);
    color: #fff
}

.cfb__nav[disabled] {
    opacity: .25;
    cursor: default
}

.cfb__nav--prev {
    left: 18px
}

.cfb__nav--next {
    right: 18px
}

/* ---------- thong bao tai / loi ---------- */
.cfb__msg {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 15px;
    text-align: center;
    pointer-events: none
}

.cfb__msg[hidden] {
    display: none
}

.cfb__msg a {
    color: var(--main-light-color, #e4d3a4);
    text-decoration: underline;
    pointer-events: auto
}

/* ---------- dien thoai ---------- */
@media screen and (max-width:767px) {
    .cfb__bar {
        gap: 8px;
        padding: 10px 12px
    }

    .cfb__title {
        font-size: 14px
    }

    .cfb__count {
        min-width: 56px;
        font-size: 13px
    }

    .cfb__dl {
        width: 38px;
        padding: 0
    }

    .cfb__label {
        display: none
    }

    .cfb__stage {
        padding: 6px 14px 80px
    }

    .cfb__nav {
        top: auto;
        bottom: 16px;
        margin-top: 0
    }

    .cfb__nav--prev {
        left: calc(50% - 64px)
    }

    .cfb__nav--next {
        right: calc(50% - 64px)
    }
}

@media (prefers-reduced-motion: reduce) {
    .cfb__book,
    .cfb__leaf {
        transition: none !important
    }
}
