* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Afacad', sans-serif;
    padding-top: 50px;
    background-color: #9D4008;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

/* 响应式调整 body padding */
@media screen and (max-width: 768px) {
    body {
        padding-top: 45px;
    }
}

@media screen and (max-width: 430px) {
    body {
        padding-top: 40px;
    }
}

/* 导航栏基础样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px 0 15px;
    background-color: #FFFDF8;
    border-bottom: 2px solid #A0522D;
    height: 50px;
    position: fixed !important;
    top: 0 !important;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999 !important;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

/* Logo 样式 */
.logo img {
    width: 125px;
    height: 50px;
}

/* 导航链接样式 - 保留这组完整的样式 */
.nav-links {
    display: flex;
    gap: 50px;
    font-family: "Modak", Helvetica;
    font-weight: 400;
    color: #9d4008;
    font-size: 15px;
    letter-spacing: 0.4px;
    line-height: normal;
}

.nav-links a {
    text-decoration: none;
    color: #9D4008;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Active 状态样式 */
.nav-links a.active {
    color: #c2500a;
}

/* Hover 效果 */
.nav-links a:hover {
    color: #c2500a;
    transform: translateY(-2px);
}

/* 移动端菜单的 hover 效果 */
@media (max-width: 768px) {
    .nav-links a {
        padding: 15px 0;
        width: 80%;
        max-width: 300px;
        text-align: center;
        border-bottom: 1px solid rgba(157, 64, 8, 0.2);
        transition: all 0.3s ease;
    }

    .nav-links a:hover {
        background-color: rgba(157, 64, 8, 0.05);
        transform: translateY(-2px);
        color: #c2500a;
    }
}

/* Hamburger 按钮基础样式 */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 18px;
    cursor: pointer;
    z-index: 1001;
    position: relative;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2.5px;
    background-color: #9D4008;
    transition: all 0.3s ease-in-out;
    border-radius: 1px;
}

/* Hamburger 动画效果 */
.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* 移动端样式 */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 44px;
        left: 0;
        width: 100%;
        height: calc(100vh - 44px);
        background-color: #FFFDF8;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 30px;
        padding: 20px 0;
        z-index: 999;
        transition: all 0.3s ease-in-out;
        border-top: 1px solid rgba(157, 64, 8, 0.2);
    }

    .nav-links.active {
        display: flex;
    }
}

/* 更小屏幕的样式 */
@media (max-width: 430px) {
    .hamburger {
        width: 20px;
        height: 15px;
    }

    .hamburger span {
        height: 2px;
    }

    /* 调整小屏幕下的动画效果 */
    .hamburger.active span:nth-child(1) {
        transform: translateY(6.5px) rotate(45deg);
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-6.5px) rotate(-45deg);
    }

    .nav-links {
        top: 39px;
        height: calc(100vh - 39px);
    }
}

/* 设置三条线的位置 */
.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 7px;
}

.hamburger span:nth-child(3) {
    top: 14px;
}

/* 在移动端显示 hamburger */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 44px;
        left: 0;
        width: 100%;
        height: calc(100vh - 44px);
        background-color: #FFFDF8;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 30px;
        padding: 20px 0;
        z-index: 999;
        transition: all 0.3s ease-in-out;
        border-top: 1px solid rgba(157, 64, 8, 0.2);
    }

    .nav-links.active {
        display: flex;
    }
}

/* Hero Section 基础样式 */
.hero-section {
    position: relative;
    width: 100%;
    max-width: auto;
    margin: 23px auto 0;
    opacity: 0;
    animation: fadeIn 1.2s ease-out forwards;
    animation-delay: 0.3s;
    z-index: 1;
}

