@font-face {
    font-family: 'Ranoya';
    src: url('./WOFF/Ranoya-Regular.woff2?v=1') format('woff2'),
         url('./WOFF/Ranoya-Regular.woff?v=1') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Ranoya';
    src: url('./WOFF/Ranoya-Italic.woff2?v=1') format('woff2'),
         url('./WOFF/Ranoya-Italic.woff?v=1') format('woff');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

:root {
    /* Light mode colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: rgb(18, 18, 18);
    --text-secondary: rgba(18, 18, 18, 0.7);
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.08);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --nav-shadow: rgba(0, 0, 0, 0.1);
    --price-bg: #121212;
    --price-text: #ffffff;
    --variant-bg: #1a1a1a;
    --variant-hover-bg: #222222;
}

[data-theme="dark"] {
    /* Dark mode colors */
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --card-bg: #1e1e1e;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --nav-bg: rgba(18, 18, 18, 0.95);
    --nav-shadow: rgba(0, 0, 0, 0.3);
    --price-bg: #ffffff;
    --price-text: #121212;
    --variant-bg: #f0f0f0;
    --variant-hover-bg: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
}

body {
    font-family: 'Instrument Sans', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.nav-bar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 120px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 99;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    scrollbar-width: none;
    box-shadow: 2px 0 20px var(--nav-shadow);
    padding: 0 8px 16px;
    -webkit-overflow-scrolling: touch;
}

.logo-container {
    width: 120px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    margin: 0;
    background: var(--nav-bg);
    position: sticky;
    top: 0;
    left: 0;
    z-index: 2;
}

.restaurant-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.nav-item {
    width: 120px;
    min-width: 120px;
    height: 120px;
    padding: 12px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    user-select: none;
    margin: 2px;
    position: relative;
    overflow: visible;
    -webkit-tap-highlight-color: transparent;
}

.nav-item-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-icon {
    width: 52px;
    height: 52px;
    display: block;
    opacity: 0.7;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.nav-item:hover .category-icon {
    opacity: 1;
    transform: scale(1.05);
}

.nav-item.active .category-icon {
    opacity: 1;
    transform: scale(1.1);
}

.nav-item:hover .nav-item-content,
.nav-item.active .nav-item-content {
    transform: translateY(-2px);
}

.category-name {
    font-size: clamp(9px, 2.5vw, 13px);
    line-height: 1.2;
    font-weight: 500;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    transition: all 0.3s ease;
    padding: 0 2px;
    text-align: center;
    height: auto;
    min-height: 2.4em;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(127, 127, 127, 0.1);
    transform: translateY(-1px);
}

.nav-item.active {
    color: var(--price-text);
    background: var(--price-bg);
    box-shadow: 0 4px 12px var(--card-shadow);
    transform: translateY(-2px);
}

.nav-item.active .category-icon img {
    filter: none;
}

.header-bar {
    position: fixed;
    top: 0;
    left: 120px;
    right: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px var(--nav-shadow);
    padding: 0.5rem;
    height: 60px;
    transition: all 0.3s ease;
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.header-bar.hidden {
    transform: translateY(-100%);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 100%;
    width: 100%;
    padding: 0 1rem;
}

.search-container {
    flex: 1;
    position: relative;
    height: 100%;
}

.search-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    border-radius: 50px;
    border: 1px solid rgba(128, 128, 128, 0.2);
    transition: all 0.3s ease;
}

.search-input {
    width: 100%;
    height: 100%;
    padding: 0.25rem 1.25rem;
    padding-left: 2rem;
    border: none;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: transparent;
    transition: all 0.3s ease;
}

.search-icon {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.9rem;
    height: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    padding: 8px;
    border: none;
    background: rgba(128, 128, 128, 0.1);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid rgba(128, 128, 128, 0.2);
}

.theme-toggle:hover {
    background: rgba(127, 127, 127, 0.2);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    position: absolute;
    transition: all 0.3s ease;
    stroke: #666666;
    stroke-width: 2.5;
    fill: none;
}

[data-theme="dark"] .theme-toggle svg {
    stroke: #cccccc;
}

.theme-toggle .moon-icon {
    opacity: 0;
    transform: translateY(20%);
    display: block;
}

.theme-toggle .sun-icon {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    opacity: 1;
    transform: translateY(0);
}

[data-theme="dark"] .theme-toggle .sun-icon {
    opacity: 0;
    transform: translateY(-20%);
}

@media (max-width: 768px) {
    .nav-bar {
        width: 100px;
        padding: 0 4px 16px;
    }
    
    .header-bar {
        left: 100px;
    }
    
    .menu-content {
        margin-left: 100px;
        width: calc(100% - 100px);
    }
    
    .search-container {
        width: 74px;
    }
    
    .nav-item {
        width: 92px;
        min-width: 92px;
        height: 92px;
        padding: 8px 4px;
    }
    
    .category-icon {
        width: 38px;
        height: 38px;
    }
    
    .category-name {
        font-size: 12px;
        line-height: 1.3;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 480px) {
    .nav-bar {
        width: 85px;
    }
    
    .header-bar {
        left: 85px;
    }
    
    .menu-content {
        margin-left: 85px;
        width: calc(100% - 85px);
    }
    
    .search-container {
        width: 69px;
    }
}

@media (max-width: 380px) {
    .nav-bar {
        width: 75px;
    }
    
    .header-bar {
        left: 75px;
    }
    
    .menu-content {
        margin-left: 75px;
        width: calc(100% - 75px);
    }
    
    .search-container {
        width: 59px;
    }
}

main {
    margin-top: 84px;
    margin-left: 120px;
    width: calc(100% - 120px);
    overflow-x: hidden;
    min-height: calc(100vh - 84px);
}

.menu-content {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    margin-left: 120px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    margin-top: 84px;
}

.menu-section {
    margin-bottom: 40px;
    scroll-margin-top: 100px;
    padding: 20px 0;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.menu-category {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    padding: 16px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.menu-category > * {
    overflow-x: hidden;
    max-width: 100%;
}

.menu-item {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0;
    transform: scale(1);
    z-index: 1;
    position: relative;
}

.menu-item.center-focused {
    z-index: 10;
}

.menu-item.center-focused .menu-item-image {
    transform: scale(1.15);
}



/* Mobile optimizations for center-focused effect */
@media (max-width: 768px) {
    .menu-item.center-focused .menu-item-image {
        transform: scale(1.2);
    }
}

@media (max-width: 480px) {
    .menu-item.center-focused .menu-item-image {
        transform: scale(1.25);
    }
}

.menu-item-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

.menu-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.menu-item-prices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    min-width: 90px;
}

.menu-item-price {
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--price-bg);
    color: var(--price-text);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}

.menu-item-price.has-variants {
    display: flex;
    align-items: center;
    gap: 4px;
}

.menu-item-price.has-variants .expand-icon {
    font-size: 16px;
    font-variation-settings: 'FILL' 1;
    transition: transform 0.3s ease;
    display: inline-flex;
    vertical-align: middle;
    margin-left: 2px;
}

.menu-item-price.expanded .expand-icon {
    transform: rotate(180deg);
}

.menu-item-price:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px var(--card-shadow);
}

.menu-item-price:active {
    transform: scale(0.98);
}

.variant-item {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--variant-bg);
    color: var(--text-primary);
    opacity: 0.9;
    text-align: right;
    transition: all 0.3s ease;
}

.variant-item:hover {
    opacity: 1;
    background: var(--variant-hover-bg);
    transform: scale(1.02);
}

.menu-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.menu-item-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.menu-item-image-container {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
}

.menu-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.menu-item:hover .menu-item-image {
    transform: scale(1.05);
}

.menu-section-title {
    font-family: 'Ranoya', "Instrument Sans", sans-serif;
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    padding: 24px 16px 8px;
    margin: 0;
}

.category-title {
    font-family: 'Ranoya', "Instrument Sans", sans-serif;
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    padding: 24px 16px 8px;
    margin: 0;
}

.variants-row {
    display: flex;
    gap: 8px;
    flex-direction: row;
}

.variants-container {
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--variant-bg);
    border-radius: 8px;
    margin-top: 4px;
    will-change: height, opacity;
}

