/* ۱ – ارتفاع واقعی صفحه در همه دستگاه‌ها (مهم‌ترین خط دنیا!) */
html,
body {
    margin: 0;
    padding: 0;
    height: 100dvh;
    overflow-x: hidden;
}

/* ۲ – viewport: کل صفحه رو می‌گیره و یک لایه ثابت می‌سازه */
#viewport {
    position: fixed;
    inset: 0;
    /* top:0; left:0; right:0; bottom:0; */
    /* اگر منوهای modal داری بعداً auto می‌کنی */
    pointer-events: none;
    /* تا کلیک روی پس‌زمینه مشکلی ایجاد نکنه */
}

/* =========================================== */
/* Fonts & Imports */
/* =========================================== */

@font-face {
    font-family: 'Mont Heavy';
    src: url('fonts/Mont-Heavy.woff2') format('woff2'),
        url('fonts/Mont-Heavy.woff') format('woff'),
        url('Mont-HeavyDEMO.otf') format('opentype');
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Mont-ExtraLight';
    src: url('fonts/Mont-ExtraLight.woff2') format('woff2'),
        url('fonts/Mont-ExtraLight.woff') format('woff'),
        url('Mont-ExtraLightDEMO.otf') format('opentype');
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'KalamehWebFaNum';
    src: url('fonts/KalamehWebFaNum.woff2') format('woff2');
    font-style: normal;
    font-display: swap;
}

/* =========================================== */
/* CSS Variables & Theme */
/* =========================================== */

:root {
    /* Color palette */
    --background-image: url('01.webp');
    /* تصویر اصلی با کیفیت بالا */
    --primary-color: #000000;
    --secondary-color: #302e2d;
    --accent-color: #000000;
    --background-color: #808080;
    --card-bg: #FFFFFF;
    --text-color: #2C3E50;
    --text-light: #7F8C8D;
    --border-color: #E8E8E8;

    /* Visual effects */
    --btn-bg: rgba(0, 0, 0, 0.8);

}

/* Set base font size on html element for rem scaling */
html {
    min-height: 100vh
}

/* ۳ – scale-root: جایی که همه چیز داخلش وسط و ریسپانسیو می‌مونه */
#scale-root {
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* اگر می‌خوای کمی پایین‌تر باشه → flex-start + padding-top */
    gap: clamp(0.01rem, 1vw, 2rem);
    /* فاصله بین دکمه‌ها و المان‌ها */

    pointer-events: auto;
    /* فقط اینجا کلیک فعال باشه */
}

/* اگر می‌خوای محتوا کمی پایین‌تر از دقیق وسط باشه (مثل قبل) */
#scale-root {
    justify-content: flex-start;
    padding-top: clamp(6vh, 65vh, 130vh);
    /* ≈ 160–280px بسته به صفحه */
}



/* =========================================== */
/* Responsive Typography */
/* =========================================== */


/* Responsive background images */
body {
    background-image: url('01.webp');
}

@media (max-width: 1024px) {
    body {
        background-image: url('01-small.webp');
    }
}

/* =========================================== */
/* Reset & Base Styles */
/* =========================================== */

* {
    margin: 0;
    box-sizing: border-box;
}

body {
    font-size: 2rem;
    line-height: 1.4;
    min-height: 100vh;
    max-width: none;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    background-image: var(--background-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Lazy loading for background images */
    content-visibility: auto;
    contain-intrinsic-size: 1200px 800px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100vw;
}

/* مخفی کردن کل وب‌اپ روی دسکتاپ */
@media (min-width: 950px) {
    body {
        display: none;
    }
}

/* =========================================== */
/* Layout & Sections */
/* =========================================== */

main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    gap: 0;
    padding: 0;
    position: relative;
    margin-top: 0;
    z-index: 15;
    height: 100%;
    width: 100%;
}

header {
    align-items: center;
    text-align: center;
    justify-content: center;
    margin-bottom: 0;
    padding: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* =========================================== */
/* Responsive Button System */
/* =========================================== */

/* Base button styles for all buttons */
.btn-base,
#menuBtn,
.instagram-link,
.contact-link {
    font-family: 'Mont Heavy', sans-serif;
    color: white;
    background: rgba(0, 0, 0, 0.95);
    border: none;
    border-radius: clamp(12px, 2.5vw, 16px);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-decoration: none;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    margin: 0.1rem 0;
    /* فاصله عمودی بین دکمه‌ها */
    width: 70vw;
    height: 7vh;
}

/* =========================================== */
/* Main Menu Button (#menuBtn) */
/* =========================================== */


#menuBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    border-radius: inherit;
    z-index: 100;
    opacity: 0;
}

