/* === FONT IMPORT === */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Montserrat:wght@400;600&display=swap');

/* === MODERN CSS RESET === */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; font-family: var(--font-body); }
input, button, textarea, select { font: inherit; }

/* === ANIMATIONS === */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { transform: scale(0.95); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* === BODY & TOAST NOTIFICATIONS === */
body {
    background-color: var(--background-color);
    color: var(--text-color);
    background-image: var(--background-pattern-svg);
    padding-bottom: 100px;
}
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--secondary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    animation: fadeInUp 0.5s ease-out;
}

/* === LAYOUT & HEADER === */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}
.main-header {
    text-align: center;
    padding: 24px 16px;
    animation: fadeInUp 0.5s ease-out;
}
.main-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 6vw, 4.5rem);
    color: var(--text-heading);
}
.main-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* === LANGUAGE SWITCHER === */
.language-switcher {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 101;
    display: flex;
    gap: 4px;
    background: var(--surface-color);
    padding: 4px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.language-switcher button {
    background-color: transparent;
    border: none;
    color: var(--text-muted);
    padding: 3px 10px;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.5;
    transition: all 0.2s ease-in-out;
}
.language-switcher button:hover {
    color: var(--text-heading);
}
.language-switcher button.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* === CATEGORY NAVIGATION === */
.category-nav-sticky {
    position: sticky;
    top: 0;
    width: 100%;
    background: color-mix(in srgb, var(--background-color) 85%, transparent);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
}
.category-nav-sticky::before,
.category-nav-sticky::after {
    content: '';
    position: absolute;
    top: 0;
    height: 100%;
    width: 30px;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s ease;
}
.category-nav-sticky::before {
    left: 0;
    background: linear-gradient(to right, color-mix(in srgb, var(--background-color) 95%, transparent) 50%, transparent);
}
.category-nav-sticky::after {
    right: 0;
    background: linear-gradient(to left, color-mix(in srgb, var(--background-color) 95%, transparent) 50%, transparent);
}
.category-nav-sticky.scrolled-start::before { opacity: 0; }
.category-nav-sticky.scrolled::before { opacity: 1; }
.category-nav-sticky.scrolled-end::after { opacity: 0; }

.category-nav {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}
.category-nav::-webkit-scrollbar { display: none; }
.category-button {
    padding: 6px 16px;
    border-radius: 50px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    scroll-snap-align: start;
}
.category-button:hover { background-color: color-mix(in srgb, var(--text-color) 5%, transparent); }
.category-button.active {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* === MENU GRID & ITEMS === */
.menu-category-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--text-heading);
    text-align: center;
    padding-bottom: 16px;
    margin-top: 24px;
}
#menu-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding-top: 24px;
}
.menu-item {
    background: var(--surface-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease-in-out;
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
    cursor: pointer;
    border: 1px solid transparent;
}
.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
}
.item-thumbnail {
    height: 180px;
    border-radius: 8px 8px 0 0;
    background-color: #eee;
    background-size: cover;
    background-position: center;
}
.item-content { padding: 16px; }
.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.item-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
}
.item-header .item-price {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--secondary-color);
    white-space: nowrap;
}
.item-description {
    font-size: 0.9rem;
    margin-top: 8px;
    color: var(--text-muted);
}

/* === MODALS === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: var(--surface-color);
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 480px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: popIn 0.3s ease-out;
}
.close-button {
    position: absolute;
    top: 12px;
    right: 12px;
    background: color-mix(in srgb, var(--text-color) 5%, transparent);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.close-button:hover {
    background-color: color-mix(in srgb, var(--text-color) 10%, transparent);
    color: var(--text-color);
}

/* === ITEM DETAIL MODAL === */
.item-detail-image {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    margin-bottom: 16px;
    background-color: #eee;
}
.item-detail-content h2 {
    font-size: 2rem;
    font-family: var(--font-heading);
    color: var(--text-heading);
    line-height: 1.2;
}
.item-detail-description {
    color: var(--text-muted);
    margin: 8px 0 24px 0;
}
.item-detail-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.item-detail-footer .item-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-heading);
}
.quantity-control {
    display: flex;
    align-items: center;
    gap: 16px;
    background: color-mix(in srgb, var(--background-color) 50%, #f7f7f7);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 50px;
}
.quantity-btn {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.2s ease;
}
.quantity-btn:hover {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}
.quantity-control span {
    font-size: 1.2rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* === BOTTOM CART BAR === */
.bottom-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--surface-color);
    box-shadow: 0 -2px 15px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}
