/* ======================= 0. Global & Font Styles ======================= */
@font-face {
    font-family: IranSans;
    src: url('./fonts/IRANSansWeb.ttf');
    src: url('./fonts/IRANSansWeb.woff') format('woff'),
        url('./fonts/IRANSansWeb.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

* {
    padding: 0;
    margin: 0;
    font-family: IranSans, sans-serif;
    font-size: 10px;
    box-sizing: border-box;
    text-decoration: none;
}

:root {
    --primary-font: 'IranSans', sans-serif;
    --background-color: #121212;
    --card-bg: #1E1E1E;
    --text-color: #EAEAEA;
    --subtle-text-color: #c2c1c1;
    --accent-color: coral;
    --border-color: #2c2c2c;
    --dark-bg: #1a1a1a;
}

body {
    font-family: var(--primary-font);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.7;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 960px;
    margin: 45px auto;
}

/* ======================= 1. Landing Page Styles (Final Design) ======================= */
.hero-section {
    height: 100dvh;
    background-image: url('./images/header/coral-desktop-portrait.webp');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            transparent 10%,
            rgba(0, 0, 0, 0.9) 80%,
            rgba(0, 0, 0, 0.9) 100%);
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.hero-logo {
    display: block;
    width: 380px;
    max-width: 60%;
    height: auto;
    margin-bottom: 40px;
}

.hero-slogan {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-color);
    line-height: 1.8;
    max-width: 500px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-btn {
    padding: 15px 50px;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    font-size: 2.2rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-top: 50px;
}

.hero-btn:hover {
    background-color: #e58a5d;
    transform: scale(1.05);
}

/* ======================= 2. Sticky Social Toolbar & Copyright ======================= */
.sticky-toolbar {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 15px 0 0 15px;
    transition: all 0.3s ease;
}

.sticky-toolbar a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    color: var(--subtle-text-color);
    transition: all 0.3s ease;
}

.sticky-toolbar a:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

.sticky-toolbar i {
    font-size: 3rem;
}

.fixed-copyright {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    text-align: center;
    z-index: 10;
}

.fixed-copyright p,
.fixed-copyright .coral {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--subtle-text-color);
    text-shadow: 0 1px 2px #000;
}

.fixed-copyright .coral {
    color: coral;
}

/* ======================= 3. Menu App Layout (menu.html) ======================= */
.menu-app-body {
    padding-top: 70px;
    padding-bottom: 100px;
}

#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: var(--dark-bg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sticky-sub-categories {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 15px;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
}

.sticky-sub-categories::-webkit-scrollbar {
    display: none;
}

.sticky-sub-categories {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#bottom-bar {
    position: fixed;
    bottom: 20px;
    left: 15px;
    right: 15px;
    z-index: 100;
    height: 80px;
    background: coral;
    border-radius: 20px;
    border: 1px solid coral;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-around;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    color: var(--subtle-text-color);
    transition: color 0.3s ease;
}

.nav-item:hover {
    color: var(--text-color);
}

.nav-item.active {
    color: var(--accent-color);
}

.nav-item i {
    font-size: 2.8rem;
    margin-bottom: 4px;
    color: #000;
}

.nav-item span {
    font-size: 1.4rem;
    font-weight: 900;
    color: black;
}

/* ======================= 4. Shared Components (Categories & Menu Items) ======================= */
.category-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    width: 100px;
}

.category-item.active {
    border-color: var(--accent-color);
    background-color: #2a251e;
}

.category-item i {
    font-size: 2rem;
}

.category-item span {
    font-size: 1.5rem;
    color: var(--subtle-text-color);
}

.category-item.active span {
    color: var(--text-color);
}

.master-menu-list,
.menu-list {
    display: none;
}

