* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Vazirmatn", sans-serif;

    background:
        linear-gradient(
            135deg,
            #4A2E7A,
            #6542A5,
            #7D58C8
        );

    min-height: 100vh;
    color: #fff;
}

.app {
    width: 100%;
    max-width: 600px;
    margin: auto;
    padding: 15px 10px 30px;
}


/* =========================
   HEADER
========================= */

.hero {
    text-align: center;
    padding: 10px 5px 15px;
}

.logo {
    font-size: 38px;
    margin-bottom: 5px;
}

.hero h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 900;
}

.hero p {
    margin: 6px 0 15px;
    font-size: 13px;
    opacity: .85;
}


/* =========================
   SEARCH
========================= */

.search-box {
    width: 100%;
}

.search-box input {
    width: 100%;
    height: 45px;

    border: none;
    outline: none;
    border-radius: 25px;

    padding: 0 20px;

    font-family: inherit;
    font-size: 14px;

    background: rgba(255,255,255,.95);
    color: #301c42;

    box-shadow:
        0 8px 25px rgba(0,0,0,.15);
}

.search-box input::placeholder {
    color: #777;
}


/* =========================
   CATEGORY NAV
========================= */

.category-nav {
    display: flex;
    gap: 8px;

    overflow-x: auto;

    padding: 5px 2px 12px;

    scrollbar-width: none;

    direction: rtl;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-btn {
    flex: 0 0 auto;

    border: 1px solid rgba(255,255,255,.25);

    background: rgba(255,255,255,.12);

    color: #fff;

    border-radius: 22px;

    padding: 9px 15px;

    font-family: inherit;
    font-size: 12px;

    cursor: pointer;

    transition: .25s;
}

.category-btn.active {
    background: #F4C542;

    color: #301c42;

    border-color: #F4C542;

    font-weight: 700;
}


/* =========================
   FEATURED
========================= */

.featured {
    display: none;
}


/* =========================
   BOOK
========================= */

#menu {
    width: 100%;
}

.book-wrapper {
    position: relative;

    width: 100%;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 0 28px;
}

.book {
    position: relative;

    width: 100%;

    height: 620px;
    min-height: 620px;

    perspective: 1400px;
}

.book-page {
    position: absolute;

    inset: 0;

    padding: 5px;

    overflow: hidden;

    border-radius: 7px 20px 20px 7px;

    background:
        linear-gradient(
            90deg,
            #f7f1e5 0%,
            #fffdf7 5%,
            #fffdf7 95%,
            #e9dfce 100%
        );

    color: #301c42;

    box-shadow:
        15px 18px 35px rgba(0,0,0,.35),
        inset 8px 0 12px rgba(0,0,0,.08);

    transform-origin: right center;

    backface-visibility: hidden;
}

.page-category-title {
    height: 30px;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 14px;

    font-weight: 700;

    color: #4A2E7A;
}


/* =========================
   PRODUCTS
========================= */

.page-products {
    display: flex;

    align-items: stretch;
    justify-content: center;

    width: 100%;

    height: calc(100% - 35px);

    padding: 0;
    margin: 0;
}

.product-card {
    position: relative;

    width: 100%;
    max-width: none;

    height: 100%;

    padding: 0;
    margin: 0;

    border-radius: 16px;

    overflow: hidden;

    cursor: default;

    background: #222;

    box-shadow:
        0 5px 20px rgba(0,0,0,.18);
}

.product-card img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    border-radius: 16px;
}


/* =========================
   DARK GRADIENT
========================= */

.product-card::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 52%;

    background:
        linear-gradient(
            to top,
            rgba(0,0,0,.94) 0%,
            rgba(0,0,0,.78) 35%,
            rgba(0,0,0,.35) 70%,
            transparent 100%
        );

    z-index: 2;

    pointer-events: none;
}


/* =========================
   PRODUCT NAME
========================= */

.product-card h3 {
    position: absolute;

    right: 18px;
    left: 18px;

    bottom: 150px;

    z-index: 5;

    margin: 0;

    color: #fff;

    font-size: 22px;

    font-weight: 700;

    text-shadow:
        0 2px 8px rgba(0,0,0,.9);
}


/* =========================
   PRODUCT VOLUME
========================= */

.product-card .product-volume {
    position: absolute;

    right: 18px;

    bottom: 125px;

    z-index: 5;

    margin: 0;

    color: rgba(255,255,255,.85);

    font-size: 12px;
}


/* =========================
   PRODUCT DESCRIPTION
========================= */

.product-card .product-description {
    position: absolute;

    right: 18px;
    left: 18px;

    bottom: 82px;

    z-index: 5;

    margin: 0;

    color: #fff;

    font-size: 12px;

    line-height: 1.8;

    display: -webkit-box;

    -webkit-line-clamp: 3;

    -webkit-box-orient: vertical;

    overflow: hidden;

    text-shadow:
        0 1px 5px rgba(0,0,0,.9);
}


/* =========================
   PRODUCT PRICE
========================= */

.product-card .product-price {
    position: absolute;

    right: 18px;
    left: 18px;

    bottom: 10px;

    z-index: 5;

    color: #fff;

    font-size: 16px;

    font-weight: 700;

    line-height: 1.7;

    text-align: right;

    text-shadow:
        0 2px 8px rgba(0,0,0,.9);
}


/* =========================
   PIZZA PRICE
========================= */

.product-card .pizza-price {
    bottom: 8px;

    display: flex;

    flex-direction: column;

    align-items: flex-start;

    gap: 8px;

    line-height: 1.5;
}