.bottom-cart-bar.show {
    transform: translateY(0);
}
.cart-info {
    display: flex;
    flex-direction: column;
}
.cart-info #cart-bar-count {
    font-size: 1rem;
    color: var(--text-muted);
}
.cart-info #cart-bar-total {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-heading);
}
.bottom-cart-bar .button-primary {
    width: auto;
    margin-top: 0;
    padding: 12px 24px;
}

/* === CART MODAL === */
.cart-items-container {
    max-height: 45vh;
    overflow-y: auto;
    margin: 16px 0;
}
.cart-empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 24px 0;
}
.cart-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
}
.cart-item-details {
    display: flex;
    flex-direction: column;
}
.cart-item-name {
    font-weight: 600;
    line-height: 1.3;
}
.cart-item-price {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.cart-item .quantity-control {
    gap: 8px;
    padding: 4px;
}
.cart-item .quantity-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
}
.cart-item .quantity-control span { font-size: 1rem; }
.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 1.2rem;
    font-weight: 600;
    padding-top: 16px;
    border-top: 2px solid var(--border-color);
}

/* === SUBMIT ORDER MODAL === */
.order-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
}
.order-meta input, .order-meta textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    background-color: color-mix(in srgb, var(--background-color) 50%, #f7f7f7);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-color);
}
.order-meta textarea { resize: vertical; min-height: 60px; }

/* === ONGOING ORDER BANNER --- STATUS STYLES === */
.ongoing-order-banner {
    background: var(--surface-color);
    box-shadow: var(--shadow-md);
    padding: 16px;
    margin: 24px 0;
    border-radius: 8px;
    text-align: center;
    display: none;
    border: 1px solid;
    transition: all 0.3s ease;
}
.ongoing-order-banner.status-pending { border-color: var(--primary-color); }
.ongoing-order-banner.status-ready {
    border-color: var(--status-ready-border);
    background-color: var(--status-ready-bg);
}
.ongoing-order-banner.status-completed {
    border-color: var(--text-muted);
    background-color: color-mix(in srgb, var(--text-muted) 10%, transparent);
}
.ongoing-order-banner h3 { color: var(--text-heading); }
.button-reorder {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    margin-top: 8px;
    border-radius: 50px;
    cursor: pointer;
}

/* === BUTTONS & SKELETONS === */
.button-primary {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.button-primary:hover {
    background: var(--primary-color-hover);
    box-shadow: var(--shadow-md);
}
.button-primary:disabled {
    background-color: #cccccc;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton {
    position: relative;
    overflow: hidden;
    background-color: color-mix(in srgb, var(--text-color) 10%, transparent);
    border-radius: 8px;
}
.skeleton::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,0.03) 20%, rgba(0,0,0,0.06) 60%, transparent);
    animation: shimmer 1.5s infinite;
}
.skeleton-title {
    height: 45px;
    width: 40%;
    margin: 24px 0 0 0;
    background-color: color-mix(in srgb, var(--text-color) 15%, transparent);
}
.skeleton-item { height: 283px; }

/* === RESPONSIVE UPGRADES === */
@media (min-width: 768px) {
    .container, .category-nav {
        padding: 0 24px;
    }
    .main-header {
        padding: 24px 0;
    }
}

/* === NEW STYLES FOR ITEM NOTES === */
.item-note-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    background-color: color-mix(in srgb, var(--background-color) 50%, #f7f7f7);
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 16px;
    resize: vertical;
    min-height: 50px;
    color: var(--text-color);
}
.cart-item-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: -2px 0 4px 0;
    line-height: 1.3;
}
.cart-item-note em {
    font-style: normal;
}

/* === SPECIALS SECTION STYLES === */
.specials-section {
    background: var(--specials-bg-color);
    border: 1px solid var(--specials-border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.specials-title {
    grid-column: 1 / -1;
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--text-heading);
    text-align: center;
    margin-bottom: 0;
}
.special-item {
    border: 1px solid var(--primary-color);
    box-shadow: var(--shadow-md);
}