/* Main Menu Button (#menuBtn) - Increased font size for better visibility */
#menuBtn {
    font-size: 2.5rem;
}


	.menu-footer .footer-btn {
    background: var(--primary-color);
    color: #ffffff;
    font-family: 'Mont Heavy', sans-serif ;
    border: none;
    padding: clamp(4px, 3vw, 6px) clamp(8px, 3vw, 10px);
    font-size: clamp(1.2rem, 7vw, 2rem);
    cursor: pointer;
    flex: 100;
    margin: 0 clamp(30px, 5vw, 45px) 10%;
    border-radius: clamp(4px, 1.2vw, 6px);
}


/* =========================================== */
/* Menu Page Buttons (.menu-page-btn) */
/* =========================================== */
.menu-page-btn {
    color: white;
    background-color: #000000;
    border-radius: clamp(8px, 2vw, 10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: 'Mont Heavy', sans-serif;
    font-size: clamp(0.3rem, 7.7vw, 5rem);
    display: inline-block;
    text-align: center;
    width: 100%;
    align-items: center;
    justify-content: center;
}




/* =========================================== */
/* Menu Footer Container (.menu-footer) */
/* =========================================== */

.menu-footer {
    position: fixed;
    bottom: clamp(10px, 4vw, 20px);
    left: clamp(10px, 2vw, 20px);
    right: clamp(10px, 2vw, 20px);
    display: flex;
    justify-content: space-between;
    padding: clamp(10px, 2vw, 20px);
    background: transparent;
    z-index: 1000;
}

/* =========================================== */
/* Container Layouts */
/* =========================================== */

.button-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: clamp(6px, 1.5vw, 8px);
    padding: clamp(0.8rem, 2vw, 1rem);
    width: 100%;
    margin: clamp(3vh, 6vw, 4vh) 0 0 0;
    z-index: 10;
    flex-wrap: wrap;
    text-align: center;
}



/* =========================================== */
/* Menu Page Container */
/* =========================================== */

.menu-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    padding: 0;
    margin: 0;
    z-index: 2000;
    min-width: 100vw;
    min-height: 100vh;
    overflow: hidden;
    background-size: cover;
}

.menu-page-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--background-color);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    content-visibility: auto;
    contain-intrinsic-size: 1200px 800px;
    z-index: 2000;
    padding: 0;
    margin: 0;
}

.menu-page-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* وسط افقی */
    justify-content: center;
    /* وسط عمودی */
    gap: clamp(8px, 2vw, 16px);

    position: static;
    top: auto;
    left: auto;
    width: 100vw;
    height: 100vh;

    background: transparent;
    border-radius: 0;
    border: none;
}

.menu-page-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #ffffff;
    font-size: 2.2rem;
    padding-bottom: 0.5rem;
    font-family: 'Mont Heavy', Arial, sans-serif;
}

.menu-page-buttons {
    display: flex;
    flex-direction: column;
    gap: clamp(3px, 0.3vw, 35px);
    justify-content: center;
    margin-bottom: 5rem;
}

/* =========================================== */
/* Menu Title & Content */
/* =========================================== */

.menu-items {
    height: inherit;
    margin-top: 10%;
    height: 77%;
    overflow-y: auto;
    overflow-x: hidden;
}

.menu-item {
    text-align: center;
    display: flex;
    justify-content: space-between;
    /* اسم و قیمت در دو سمت جدا */
    align-items: center;
    width: 100%;
    /* کل عرض کانتینر */
    padding: 0.01rem 0.01rem;
    /* فاصله داخلی */
}

.item-name {
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    font-family: 'KalamehWebFaNum', sans-serif;
    color: #000000;
    white-space: nowrap;
    margin-right: 3.5rem;
}

.item-price {
    font-family: 'KalamehWebFaNum', sans-serif;
    font-size: clamp(0.9rem, 1.4vw, 1rem);
    color: #000;
    text-align: left;
    /* قیمت چپ‌چین در سمت راست */
    margin-left: 3.5rem;
}

/* دکمه Full Menu با رنگ متمایز */
.all-menu-btn {
    background: linear-gradient(135deg, #c82534 0%, #a01d28 100%) !important;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(200, 37, 52, 0.3);
}

.all-menu-btn:hover,
.all-menu-btn:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 37, 52, 0.4);
}
/* =========================================== */
/* Category Header Targeting System */
/* =========================================== */



.menu-category {
    margin-bottom: 60px;
    scroll-margin-top: 20px;   /* برای وقتی که بعداً بخوای لینک مستقیم بدی */
}

/* Base category header styles - inherited by all categories */
.category-header {
    text-align: left;
    /* المنت inline-block را وسط قرار می‌دهد */

    font-family: 'Mont Heavy';
    font-size: clamp(2rem, 7vw, 3.5rem);
    color: #000000;
    margin-top: 4rem;
    margin-left: 3rem;
}

