@font-face {
    font-family: 'Vazirmatn';
    src: url('/assets/fonts/Vazirmatn[wght].woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn FD';
    src: url('/assets/fonts/Vazirmatn-FD-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


:root {
    --primary-text-color: #000;
    --secondary-text-color: #3b3b3b;
    --primary-color: #f08c00;
    --secondary-color: #fff;
    --background-color: #f1f0f0;
    --border-color: #d5d5d5;
    --transition-duration: 0.3s;
    --transparent-color: rgba(255, 255, 255, 0.9);
}

body.dark {
    --primary-text-color: #fff;
    --secondary-text-color: #c1c1c1;
    --secondary-color: rgb(29, 29, 29);
    --background-color: #000;
    --border-color: #535353;
    --transparent-color: rgba(0, 0, 0, 0.5);
}


body {
    background-color: var(--background-color);
    color: var(--primary-text-color);
    font-family: Vazirmatn, Arial, sans-serif!important;
    font-feature-settings: "lnum" 0, "tnum" 0;
    font-weight: 400!important;
}

html[lang="fa"] {
    direction: rtl;
}

html[lang="fa"] .number {
    font-family: Vazirmatn FD, Arial, sans-serif!important;
}

button {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--primary-color);
    padding-inline: 24px;
    padding-block: 10px;
    border-radius: .25rem;
    width: fit-content;
}

button:hover {
    box-shadow: 0 0 8px var(--primary-color);
}

/* Loading */

@keyframes load {
    0% {
        opacity: 0.08;
        filter: blur(5px);
        letter-spacing: 3px;
    }

    60% {
        opacity: 1;
        filter: blur(0);
        letter-spacing: 1px;
    }

    100% {
        opacity: 1;
        filter: blur(0);
        letter-spacing: 1px;
    }
}

.animate {
    margin-top: 20px;
    font-size: 40px;
    animation: load 1.2s infinite 0s ease-in-out;
    animation-direction: alternate;
    text-shadow: 0 0 1px white;
}

.loading {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 1);
    color: white;
    z-index: 201;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.7s;
}

.loading>img {
    max-width: 300px;
    max-height: 300px;
}

.loading>p {
    margin-top: 10px;
    font-size: 20px;
    text-shadow: 0 0 1px white;
    opacity: 0.3;
}

/* Categories */

.categories-head, header {
    background-color: var(--secondary-color);
}

.categories-head {
    top: 66px;
    width: 100%;
    z-index: 101 !important;
    position: sticky;
}

#categories {
    display: flex;
    text-wrap: nowrap;
    font-size: 0.875rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    color: var(--secondary-text-color);
}

#categories::-webkit-scrollbar {
    display: none;
}

.category {
    height: 5.8rem;
}

.category img {
    max-width: none!important;
}

.category.active {
    border-bottom-width: 2px;
    border-color: var(--primary-color);
    transform: translateY(-4px) scale(1.1);
}

.category.active .category-title {
    color: var(--primary-color);
}

.category:hover {
    transform: translateY(-4px) scale(1.1);
} 

main .item {
    cursor: pointer;
    border-bottom: var(--border-color) 1px solid;
}

main .item:hover { 
    background-color: var(--secondary-color);
}

main .item.unavailable {
    cursor: unset;
}

main .item.unavailable:hover { 
    background-color: unset;
}

main .item.unavailable>div:last-of-type::after {
    content: "Unavailable";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    color: var(--primary-text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    opacity: 0.7;
}

html[lang="fa"] main .item.unavailable>div:last-of-type::after {
    content: "ناموجود";
}

.item > div:first-of-type {
    padding-inline-end: .75rem;
}

main .item > div:first-of-type {
    width: 66.666667%;
}

main .item > div:last-of-type {
    width: 33.333333%;
}

.item-description {
    color: var(--secondary-text-color);
}

.item .item-photo {
    width: 100%;
}

/* Modal */

.modal {
    z-index: 999;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
}

.modal-background {
    background-color: var(--background-color);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.modal.show .modal-background {
    opacity: 1;
}

.modal-content {
    width: 100%;
    flex-grow: 1;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-content .item {
    height: 100%;
    width: 100%;
    flex-direction: column-reverse;
    justify-content: space-between;
    font-size: larger;
    border: none;
}

.modal-content .item > div {
    width: 100%;
    padding: 0;
    margin-block: 20px;
}

.modal-close { 
    margin-top: 10px;
    align-self: end;
    font-size: smaller;
}

.modal-close span {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close span::before {
    content: "➜";
    margin-inline-end: 10px;
    margin-top: 2px;
}


@media (min-width: 1024px) {
    .modal-background {
        backdrop-filter: blur(12px);
        background-color: var(--transparent-color);
    }

    .modal-content {
        height: unset;
        padding-inline: 30px;
        max-width: 80%;
        max-height: 50%;
    }

    .modal-content>div {
        border: var(--border-color) 1px solid !important;
    }

    .modal-content .item {
        height: unset;
        flex-direction: row-reverse;
        border-bottom: var(--border-color) 1px solid;
    }
    
    .modal-content .item > div:first-of-type {
        padding-inline-start: 8%;
    }

    .modal-content .item > div:last-of-type {
        padding-inline-start: 5%;
    }
    
    .modal-content .item .item-photo {
        scale: 140%;
    }

    .modal-content .item > div:first-of-type {
        width: 66.666667%;
    }
    
    .modal-content .item > div:last-of-type {
        width: 33.333333%;
    }
}

/* Lazy image loader */

.skeleton-loader {
    width: 100%;
    aspect-ratio: 1/1;
    background: #e0e0e0;
    animation: pulse 1.5s infinite;
}
  
.image {
    opacity: 0;
    transition: opacity 0.3s ease;
    width: 100%;
    height: auto;
}

.image.loaded {
    opacity: 1;
}

.skeleton-loader:has(.image.loaded) {
    background: none;
    animation: unset;
}

@keyframes pulse {
    0% { background-color: #e0e0e0; }
    50% { background-color: #f0f0f0; }
    100% { background-color: #e0e0e0; }
}



.btn>.icon {
    height: 24px;
    width: 24px;
    opacity: 0.75;
    cursor: pointer;
}

.btn.icon:hover {
    opacity: 1;
}

body.dark .icon {
    filter: invert(1);
}

.border-b {
    border-bottom: var(--border-color) 1px solid!important;
}

.badge {
    display: flex;
    align-items: center;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    border-radius: 0.27rem;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    background-color: var(--secondary-color);;
    color: var(--primary-text-color);
}

.badge > img {
    max-width: 1.5em;
    margin-inline-end: 0.35em;
}

/* Overlay loading */

#loading {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 1);
    color: white;
    z-index: 201;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.7s;
}

#loading>img {
    max-width: 300px;
    max-height: 300px;
}

#loading>p {
    margin-top: 10px;
    font-size: 20px;
    text-shadow: 0 0 1px white;
    opacity: 0.3;
}


header>div>div:first-child {
    margin-inline-end: 15px;
}

/* Header */

header {
    top: 0;
    z-index: 102 !important;
}


/* scroll to top */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 200;
}

.scroll-to-top.show {
    display: flex;
}

.scroll-to-top img {
    width: 20px;
}



/* Login */
.login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--background-color);
}

.login-card {
    width: 100%;
    max-width: 24rem;
    padding: 2rem;
    margin: 2rem;
}

.login-card input {
    background-color: rgba(0, 0, 0, 0);
    color: var(--primary-text-color);
    border: 1px solid var(--secondary-text-color);
    border-radius: 0 !important;
    padding: 0.2rem 0.5rem;
}