.menu-background .mobile-bg {
    display: none;  
}

@media screen and (max-width: 430px) {
    body {
        background: #FFFDF8;
        width: 100%;
        max-width: 430px;
    }

    /* 导航栏调整 */
    .navbar {
        height: 44px;
        padding: 0 15px;
    }

    .logo img {
        width: 117px;
        height: 47px;
    }

    .hamburger {
        width: 21px;
        height: 17.5px;
    }

    .hero-section {
        width: 100%;
        height: auto;
        position: relative;
        margin: 0;
        padding: 0;
        overflow: hidden;
        z-index: 0;
    }

    .BrownFrame {
        width: 100%;
        height: 400px;
        background: #9D4008;
        position: relative;
        margin: 0;
        padding: 0;
        border-radius: 0;
        z-index: 0;
    }

    .HeroImages {
        width: 90%; 
        height:85%;
        border-radius: 5%;
        position: absolute;
        top: 45%;
        left: 50%;
        transform: translate(-50%, -50%);
        object-fit: cover;
    }

    .menu-title {
        width: 100%;
        font-size: 2.5rem;
        text-align: center;
        color: white;
        margin-top: 10%;
        margin-left: 1%;
        position: center;
        z-index: 2;
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }


    .bagel-section {
        width: 90%;
        margin: 0 5%;
        padding: 0;
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .bagel-header {
        width: 100%;
        max-width: 330px;
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .bagel-header .menu-title {
        font-size: 30px;
        color: #9D4008;
        text-align: left;
        margin-bottom: 20px;
        white-space: nowrap;
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .menu-line {
        display: none;
    }

    .menu-grid {
        width: 100%;
        max-width: 330px;
        display: grid;
        grid-template-columns: repeat(2, 157px);
        column-gap: 20px;
        row-gap: 20px;
        justify-content: center;
        padding: 0;
        margin: 0;
        gap: 40px 20px;
    }

    .menu-item {
        width: 157px;
        height: 165px;
        margin: 0;
        background: #F8EDE3;
        border-radius: 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .menu-image {
        width: 120px;
        height: 110px;
        margin: 0 auto;
    }

    .item-info {
        width: 100%;
        text-align: center;
        padding: 5px 0;
        background: transparent;
    }

    .item-info h3 {
        font-size: 13px;
        margin: 0px 0;
        margin-bottom: 3px;
        color: #9D4008;
        font-weight: 500;
        text-transform: capitalize;
    }

    .price {
        width: 157px;
        height: 30px;
        background: #9D4008;
        color: white;
        font-size: 12px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
    }

    .cream-cheese-section {
        width: 90%;
        margin: 40px 5% 0;
        padding: 0;
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .cream-cheese-header {
        width: 100%;
        max-width: 330px;
        margin: 0;
        padding: 0;
        align-items: flex-start;
        text-align: left;
    }

    .cream-cheese-section .menu-title {
        font-size: 30px;
        color: #9D4008;
        text-align: left;
        margin-bottom: 20px;
        margin-left: 20px;
    }

    .cream-cheese-line {
        display: none;
    }

    .cream-cheese-section .menu-grid {
        width: 100%;
        max-width: 330px;
        display: grid;
        grid-template-columns: repeat(2, 157px);
        gap: 40px 20px;
        justify-content: center;
        padding: 0;
        margin: 0 auto;
    }

    .cream-cheese-section .menu-item {
        width: 157px;
        height: 165px;
        margin: 0;
        background: #F8EDE3;
        border-radius: 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        overflow: hidden;
    }

    .cream-cheese-section .menu-image {
        width: 100px;
        height: 100px;
        margin: 8px auto 0;
        object-fit: contain;
    }

    .cream-cheese-section .item-info {
        width: 100%;
        text-align: center;
        padding: 0;
        background: transparent;
        display: flex;
        flex-direction: column;
        min-height: 35px;
    }

    .cream-cheese-section .item-info h3 {
        font-size: 12px;
        margin: 0;
        color: #9D4008;
        font-weight: 500;
        text-transform: capitalize;
        padding: 5px;
        line-height: 1.2;
    }

    .cream-cheese-section .price {
        width: 157px;
        height: 30px;
        background: #9D4008;
        color: white;
        font-size: 12px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
    }

    .grab-section {
        width: 90%;
        margin: 50px 6% 20px;
        padding: 0;
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .grab-section .menu-title {
        font-size: 25px;
        color: #9D4008;
        text-align: center;
        margin-bottom: 10px;
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .grab-line {
        width: 90%;
        height: 0.8px;
        background: #9D4008;
        margin: 0 auto 20px;
        display: block;
    }

    .grab-subtitle {
        font-size: 20px;
        margin: 10px 0;
        text-align: center;
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .grab-content {
        font-size: 13px;
        width: 323px;
        margin: 0 auto;
    }

    .grab-image{
        width: 40%;
        height:40%;
    }

    .order-now-btn {
        width: 109px;
        height: 24px;
        margin: 30px auto;
    }

    .menu-background {
        position: fixed;
        width: 100%;
        height: 100%;
        min-height: 100%;
        top: 400px;
        left: 0;
        z-index: -1;
        overflow: hidden;
    }

    .menu-background .desktop-bg {
        display: none;
    }

    .menu-background .mobile-bg {
        display: block;
    }

    .photo-slider {
        position: relative;
        z-index: 2;
        margin-top: 20px;
        padding-top: 30px;
    }

    .slider-container {
        width: 100%;
        height: 100%;
        padding: 0;
    }

    .slide {
        flex: 0 0 150px;
        width: 150px;
        height: 190px;
        margin: 0;
        overflow: hidden;
        flex-shrink: 0;
    }

    .slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .footer {
        width: 100%;
        height: 420px;
        background: #9D4008;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        position: relative;
        z-index: 3;
        margin-top: 30px;
        padding-top: 20px;
    }

    .footer-background {
        display: none;
    }

    .footer-logo {
        width: 150px;
        height: auto;
        margin-top: -60px;
        margin-bottom: 20px;
    }

    .footer-nav {
        display: flex;
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }

    .footer-line {
        width: 100%;
        height: 0.1px;
        background-color: white;
        margin: 0px auto 10px;
    }

    .social-icons {
        display: flex;
        gap: 30px;
        margin-bottom: 15px;
        justify-content: center;
    }

    .copyright {
        color: white;
        font-size: 10px;
        font-family: 'Libre Caslon Text', serif;
        text-align: center;
        margin: -10px auto -5px;
    }

    .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        justify-content: center;
        align-items: center;
    }

    .modal-content {
        background: #FFFDF8;
        width: 90%;
        max-width: 330px;
        border-radius: 16px;
        padding: 20px;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        transform: scale(0.7);
        opacity: 0;
        transition: all 0.3s ease;
    }

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

    .modal-image {
        width: 250px;
        height: 250px;
        object-fit: contain;
        margin: 10px auto;
    }

    .modal-info {
        width: 100%;
        text-align: center;
    }

    .modal-title {
        color: #9D4008;
        font-size: 30px;
        font-family: 'Modak', cursive;
        margin: -10px 0 10px 0;
        font-weight: 400;
    }

    .modal-details {
        color: #9D4008;
        font-size: 14px;
        line-height: 1.4;
    }

    .ingredients-list, .nutrition-info {
        margin: 10px 0;
    }

    .close-modal {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        background: none;
        border: none;
        cursor: pointer;
        color: #9D4008;
        font-size: 24px;
        transition: transform 0.3s ease;
        z-index: 1001;
    }

    .close-modal:hover {
        transform: rotate(90deg);
    }
}
@media screen and (max-width: 390px) {
    body {
        background: #FFFDF8;
        width: 100%;
        max-width: 390px;
    }

    /* 导航栏调整 */
    .navbar {
        height: 44px;
        padding: 0 15px;
    }

    .logo img {
        width: 117px;
        height: 47px;
    }

    .hamburger {
        width: 21px;
        height: 17.5px;
    }

    .hero-section {
        width: 100%;
        height: auto;
        position: relative;
        margin: 0;
        padding: 0;
        overflow: hidden;
        z-index: 0;
    }

    .BrownFrame {
        width: 100%;
        height: 400px;
        background: #9D4008;
        position: relative;
        margin: 0;
        padding: 0;
        border-radius: 0;
        z-index: 0;
    }

    .HeroImages {
        width: 90%;
        height:85%;
        border-radius: 5%;
        position: absolute;
        top: 45%;
        left: 50%;
        transform: translate(-50%, -50%);
        object-fit: cover;
    }

    .menu-title {
        width: 100%;
        font-size: 2.5rem;
        text-align: center;
        color: white;
        margin-top: 10%;
        margin-left: 1%;
        position: center;
        z-index: 2;
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .bagel-section {
        width: 90%;
        margin: 0 5%;
        padding: 0;
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .bagel-header {
        width: 100%;
        max-width: 330px;
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .bagel-header .menu-title {
        font-size: 30px;
        color: #9D4008;
        text-align: left;
        margin-bottom: 20px;
        white-space: nowrap;
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .menu-line {
        display: none;
    }

    .menu-grid {
        width: 100%;
        max-width: 330px;
        display: grid;
        grid-template-columns: repeat(2, 157px);
        column-gap: 20px;
        row-gap: 20px;
        justify-content: center;
        padding: 0;
        margin: 0;
        gap: 40px 20px;
    }

    .menu-item {
        width: 157px;
        height: 165px;
        margin: 0;
        background: #F8EDE3;
        border-radius: 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .menu-image {
        width: 120px;
        height: 110px;
        margin: 0 auto;
    }

    .item-info {
        width: 100%;
        text-align: center;
        padding: 5px 0;
        background: transparent;
    }

    .item-info h3 {
        font-size: 13px;
        margin: 0px 0;
        margin-bottom: 3px;
        color: #9D4008;
        font-weight: 500;
        text-transform: capitalize;
    }

    .price {
        width: 157px;
        height: 30px;
        background: #9D4008;
        color: white;
        font-size: 12px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
    }

    .cream-cheese-section {
        width: 90%;
        margin: 40px 5% 0;
        padding: 0;
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .cream-cheese-header {
        width: 100%;
        max-width: 330px;
        margin: 0;
        padding: 0;
        align-items: flex-start;
        text-align: left;
    }

    .cream-cheese-section .menu-title {
        font-size: 30px;
        color: #9D4008;
        text-align: left;
        margin-bottom: 20px;
        margin-left: 20px;
    }

    .cream-cheese-section .menu-grid {
        width: 100%;
        max-width: 330px;
        display: grid;
        grid-template-columns: repeat(2, 157px);
        gap: 40px 20px;
        justify-content: center;
        padding: 0;
        margin: 0 auto;
    }

    .cream-cheese-section .menu-item {
        width: 157px;
        height: 165px;
        margin: 0;
        background: #F8EDE3;
        border-radius: 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        overflow: hidden;
    }

    .cream-cheese-section .menu-image {
        width: 100px;
        height: 100px;
        margin: 8px auto 0;
        object-fit: contain;
    }

    .cream-cheese-section .item-info {
        width: 100%;
        text-align: center;
        padding: 0;
        background: transparent;
        display: flex;
        flex-direction: column;
        min-height: 35px;
    }

    .cream-cheese-section .item-info h3 {
        font-size: 12px;
        margin: 0;
        color: #9D4008;
        font-weight: 500;
        text-transform: capitalize;
        padding: 5px;
        line-height: 1.2;
    }

    .cream-cheese-section .price {
        width: 157px;
        height: 30px;
        background: #9D4008;
        color: white;
        font-size: 12px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
    }

    .grab-section {
        width: 90%;
        margin: 50px 6% 20px;
        padding: 0;
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .grab-section .menu-title {
        font-size: 25px;
        color: #9D4008;
        text-align: center;
        margin-bottom: 10px;
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .grab-line {
        width: 90%;
        height: 0.8px;
        background: #9D4008;
        margin: 0 auto 20px;
        display: block;
    }

    .grab-subtitle {
        font-size: 20px;
        margin: 10px 0;
        text-align: center;
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .grab-content {
        font-size: 13px;
        width: 323px;
        margin: 0 auto;
    }

    .grab-image{
        width: 40%;
        height:40%;
    }

    .order-now-btn {
        width: 109px;
        height: 24px;
        margin: 30px auto;
    }

    /* Menu Background 样式 */
    .menu-background {
        position: fixed;
        width: 100%;
        height: 100%;
        min-height: 100%;
        top: 400px;
        left: 0;
        z-index: -1;
        overflow: hidden;
    }

    /* 确保桌面版元素在移动端正确显示/隐藏 */
    .menu-background .desktop-bg {
        display: none;
    }

    .menu-background .mobile-bg {
        display: block;
    }

    /* 照片轮播样式 */
    .photo-slider {
        position: relative;
        z-index: 2;
        margin-top: 20px;
        padding-top: 30px;
    }

    .slider-container {
        width: 100%;
        height: 100%;
        padding: 0;
    }

    .slide {
        flex: 0 0 150px;
        width: 150px;
        height: 190px;
        margin: 0;
        overflow: hidden;
        flex-shrink: 0;
    }

    .slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .footer {
        width: 100%;
        height: 420px;
        background: #9D4008;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        position: relative;
        z-index: 3;
        margin-top: 30px;
        padding-top: 20px;
    }

    .footer-background {
        display: none;
    }

    .footer-logo {
        width: 150px;
        height: auto;
        margin-top: -60px;
        margin-bottom: 20px;
    }

    .footer-nav {
        display: flex;
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }

    .footer-line {
        width: 100%;
        height: 0.1px;
        background-color: white;
        margin: 0px auto 10px;
    }

    .social-icons {
        display: flex;
        gap: 30px;
        margin-bottom: 15px;
        justify-content: center;
    }

    .copyright {
        color: white;
        font-size: 10px;
        font-family: 'Libre Caslon Text', serif;
        text-align: center;
        margin: -10px auto -5px;
    }

    .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        justify-content: center;
        align-items: center;
    }

    .modal-content {
        background: #FFFDF8;
        width: 90%;
        max-width: 330px;
        border-radius: 16px;
        padding: 20px;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        transform: scale(0.7);
        opacity: 0;
        transition: all 0.3s ease;
    }

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

    .modal-image {
        width: 250px;
        height: 250px;
        object-fit: contain;
        margin: 10px auto;
    }

    .modal-info {
        width: 100%;
        text-align: center;
    }

    .modal-title {
        color: #9D4008;
        font-size: 30px;
        font-family: 'Modak', cursive;
        margin: -10px 0 10px 0;
        font-weight: 400;
    }

    .modal-details {
        color: #9D4008;
        font-size: 14px;
        line-height: 1.4;
    }

    .ingredients-list, .nutrition-info {
        margin: 10px 0;
    }

    .close-modal {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        background: none;
        border: none;
        cursor: pointer;
        color: #9D4008;
        font-size: 24px;
        transition: transform 0.3s ease;
        z-index: 1001;
    }

    .close-modal:hover {
        transform: rotate(90deg);
    }
}
@media screen and (min-width: 391px) {
    .menu-background .desktop-bg {
        display: block;
    }

    /*  image slider 和 footer 在桌面正常显示 */
    .image-slider,
    .footer {
        display: block;
    }
}

@media screen and (width:820px) {
    .cream-cheese-section {
        margin-top: -30px;
    }

    .cream-cheese-section .menu-grid {
        margin-top: 20px;
        gap: 20px;
    }

    .cream-cheese-header {
        margin-bottom: 0;
    }

    .cream-cheese-section .menu-title {
        margin-bottom: 10px;
    }

    
}

@media screen and (width:768px) {
    .cream-cheese-section {
        margin-top: -30px;
    }

    .cream-cheese-section .menu-grid {
        margin-top: 20px;
        gap: 20px;
    }

    .cream-cheese-header {
        margin-bottom: 0;
    }

    .cream-cheese-section .menu-title {
        margin-bottom: 10px;
    }

    .grab-section{
        margin-top: -160px;
        padding-top: 100px;
        margin-bottom: 10px;
        background-color: #FFFDF8;
        position: relative;
        z-index: 2;
    }
}

/* iOS 特定的菜单项样式 */
@supports (-webkit-touch-callout: none) {
    .menu-item {
        width: 157px;
        height: 165px;
        margin: 0;
        background: #F8EDE3;
        border-radius: 16px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* 改变对齐方式 */
        align-items: center;
        position: relative;
        overflow: hidden;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    .menu-image {
        width: 120px;
        height: 110px;
        margin: 0;
        padding-top: 5px;
        object-fit: contain;
        will-change: auto;
        flex-shrink: 0; /* 防止图片压缩 */
    }

    .item-info {
        width: 100%;
        min-height: 25px; /* 确保最小高度 */
        margin-top: auto; /* 将信息推到底部 */
        padding: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: center;
        position: relative; /* 改为相对定位 */
        z-index: 1;
    }

    .item-info h3 {
        width: 100%;
        font-size: 13px;
        margin: 0;
        padding: 5px;
        color: #9D4008;
        font-weight: 500;
        text-align: center;
        line-height: 1.2;
        -webkit-font-smoothing: antialiased;
    }

    .price {
        width: 100%;
        height: 30px;
        background: #9D4008;
        color: white;
        font-size: 12px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: auto; /* 确保价格在底部 */
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
        will-change: auto;
    }

    /* Cream Cheese Section 特殊处理 */
    .cream-cheese-section .menu-item {
        height: 165px;
        display: flex;
        flex-direction: column;
    }

    .cream-cheese-section .menu-image {
        width: 100px;
        height: 100px;
        margin: 8px auto 0;
        object-fit: contain;
    }

    .cream-cheese-section .item-info {
        margin-top: auto;
    }

    .cream-cheese-section .item-info h3 {
        font-size: 12px;
        padding: 5px;
        margin-bottom: 0;
    }
}

/* 确保网格布局在 iOS 上正确显示 */
@media screen and (max-width: 430px) {
    .menu-grid,
    .cream-cheese-section .menu-grid {
        width: 100%;
        max-width: 330px;
        display: grid;
        grid-template-columns: repeat(2, 157px);
        gap: 40px 20px;
        justify-content: center;
        padding: 0;
        margin: 0 auto;
        will-change: auto;
    }
}