.pizza-price-line {
    display: flex;

    align-items: center;

    gap: 7px;

    white-space: nowrap;
}

.pizza-price-line span {
    font-size: 13px;
}

.pizza-price-line strong {
    font-size: 16px;
}

.pizza-price-line small {
    font-size: 10px;

    opacity: .8;
}


/* =========================
   PAGE BUTTONS
========================= */

.page-btn {
    position: absolute;

    top: 50%;

    transform: translateY(-50%);

    width: 38px;
    height: 38px;

    border: none;

    border-radius: 50%;

    background: rgba(255,255,255,.85);

    color: #4A2E7A;

    font-size: 30px;

    line-height: 1;

    cursor: pointer;

    z-index: 20;

    box-shadow:
        0 5px 15px rgba(0,0,0,.25);

    transition: .2s;
}

.page-btn:hover {
    transform:
        translateY(-50%)
        scale(1.08);
}

.page-btn:disabled {
    opacity: .25;

    cursor: default;
}

.prev-btn {
    right: 2px;
}

.next-btn {
    left: 2px;
}


/* =========================
   FLIP ANIMATION
========================= */

.flip-next {
    animation:
        flipNext .45s ease;
}

.flip-prev {
    animation:
        flipPrev .45s ease;
}

@keyframes flipNext {

    from {
        transform:
            rotateY(-12deg);

        opacity: .7;
    }

    to {
        transform:
            rotateY(0);

        opacity: 1;
    }
}

@keyframes flipPrev {

    from {
        transform:
            rotateY(12deg);

        opacity: .7;
    }

    to {
        transform:
            rotateY(0);

        opacity: 1;
    }
}


/* =========================
   PAGE INFO
========================= */

.page-info {
    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 5px;

    margin-top: 8px;
}

.swipe-hint {
    font-size: 13px;

    color: rgba(255,255,255,.75);

    letter-spacing: .5px;

    animation:
        swipeHint 1.8s ease-in-out infinite;
}

.page-number {
    font-size: 11px;

    color: rgba(255,255,255,.45);
}

@keyframes swipeHint {

    0%, 100% {
        transform: translateX(0);
        opacity: .55;
    }

    50% {
        transform: translateX(-5px);
        opacity: 1;
    }
}


/* =========================
   SEARCH RESULTS
========================= */

.search-results {
    display: none;

    margin-top: 20px;
}

.search-results.active {
    display: block;
}

.search-results-title {
    text-align: center;

    font-size: 18px;

    margin-bottom: 15px;
}

.search-result-card {
    background: rgba(255,255,255,.12);

    border: 1px solid rgba(255,255,255,.15);

    border-radius: 16px;

    padding: 15px;

    margin-bottom: 10px;
}

.search-result-card small {
    color: #F4C542;
}

.search-result-card h3 {
    margin: 5px 0;

    font-size: 17px;
}

.search-result-card p {
    margin: 5px 0;

    font-size: 12px;

    line-height: 1.8;

    opacity: .85;
}

.search-result-price {
    display: block;

    margin-top: 8px;

    color: #F4C542;

    font-weight: 700;
}


/* =========================
   IMAGE MODAL
========================= */

.image-modal {
    display: none;

    position: fixed;

    inset: 0;

    z-index: 9999;

    background: rgba(0,0,0,.92);

    align-items: center;
    justify-content: center;

    padding: 20px;
}

.image-modal.show {
    display: flex;
}

.image-modal img {
    max-width: 95%;

    max-height: 90vh;

    object-fit: contain;

    border-radius: 12px;
}

.close-modal {
    position: absolute;

    top: 20px;
    right: 25px;

    color: #fff;

    font-size: 35px;

    cursor: pointer;
}


/* =========================
   FOOTER
========================= */

footer {
    text-align: center;

    margin-top: 25px;

    padding-top: 15px;

    border-top:
        1px solid rgba(255,255,255,.15);
}

footer p {
    margin: 0 0 5px;

    font-size: 14px;
}

footer span {
    font-size: 10px;

    opacity: .55;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

    .app {
        padding:
            10px 7px 25px;
    }

    .hero h1 {
        font-size: 27px;
    }

    .book-wrapper {
        padding: 0 20px;
    }

    .book {
        height: 620px;
        min-height: 620px;
    }

    .page-btn {
        width: 34px;
        height: 34px;

        font-size: 27px;
    }

    .prev-btn {
        right: 0;
    }

    .next-btn {
        left: 0;
    }

    .product-card h3 {
        font-size: 20px;
        bottom: 150px;
    }

    .product-card .product-description {
        font-size: 11px;
        line-height: 1.8;
        bottom: 82px;
    }

    .product-card .product-price {
        font-size: 15px;
    }

    .pizza-price-line span {
        font-size: 12px;
    }

    .pizza-price-line strong {
        font-size: 15px;
    }

    .pizza-price-line small {
        font-size: 9px;
    }
}


/* =========================
   SMALL PHONES
========================= */

@media (max-width: 380px) {

    .book {
        height: 560px;
        min-height: 560px;
    }

    .product-card h3 {
        font-size: 18px;
        bottom: 150px;
    }

    .product-card .product-description {
        font-size: 10px;
        bottom: 82px;
    }

    .pizza-price-line {
        gap: 5px;
    }

    .pizza-price-line span {
        font-size: 11px;
    }

    .pizza-price-line strong {
        font-size: 14px;
    }
}