.new-at-e1-header {
    color: #c82534;
}
.granola-special {
    font-size: clamp(1rem, 6.5vw, 3rem);
}

/* =========================================== */
/* NEW at E1 & Subheaders */
/* =========================================== */



.category-subheader {
    font-family: 'KalamehWebFaNum', sans-serif;
    font-size: 1rem;
    color: #ffffff;

    background: #000000;
    display: inline-block;
    /* اندازه دقیق متن */
    padding: 0.02rem 0.1rem;
    /* فاصله داخلی */
    line-height: 1.4;
    border-radius: 0.35rem;
    white-space: nowrap;
    margin: 0rem 1rem;
    margin-right: 13%;
}


.cafe-title-container {
    position: fixed;
    z-index: 10;
    width: clamp(300px, 85vw, 1900px);
    height: clamp(400px, 60vw, 1450px);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 1;
    pointer-events: none;
    top: calc(100vh / 2 - 28vh);
}

.decorative-title-container {
    position: fixed;
    left: 50%;
    /* وسط افقی */
    bottom: clamp(5vh, 27%, 60vh);
    /* فاصله کاملاً ریسپانسیو از پایین */
    transform: translateX(-50%);
    /* تصحیح دقیق وسط افقی */

    z-index: 9;
    pointer-events: none;

    width: clamp(260px, 78vw, 500px);
    height: clamp(60px, 48vh, 200px);

    display: flex;
    justify-content: center;
    align-items: center;
}


/* =========================================== */
/* Menu Header SVG Styles */
/* =========================================== */

.menu-header {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
    top: 0%;
}

.main-svg-container {
    position: fixed;
    top: 290px;
    /* دقیقاً 300px از بالای صفحه */
    left: 20px;
    /* دقیقاً 20px از لبه چپ صفحه */
    z-index: 5;

    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: clamp(5px, 40vw, 800px);
}

/* =========================================== */
/* Hamburger Menu red */
/* =========================================== */


/* Simplified Hamburger Main Button Styles */
.hamburger-main-container {
    width: 50vw;
    position: absolute;
    bottom: 40px;
    z-index: 1000;
    left: 30px;
}

.hamburger-main-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 50%;
}

.hamburger-icon {
    width: 40px;
    height: 40px;
    fill: #c82534;
}

/* Responsive adjustments for hamburger */
@media (max-width: 768px) {
    .hamburger-menu-container {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .hamburger-menu-container {
        width: 60px;
        height: 60px;
        top: 50px;
        
    }
}



/* High DPI/Retina display optimizations for backgrounds */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    :root {
        --background-image: url('01.webp');
        /* یا 01.webp اگر بهینه‌ست */
    }

    .menu-container,
    .menu-page-container {
        background-image: var(--background-image);
    }
}

/* =========================================== */
/* Z-index management & Container constraints */
/* =========================================== */

.menu-container {
    z-index: 2000;
}

.menu-page-container {
    z-index: 2000;
}

.cafe-title-container {
    z-index: 10;
}

.decorative-title-container {
    z-index: 9;
}

.footer-svg-container {
    z-index: 7;
}

.menu-button-container,
.instagram-container,
.contact-container {
    z-index: 10;
}

main {
    z-index: 15;
    position: relative;
}

/* Hide SVG elements in menu contexts */
.menu-container .cafe-title-container,
.menu-page-container .cafe-title-container,
.menu-container .decorative-title-container,
.menu-page-container .decorative-title-container,
.menu-container .footer-svg-container,
.menu-page-container .footer-svg-container {
    display: none;
}

/* Container constraints */
.menu-container,
.menu-page-container {
    min-width: 100vw;
    min-height: 100vh;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* =========================================== */
/* Safe area support */
/* =========================================== */

@supports(padding: max(0px)) {
    body {
        padding-left: max(clamp(15px, 3vw, 20px), env(safe-area-inset-left));
        padding-right: max(clamp(15px, 3vw, 20px), env(safe-area-inset-right));
        padding-top: max(clamp(15px, 3vw, 20px), env(safe-area-inset-top));
        padding-bottom: max(clamp(15px, 3vw, 20px), env(safe-area-inset-bottom));
    }

    .button-container {
        padding-left: max(clamp(0.8rem, 2vw, 1rem), env(safe-area-inset-left));
        padding-right: max(clamp(0.8rem, 2vw, 1rem), env(safe-area-inset-right));
    }
}

.opening-hours {
    font-family: 'Mont-ExtraLight', sans-serif;
    font-size: clamp(1.1rem, 3.5vw, 2.2rem);
    color: #000000d0;
    text-align: center;
    letter-spacing: 0.015em;
    margin: 2rem 0 1rem;
    opacity: 0.95;
}
