/* Custom smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom backdrop blur for hero text */
.hero-text-bg {
    background: rgba(139, 69, 19, 0.8);
    backdrop-filter: blur(5px);
}

/* Hover effects */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Menu Scroll Container */
.menu-scroll-container {
    position: relative;
    overflow: hidden;
    padding: 10px 0;
}

.menu-scroll-content {
    display: flex;
    animation: scroll-horizontal 45s linear infinite;
    gap: 20px;
    width: fit-content;
}

/* Menu scroll animation - pauses on hover */
.menu-scroll-content:hover {
    animation-play-state: paused;
}

/* Different scroll speeds for each row */
#menu-row-1 {
    animation-duration: 50s;
}

#menu-row-2 {
    animation-duration: 55s;
    animation-direction: reverse;
}

@keyframes scroll-horizontal {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Menu Item Styles - Optimized for Mobile */
.menu-item {
    flex: 0 0 auto;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.menu-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.menu-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.menu-item:hover img {
    transform: scale(1.1);
}

.menu-item-content {
    padding: 20px;
}

.menu-item-content h4 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #8B4513;
    margin-bottom: 10px;
    line-height: 1.2;
}

.menu-item-content p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
    height: 3rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.menu-item-content .price {
    font-size: 1.6rem;
    font-weight: 700;
    color: #228B22;
    display: block;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .menu-item {
        width: 260px;
    }
    
    .menu-item img {
        height: 160px;
    }
    
    .menu-item-content {
        padding: 16px;
    }
    
    .menu-item-content h4 {
        font-size: 1.2rem;
    }
    
    .menu-item-content p {
        font-size: 0.9rem;
        height: 2.7rem;
    }
    
    .menu-item-content .price {
        font-size: 1.4rem;
    }
    
    /* Faster scroll on mobile for better UX */
    #menu-row-1 {
        animation-duration: 40s;
    }
    
    #menu-row-2 {
        animation-duration: 42s;
    }
}

@media (max-width: 480px) {
    .menu-item {
        width: 240px;
    }
    
    .menu-item img {
        height: 140px;
    }
    
    .menu-item-content {
        padding: 14px;
    }
    
    .menu-item-content h4 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .menu-item-content p {
        font-size: 0.85rem;
        height: 2.4rem;
        margin-bottom: 12px;
    }
    
    .menu-item-content .price {
        font-size: 1.3rem;
    }
    
    /* Even faster scroll on smaller screens */
    #menu-row-1 {
        animation-duration: 35s;
    }
    
    #menu-row-2 {
        animation-duration: 37s;
    }
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Additional hover effects for better interactivity */
.nav-link:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #8B4513;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #654321;
}

/* Menu section title improvements */
#menu h3 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

/* Responsive menu section spacing */
@media (max-width: 768px) {
    #menu {
        padding: 60px 0;
    }
    
    #menu h2 {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    #menu h3 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    #menu .mb-8 {
        margin-bottom: 1.5rem;
    }
}

/* --- Auto-scrolling menu rows --- */

.menu-scroll-content {
    display: flex;
    gap: 20px;
    width: fit-content;
    animation: scroll-horizontal 50s linear infinite;
}

.menu-scroll-content:hover {
    animation-play-state: paused;
}

/* Hàng chạy sang trái */
.scroll-left {
    animation: scroll-horizontal 50s linear infinite;
}

/* Hàng chạy sang phải (bắt đầu dịch qua trái trước) */
.scroll-right {
    animation: scroll-horizontal-reverse 50s linear infinite;
}

@keyframes scroll-horizontal {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes scroll-horizontal-reverse {
    0% { transform: translateX(-50%); }  /* 👈 bắt đầu đã lệch trái */
    100% { transform: translateX(0); }
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Chừa không gian cho navbar fixed */
}