.variants-inner {
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.variant-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    cursor: pointer;
    font-size: 13px;
}

.variant-name {
    color: var(--text-primary);
    font-weight: 500;
}

.variant-price {
    color: var(--text-secondary);
    font-weight: 500;
}

@media (min-width: 640px) {
    .menu-category {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        padding: 24px;
    }

    .menu-item-title {
        font-size: 20px;
    }

    .menu-item-description {
        font-size: 15px;
    }
}

@media (min-width: 1024px) {
    .menu-category {
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
        padding: 32px;
    }

    .menu-item-content {
        padding: 20px;
    }

    .menu-item-title {
        font-size: 22px;
    }

    .menu-item-description {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .nav-bar {
        width: 90px;
        padding: 0 4px 16px;
    }

    .menu-content {
        margin-left: 90px;
        width: calc(100% - 90px);
    }

    .header-bar {
        left: 90px;
        width: calc(100% - 90px);
    }
    
    .nav-item {
        width: 80px;
        min-width: 80px;
        height: 80px;
    }

    .nav-item span,
    .nav-item .material-symbols-rounded {
        font-size: 28px;
    }

    .category-name {
        font-size: 11px;
        -webkit-line-clamp: 2;
        max-height: 2.4em;
    }

    .category-icon {
        width: 36px;
        height: 36px;
    }

    .header-content {
        padding: 0 0.5rem;
    }

    .logo-container {
        width: 90px;
        height: 70px;
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .menu-category {
        grid-template-columns: 1fr;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 0.25rem;
    }

    .search-container {
        gap: 0.25rem;
    }

    .search-wrapper {
        margin: 0 -0.25rem;
    }

    .search-input {
        padding: 0.65rem 1rem 0.65rem 2.5rem;
        font-size: 0.9rem;
    }

    .theme-toggle {
        width: 38px;
        height: 38px;
    }

    .menu-category {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 8px;
    }

    .nav-bar {
        width: 85px;
        padding: 0 4px 16px;
    }

    .header-bar {
        left: 85px;
        width: calc(100% - 85px);
    }

    .menu-content {
        margin-left: 85px;
        width: calc(100% - 85px);
        padding: 75px 12px 20px;
    }

    .nav-item {
        width: 75px;
        min-width: 75px;
        height: 75px;
    }

    .nav-item.active {
        padding: 3px;
    }

    .category-icon {
        width: 36px;
        height: 36px;
    }

    .category-name {
        font-size: clamp(8px, 3vw, 10px);
        -webkit-line-clamp: 2;
        max-height: 2.4em;
        line-height: 1.1;
    }

    .logo-container {
        width: 85px;
        height: 65px;
        padding: 8px;
    }
}

@media (max-width: 380px) {
    .search-container {
        padding: 0 0.25rem;
    }

    .search-wrapper {
        min-width: 120px;
    }

    .search-input {
        padding: 0.6rem 0.75rem 0.6rem 2.25rem;
        font-size: 0.85rem;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
    }

    .nav-bar {
        width: 75px;
        padding: 0 4px 16px;
    }

    .header-bar {
        left: 75px;
        width: calc(100% - 75px);
    }
    
    .menu-content {
        margin-left: 75px;
        width: calc(100% - 75px);
        padding: 75px 12px 20px;
    }

    .menu-category {
        padding: 8px;
    }

    .nav-item {
        width: 64px;
        min-width: 64px;
        height: 64px;
    }

    .category-icon {
        width: 36px;
        height: 36px;
    }

    .nav-item-content {
        gap: 4px;
    }

    .category-name {
        font-size: clamp(7px, 3.5vw, 9px);
        line-height: 1.1;
    }

    .nav-item.active {
        padding: 2px;
    }

    .logo-container {
        width: 75px;
        height: 60px;
        padding: 6px;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-item {
    animation: fadeInUp 0.6s ease-out forwards;
}