.BrownFrame {
    width: 100%;
    padding-top: 56.7%;
    background: #9D4008;
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

.HeroImages {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 97%;
    max-width: auto;
    height: auto;
    border-radius: 4.2vw;
    object-fit: cover;
    opacity: 0;
    animation: scaleIn 1.2s ease-out forwards;
    animation-delay: 0.5s;
}

/* 机端响应 */
@media screen and (max-width: 430px) {
    body {
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }

    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        height: 40px;
    }

    .hero-section {
        position: relative;
        width: 100%;
        height: 500px;
        margin-bottom: 0;
        padding: 20px;
    }

    .BrownFrame {
        width: 100%;
        height: 50%;
        padding: 20px;
        border-radius: 30px;
    }

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

    /* 确保导航栏和内容不受影响 */
    .navbar {
        height: 40px;
    }

    body {
        padding-top: 40px;
    }
}

/* 动画键帧 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 响应式样式 */
@media screen and (max-width: 768px) {
    .navbar {
        height: 45px;
        padding: 0 20px 0 10px;
    }

    .logo img {
        width: 100px;
        height: 40px;
    }

    body {
        padding-top: 45px;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}

@media screen and (max-width: 430px) {
    body {
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }

    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        height: 40px;
    }

    .hero-section {
        position: relative;
        width: 100%;
        height: 500px;
        margin-bottom: 0;
        padding: 20px;
    }

    .BrownFrame {
        width: 100%;
        height: 50%;
        padding: 20px;
        border-radius: 30px;
    }

    .HeroImages {
        width: 90%;
        height: 65%;
        border-radius: 30px;
        object-fit: cover;
        position: absolute;
        top: 40%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    /* 确保导航栏和内容不受影响 */
    .navbar {
        height: 40px;
    }

    body {
        padding-top: 40px;
    }
}

/* 确保画在手机端也正常工作 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Menu Title Styles */
.menu-title {
    color: #9D4008;
    font-size: 50px;
    font-family: 'Modak', cursive;
    font-weight: 400;
    text-align: left;
    margin-bottom: 0;
    line-height: 1;
    margin-left: 0px;
    display: inline-block;
}

/* 为 Cream Cheese 标题添加特殊样式 */
.cream-cheese-section .menu-title {
    margin-left: 138px;
    display: inline-block;
}

/* Menu Line Styles */
.menu-line {
    width: 1000px;
    height: 2px;
    background: #9D4008;
    margin: 0;
    flex-shrink: 0;
}

.cream-cheese-line {
    width: 855px;
    display: inline-block;
    margin-left: 35px;
    margin-right: 137px;
}

.grab-line {
    width: 809px;
    border: 1px solid #9D4008;
    display: block;
    margin: 10px auto;
    position: static;
}

/* Menu Grid Layout */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 245px);
    gap: 30px 60px;
    justify-content: start;
    margin: 40px 0 0 211px;
    padding: 0;
}

