/* پایه */
.container{
    max-width: 100vw;
    margin: 0 auto;
    padding: 0;
}

html{
    box-sizing: border-box;
    scroll-behavior: smooth;
}
*, *::before, *::after{
    box-sizing: inherit;
    margin: 0;
    padding: 0;
}

body{
    font-family: "Abol", monospace;
    background-color: black;
    scroll-behavior: smooth;
    /* background-image: linear-gradient(to top, #212121, #2632386f); */
    background: url("../imgs/background/back.png") repeat center scroll;
    /* background-size: cover; */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Header */
.header{
    margin: 0 auto;
    width: 100%;
}
.nav-container{
    width: 100%;
    display: flex;
    justify-content: center;
}
.nav{
    width: 60%;
    position: relative;
    left: -3%;
    border-radius: 4rem;
    height: 4.2rem;
    background-color: #2121215b;
    margin: 2rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);

}

.nav-icon{
    width: 4rem;
    height: 4rem;
    background-image: linear-gradient(90deg, #B71C1C, black);
    border-radius: 50%;
    position: absolute;
    right: 0.1rem;
    cursor: pointer;
}
.nav__logo{
    width: 100%;
    height: 100%;
    border-radius: 100%;
}
.nav-name{
    letter-spacing: 1rem;
    color: white;
    text-align: center;
    text-shadow: 2px 2px 10px #ffffff92;
}
/* back button */

.back__link{
    position: fixed;
    border-radius: 100%;
    z-index: 100000;
    width: auto;
    height: auto;
    display: none;
}
.back__img{
    width: 4rem;
    height: 4rem;
    background-color: rgb(255, 255, 255);
    border-radius: 100%;
    display: none;
}
/* Main */
.main{
    max-width: 100%;
    display: flex;
    justify-content: flex-start;
    position: relative;
    margin-top: 3rem;
    margin-right: auto;
    gap: 1rem;
    direction: rtl;
}

.container-section{
    display: flex;
    flex-direction: column;
    align-content: center;
    color: white;
    direction: rtl;
    gap: 1.3rem;
        text-shadow:
        0 0 3px black,
        0 0 6px black,
        0 0 9px black;
}

/* section */
.section-title{
    margin-left: 3vw;
    text-align: center;
    font-size: 3rem;
}

.item-section{

    border-top: #ffffff 3px solid;
    border-radius: 4rem 0 0 0;
}


/* Item container */
.item-container{
    flex: 1;
    display: flex;
    justify-content: center;
}

.item-box-container{
    width: 67.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.5rem;
}

.item-box{
    width:15rem;
    height:20rem;
    border: 1px solid rgb(255, 255, 255);
    background-color: #3737372f;
    border-radius: 2rem;
}

/* Sidebar */
.side-bar{
    width: 4.5rem;
    background-color: #b6b6b66c;
    backdrop-filter: blur(5px);
    border: #4b4b4b 4px solid !important;
    border-radius: 1rem;
    padding: 1rem 0;
    position: sticky;
    top: 17.5rem;
    max-height: 50vh;
    overflow-y: auto;
    scrollbar-width: none;  
    mask-image: linear-gradient(to bottom, rgba(35, 3, 3, 0.705) 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(35, 3, 3, 1) 90%, transparent 100%);

}

.side-bar-container{

    display: flex;
    flex-direction: column;
    gap: 1.5rem;

}
.side-bar-item{
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-side-bar{
    width: 2rem;
}


/* card desing */

.item-box{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(5px);
}
.item-box__img{
    width: 100%;
    height: 75%;
    background: url("../img/coffee-card/milkshake-shokolat.jpg") no-repeat bottom;
    background-size: cover;
    /* border-radius: 2rem; */
}
.item-box__description{
    width: 100%;
    height: 25%;
}
.description__food-title{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    line-height: 1rem;
    margin-top: 5%;
    
}
.food-title__top{
    color: white;
}
.food-title__sub{
    color: rgb(150, 150, 150);
    font-size: 0.5rem;
}
.box-description__price{
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgb(184, 184, 184);
    margin-top: 5%;
    padding: 0 10% 2% 10%;
    background-color: rgba(55, 55, 55, 0.634);
    backdrop-filter: blur(15px);
    border: 1px solid white;
}
.price__price{

}
.price__currency{

}


@media (max-width: 1200px) {
    .container{
        /* max-width:60rem; */
    }
    .side-bar{
        top: 17.5rem;
    }
    .item-container{

    }
    .item-box-container{
        width: 51.5rem;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    .item-box{

        width: 15rem;
        height: 20rem;

    }


}


@media (max-width: 992px) {

    .nav{
        transform: translateX(0.8rem);
    }
    .item-box-container{
        width: 40rem;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    .item-box{

        width: 11.25rem;
        height: 15rem;

    }
    .side-bar{
        top: 17.5rem;
    }

    .description__food-title{
        line-height: 0.9rem;
    }
    .food-title__top{
        font-size: 0.8rem;
    }
    .food-title__sub{
        font-size: 0.5rem;
    }
    .box-description__price{
        font-size: 0.5rem;
        justify-content: center;
        gap: 0.5rem;
        
    }
    
}


@media (max-width: 768px) {

    .nav{
        transform: translateX(-1rem);
    }

    .section-title{

        font-size: 2.5rem;

    }

    .item-box-container{
        width: 27.1rem;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    .side-bar{

        top: 16.8rem;

    }
    .item-box{

        width: 11.25rem;
        height: 15rem;
        border-radius: 1.8rem;

    }
    .nav-name{
        letter-spacing: 0.5rem;

    }
}


@media (max-width: 600px) {


    .nav{
        width: 100vw;
        padding: 0 2rem;
        left: -2.3rem;
        border-radius: 0%;
        transform: translateX(2.3rem);

    }
    .nav-icon{
        display: none;
    }
    .nav-name{
        word-spacing: 0.5rem;
        position: relative;
    }
    .back__link{
        display: block;
        bottom: 0.5rem;
        right: 0.5rem;
    }
    .back__img{
        display: block;
    }
    .section-title{
        font-size: 2rem;
    }
    .item-container{
        
    }
    .item-box-container{
        width: 23rem;
        gap: 0.5rem;
        padding: 0.5rem;
        
    }
    .item-box{

        width: 10.5rem;
        height: 14rem;
        border-radius: 1.5rem;

    }
    .side-bar{
        width: 3.5rem;
        top: 15.8rem;
        max-height: 40vh;
        gap: 1rem;
    }
    .box-description__price{
        margin-top: 2%;
        padding-top: 1%;
    }
}


@media (max-width: 488px) {

    .item-box-container{
        width: 20rem;
        gap: 1rem;
        padding: 1rem;
        /* justify-content: space-around; */
    }
    .section-title{
        font-size: 1.8rem;
    }
    .item-box{

        width: 8.5rem;
        height: 12rem;
        border-radius: 1.3rem;
    }
    .item-box__img{
        height: 65%;
    }
    .item-box__description{
        height: 35%;
    }
    .side-bar{
        top: 16.5rem;
        height: 50vh;
    }

}


@media (max-width: 400px) { 

    .back__img{
        width: 3.7rem;
        height: 3.7rem;
    }
    .main{
        gap: 0.5rem;
    }

    .section-title{
        font-size: 1.5rem;
    }
    .item-section{
        border-radius: 2rem 0 0 0;
    }
    .side-bar{
        width: 3rem;
        border-radius: 0.8rem;
        top: 15rem;
        /* height: ; */
    }
    .side-bar-container{
        gap: 0.5rem;
    }
    .icon-side-bar{
        width: 1.8rem;
    }
    .item-box-container{
        width: 18rem;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    .item-box{
        width: 8rem;
        height: 11.5rem;
        border-radius: 0.8rem;
    }
    .food-title__sub{
        display: none;
    }
    .box-description__price{
        font-size: 0.7rem;
        margin-top: 7%;
        padding: 5% 15% 6%;
    }
    item-box__name{
        font-size:6.5rem;
    }
}

@media (max-width:350px){
    .back__img{
        width: 3.4rem;
        height: 3.4rem;
    }
    .side-bar{
        height: 34vh;
    }
    .section-title{
        font-size: 1.2rem;
    }
    .icon-side-bar{
        width: 1.5rem;
    }
    .side-bar-container{
        gap: 0.6rem;
    }
    .item-box-container{
        width: 16rem;
        gap: 0.2rem;
        padding: 0.2rem;
    }
    .item-box{
        width: 7.5rem;
        height: 10.5rem;

    }
    .box-description__price{
        gap: 0.1rem;
    }

}

@media(max-height:500px){
    .main{
        flex-direction: column-reverse;
    }
    .side-bar{
        top: 83vh;
        width: 50vw;
        left: 25vw;
        padding: 0.2rem 0.5rem;
        mask-image: none;
    -webkit-mask-image: none;
    }
    .side-bar-container{
        flex-direction: row;
    }
}

/* =====================================================
   استایل‌های داینامیک - کارت Flip
   ===================================================== */

/* کارت Flip - کل کارت فلیپ می‌شود */
.flip-card {
    perspective: 1000px;
    cursor: pointer;
    background: transparent !important;
    border: none !important;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    border-radius: 2rem;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 2rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* روی کارت - رنگ‌های خنثی */
.flip-card-front {
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, #2a2a2a, #1a1a1a);

}

.item-box__img-wrapper {
    width: 100%;
    height: 70%;
    position: relative;
    /*overflow: hidden;*/
    background: #333;
    padding:0.2rem;
}

.item-box__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 2rem;
}

/* Placeholder برای تصاویر */
.item-box__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    color: rgba(255, 255, 255, 0.3);
}

.item-box__placeholder-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.item-box__placeholder-text {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.flip-card:not(.flipped):hover .item-box__img {
    transform: scale(1.11);
}

.item-box__info {
    width: 100%;
    height: 30%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.85);
}

.item-box__name {
    font-size: 1rem;
    font-weight: bold;
    color: #ffffff;
    text-align: center;
    margin-bottom: 0.25rem;
}

.item-box__price {

    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #e0e0e0;
}

.price__value {
    font-size: 1rem;
    font-weight: bold;
}

.price__currency {
    font-size: 0.75rem;
    opacity: 0.8;
    display:none;
}

/* پشت کارت - رنگ‌های خنثی */
.flip-card-back {
    transform: rotateY(180deg);
    background: linear-gradient(145deg, #3a3a3a 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
}

.back-content {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    gap: 1rem;

}

.back-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffffff;
    margin: 0;
}

.back-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin: 0;
    padding: 0 0.5rem;
}

.back-price {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.1);
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-content: center;
}

.back-price .price__value {
    font-size: 1.3rem;
    
}

.back-price .price__currency {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* نشانگر ناموجود */
.item-box__badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(80, 80, 80, 0.95);
    color: white;
    padding: 0.3rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 10;
}

.item-box.unavailable {
    opacity: 0.6;
}

.item-box.unavailable .item-box__img {
    filter: grayscale(70%);
}

/* حالت بارگذاری */
.loading-spinner {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.7);
    gap: 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #B71C1C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* پیام خطا */
.error-message {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.8);
    gap: 1rem;
    text-align: center;
}

.error-icon {
    font-size: 3rem;
}

.retry-btn {
    background: #B71C1C;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.retry-btn:hover {
    background: #D32F2F;
}

/* محصولی یافت نشد */
.no-products {
    width: 100%;
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
}

/* انیمیشن fade-in برای کارت‌ها */
.fade-in {
    animation: fadeIn 0.4s ease forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ریسپانسیو برای کارت‌های Flip */
@media (max-width: 992px) {
    .flip-card-inner {
        border-radius: 1.8rem;
    }
    
    .flip-card-front,
    .flip-card-back {
        border-radius: 1.8rem;
    }
    
    .item-box__name {
        font-size: 0.9rem;
    }
    
    .back-title {
        font-size: 1rem;
    }
    
    .back-description {
        font-size: 0.75rem;
    }
    
    .item-box__placeholder-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .flip-card-inner,
    .flip-card-front,
    .flip-card-back {
        border-radius: 1.5rem;
    }
    
    .item-box__name {
        font-size: 0.85rem;
    }
    
    .price__value {
        font-size: 0.9rem;
    }
    
    .item-box__badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
    
    .back-title {
        font-size: 0.95rem;
    }
    
    .back-description {
        font-size: 0.7rem;
    }
    
    .back-price .price__value {
        font-size: 0.95rem;
    }
    
    .item-box__placeholder-icon {
        font-size: 2rem;
    }
    
    .item-box__placeholder-text {
        font-size: 0.6rem;
    }
}

@media (max-width: 488px) {
    .flip-card-inner,
    .flip-card-front,
    .flip-card-back {
        border-radius: 1.3rem;
    }
    
    .item-box__img-wrapper {
        height: 65%;
    }
    
    .item-box__info {
        height: 35%;
        padding: 0.3rem;
    }
    
    .item-box__name {
        font-size: 0.75rem;
    }
    
    .price__value {
        font-size: 0.8rem;
    }
    
    .price__currency {
        font-size: 0.6rem;
    }
    
    .back-content {
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .back-title {
        font-size: 0.85rem;
    }
    
    .back-description {
        font-size: 0.65rem;
    }
    
    .back-price {
        padding: 0.3rem 0.75rem;
    }
    
    .back-price .price__value {
        font-size: 0.85rem;
    }
    
    .item-box__placeholder-icon {
        font-size: 1.5rem;
    }
    
    .item-box__placeholder-text {
        font-size: 0.5rem;
    }
}

@media (max-width: 400px) {
    .flip-card-inner,
    .flip-card-front,
    .flip-card-back {
        border-radius: 0.8rem;
    }
    
    .item-box__name {
        font-size: 0.7rem;
    }
    
    .price__value {
        font-size: 0.7rem;
    }
    
    .back-title {
        font-size: 0.75rem;
    }
    
    .back-description {
        font-size: 0.6rem;
    }
}