.master-menu-list.active,
.menu-list.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.menu-list-item {
    display: flex;
    background-color: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.item-image {
    display: block;
    width: 120px;
    height: 120px;
    object-fit: cover;
}

.item-content {
    flex: 1;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.item-header {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.recpi {
    font-size: 1.4rem;
    color: var(--subtle-text-color);
}

.item-price-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.item-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
}

.details-btn {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 5px;
    padding: 5px 15px;
    font-size: 1.4rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.details-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

/* ======================= 5. Details Modal Styles ======================= */
.modal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.modal-content {
    position: relative;
    background-color: var(--card-bg);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-width: 90%;
    max-height: 85dvh;
    width: 500px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    overflow: hidden;
}

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

.modal-content img#modalImage {
    width: 100%;
    height: 250px;
    object-fit: cover;
    flex-shrink: 0;
}

.modal-details {
    padding: 20px 25px;
    text-align: right;
    overflow-y: auto;
}

.modal-details::-webkit-scrollbar {
    display: none;
}

.modal-details {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#modalTitle {
    font-size: 2.2rem;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 20px;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section h4 {
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

.modal-section p {
    font-size: 1.5rem;
    color: var(--subtle-text-color);
    line-height: 1.7;
}

#modalDescriptionContainer.hidden {
    display: none;
}

.modal-price-footer {
    text-align: left;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 1001;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}

.close-btn:hover {
    transform: scale(1.1);
}

/* ======================= 6. Sold Out Styles ======================= */
.menu-list-item.sold-out {
    opacity: 0.5;
    background-color: #1a1a1a;
    cursor: not-allowed;
}

.menu-list-item.sold-out .item-image {
    filter: grayscale(100%);
}

.menu-list-item.sold-out .details-btn {
    display: none;
}

.menu-list-item.sold-out .item-price-wrapper {
    position: relative;
    overflow: hidden;
}

.menu-list-item.sold-out .item-price-wrapper::after {
    content: 'تمام شد';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: #c0392b;
    color: white;
    padding: 3px 10px;
    font-size: 1.4rem;
    font-weight: bold;
    border-radius: 5px;
}

.menu-list-item.sold-out .item-price {
    visibility: hidden;
}

/* ======================= 7. Media Queries (Final) ======================= */
@media (max-width: 767px) {
    .hero-logo {
        max-width: 100%;

    }

    .hero-slogan {
        font-size: 1.6rem;
        max-width: 90%;
    }

    .hero-btn {
        font-size: 1.8rem;
        padding: 12px 40px;
    }

    .sticky-toolbar {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        flex-direction: row;
        justify-content: space-around;
        padding: 5px;
        background-color: rgba(0, 0, 0, 0.6);
        border-radius: 0;
    }

    .fixed-copyright {
        bottom: 55px;
        background: none;
    }
}

@media (min-width: 768px) {
    .modal-content {
        width: 650px;
        max-height: 80dvh;
    }

    .modal-content img#modalImage {
        height: 320px;
    }

    .modal-details {
        padding: 25px 35px;
    }

    #modalTitle {
        font-size: 2.6rem;
    }

    .modal-section p {
        font-size: 1.7rem;
    }
}

@media (max-width: 375px) {
    
    .hero-slogan {
        font-size: 1.4rem;
    }

    .hero-btn {
        font-size: 1.6rem;
        padding: 12px 40px;
    }

    #bottom-bar {
        left: 10px;
        right: 10px;
        bottom: 15px;
        height: 60px;
        border-radius: 15px;
    }

    .nav-item i {
        font-size: 2.0rem;
    }

    .nav-item span {
        font-size: 1.1rem;
    }

    .menu-app-body {
        padding-top: 60px;
        padding-bottom: 90px;
    }

    .item-image {
        width: 100px;
        height: 100px;
    }

    .item-header {
        font-size: 1.7rem;
    }

    .recpi {
        font-size: 1.3rem;
    }

    .item-price {
        font-size: 1.7rem;
    }

    .details-btn {
        font-size: 1.3rem;
        padding: 4px 12px;
    }
}