/* Menu Item Styles */
.menu-item {
    cursor: pointer;
    width: 245px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.menu-item.show {
    opacity: 1;
    transform: translateY(0);
}

.menu-image {
    width: 204px;
    height: 203px;
    object-fit: cover;
    display: block;
    margin: 0 auto;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
    margin-bottom: -130px;
}

.menu-image.round {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    margin: 0 auto;
    margin-bottom: -130px;
}

.item-info {
    background: #F8EDE3;
    border-radius: 41px;
    padding: 20px;
    margin-top: 0;
    position: relative;
    height: 207px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 1;
    width: 100%;
}

.item-info h3 {
    color: #9D4008;
    font-size: 17px;
    font-weight: 400;
    text-align: center;
    margin-bottom: 10px;
}

.price {
    color: #9D4008;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

/* Hover Effects */
.menu-item:hover .item-info {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(157, 64, 8, 0.1);
}

.menu-item:hover .menu-image {
    transform: translateY(-5px);
}

/* Grab Section Styles */
.grab-section {
    text-align: center;
    padding: 40px 0;
    max-width: 809.39px;
    margin: 150px auto;
    position: relative;
    z-index: 3;
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease-out;
}

.grab-section .menu-title {
    display: block;
    text-align: center;
    margin-left: 0;
}

.grab-subtitle {
    color: #9D4008;
    font-size: 25px;
    font-family: 'ADLaM Display', cursive;
    margin: 0px auto 20px;
    text-align: center;
}

.grab-content {
    color: #9D4008;
    font-size: 18px;
    max-width: 484px;
    margin: 0 auto 40px;
    text-align: center;
}

.grab-image {
    width: 344px;
    height: 231px;
    object-fit: contain;
    margin: 20px auto;
    display: block;
}

.order-now-btn {
    width: 182px;
    height: 36px;
    background: #F8EDE3;
    border: 1px solid #9D4008;
    border-radius: 17px;
    color: #9D4008;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;           /* 改为flex布局 */
    align-items: center;     /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    margin: 0 auto;
    text-decoration: none;   /* 移除链接下划线 */
}

.order-now-btn:hover {
    background: #9D4008;
    color: #F8EDE3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(157, 64, 8, 0.2);
}

/* Background Image */
.menu-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

/* Bagel Section Styles */
.bagel-section {
    width: 1165px;
    margin: 0 auto;
    padding-top: 100px;
    margin-bottom: 150px;
    position: relative;
    overflow: visible;
    z-index: 3;
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease-out;
}

/* 为 Bagel 标题和线条添加容器 */
.bagel-header {
    width: 100%;
    display: flex;
    align-items: center;
}

/* Cream Cheese Section Styles */
.cream-cheese-section {
    width: 1165px;
    margin: 0 auto;
    position: relative;
    overflow: visible;
    z-index: 3;
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease-out;
}

/* 为 Cream Cheese 标题和线条添加容器 */
.cream-cheese-header {
    width: 100%;
    display: flex;
    align-items: center;
}

/* Cream Cheese Title Styles */
.cream-cheese-section .menu-title {
    margin-left: 0px;
    display: inline-block;
}

/* Cream Cheese Line Styles */
.cream-cheese-line {
    width: 798px;
    display: inline-block;
    margin-right: 0px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Cream Cheese Menu Grid */
.cream-cheese-section .menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 245px);
    gap: 30px 60px;
    justify-content: start;
    margin: 40px 0 0 211px;
    padding: 0;
}

/* Cream Cheese Section 的图片样式 */
.cream-cheese-section .menu-image {
    margin-bottom: -110px;
}

.cream-cheese-section .menu-image.round {
    margin-bottom: -110px;
}

/* 添加背景图片容器 */
.menu-background {
    position: absolute;
    top: 800px;
    left: 0;
    width: 100%;
    height: 2750px;
    z-index: 2;
    opacity: 0;
    transform: scale(1.02);
    transition: all 0.5s ease-out;
}

/* 为不同尺寸的大屏幕添加调整 */
@media screen and (min-width: 1920px) {
    .menu-background {
        top: 1100px;
    }
}

@media screen and (min-width: 2560px) {
    .menu-background {
        top: 1450px;
    }
}

.menu-background.show {
    opacity: 1;
    transform: scale(1);
}

.menu-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal Styles */
.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: 80%;
    max-width: 800px;
    border-radius: 30px;
    padding: 30px;
    position: relative;
    display: flex;
    gap: 30px;
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.3s ease;
}

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

.modal-image {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 20px;
}

.modal-info {
    flex: 1;
}

.modal-title {
    color: #9D4008;
    font-size: 30px;
    font-family: 'Modak', cursive;
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 0.8px;
    text-shadow: 0 0 0.5px #9D4008;
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    z-index: 1000;
}

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

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

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    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);
}

/* 可以添加一个点击时的效果 */
.menu-item:active {
    transform: scale(0.98);
}

/* 添加显示时的类 */
.show {
    opacity: 1;
    transform: translateY(0);
}


/* Back to Top Button 样式 */
#backToTop {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    width: 40px;
    height: 40px;
    outline: 1px solid white;
    background-color: #9D4008;
    color: #F8EDE3;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#backToTop:hover {
    background-color: #B64807;
    transform: translateY(-3px);
}

/* 手机端调整 */
@media screen and (max-width: 430px) {
    #backToTop {
        bottom: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* 照片轮播样式 */
.photo-slider {
    margin-top: -180px;
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 90px 0px 0px 0px;
    background-color: #FFFDF7;
}

.slider-container {
    width: 100%;
    overflow: hidden;
}

.slider-track {
    display: flex;
    animation: scroll 30s linear infinite;
    gap: 0;
    width: fit-content;
}

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

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

/* 添加动动画 */
@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-250px * 12)); /* 移动第一组图片的总宽度 */
    }
}

/* 响应调整 */
@media screen and (max-width: 768px) {
    .slide {
        flex: 0 0 200px;
        width: 200px;
    }

    @keyframes scroll {
        100% {
            transform: translateX(calc(-200px * 12));
        }
    }
}

@media screen and (max-width: 430px) {
    .slide {
        flex: 0 0 180px;
        width: 180px;
    }

    @keyframes scroll {
        100% {
            transform: translateX(calc(-180px * 12));
        }
    }
}

/* 添加鼠标悬停暂停效果 */
.slider-track:hover {
    animation-play-state: paused;
}

.footer {
    position: relative;
    margin-top: 0px;
    width: 100%;
    height: 100%;
    margin-bottom: -100px; /* 确保footer底部没有margin */
    display: block; /* 防止任何意外的间距 */
}

.footer-background {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.footer-content {
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    height: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.footer-logo {
    width: 200px;
    height: 80px;
    margin-bottom: 20px;
}

.footer-nav {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.footer-nav a {
    color: white;
    font-size: 18px;
    font-family: 'Modak', cursive;
    text-decoration: none;
    transition: all 0.3s ease;
    /* 添加下文字渲染优化属性 */
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.3px;  /* 稍增加字间距提高可读性 */
}

.footer-nav a:hover {
    color: #FFF6C7;  /* 鼠标悬停时改变文字颜色 */
    transform: translateY(-2px);  /* 轻微向上移动 */
}

.social-icons {
    display: flex;
    gap: 64px;
    margin-bottom: 20px;
}

.social-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease; /* 稍微延长动画时间使旋转更流畅 */
}

.social-icon:hover {
    transform: scale(1.2) rotate(360deg);
    cursor: pointer;
}

.social-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.footer-line {
    width: 1189px;
    height: 1px;
    background-color: white; /* 改用background-color替代border */
    margin: 20px auto; /* 居中显示 */
    opacity: 1; /* 确保可见性 */
    display: block; /* 确��显示为块级元素 */
}

/* 或者使用border方式 */
.footer-line {
    width: 1189px;
    border: 0.3px solid white;
    margin: 10px auto;
    display: block;
}

.copyright {
    color: white;
    font-size: 12px;
    font-family: 'Libre Caslon Text', serif;
    line-height: 40px;
    text-align: center;
}


@media screen and (min-width: 1441px){

    .footer {
        position: relative;
        width: 100%;
        height: 300px;
        margin: 0;
        background: #9D4008;
    }

    .footer-background {
        display: none;
    }

    .footer-content {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 1800px;
        margin: 0 auto;
        height: 100%;
        padding: 40px 20px 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
    }

    .footer-nav {
        margin-bottom: 30px;
    }

    .social-icons {
        margin-bottom: 30px;
    }

    .footer-line {
        width: calc(100% + 40px); /* 让线条超出content区域 */
        border: 0.3px solid white;
        margin: 0 -20px 10px -20px; /* 使用负margin来延伸线条 */
    }

    .copyright {
        margin-bottom: 10px;
    }
}
/* 明确定义active状态 */
.navbar .nav-links a.active {
    color: #c2500a;
    font-weight: 700;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-shadow: 0 0 0.1px #c2500a;
}

