@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary: #FF5722;
    --primary-dark: #E64A19;
    --bg-light: #F8F9FA;
    --surface: #FFFFFF;
    --text-dark: #121212;
    --text-gray: #757575;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #B0A898;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ========== App Container ========== */
.app-container {
    max-width: 480px;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-light);
    position: relative;
    padding-bottom: 80px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
}

/* ========== Hero Section ========== */
.hero {
    height: 220px;
    background-size: cover;
    background-position: center;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.6) 100%);
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
}

/* ========== Top Bar ========== */
.top-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========== Table Pill ========== */
.table-pill {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========== Hero Title ========== */
.hero-title {
    position: absolute;
    bottom: 40px;
    left: 20px;
    color: white;
    z-index: 10;
}

.hero-title h1 {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}

.hero-title p {
    font-size: 13px;
    opacity: 0.9;
}

/* ========== Hero Video ========== */
.hero video,
.hero .hero-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
}

/* ========== Search Filter Wrapper ========== */
.search-filter-wrapper {
    padding: 0 20px;
    margin-top: -24px;
    position: relative;
    z-index: 20;
    display: flex;
    gap: 12px;
}

/* ========== Search Box ========== */
.search-box {
    flex: 1;
    background: var(--surface);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    height: 52px;
}

.search-box svg {
    width: 20px;
    height: 20px;
    fill: var(--text-gray);
    margin-right: 12px;
    flex-shrink: 0;
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    color: var(--text-dark);
    background: transparent;
    font-family: 'Poppins', sans-serif;
}

/* ========== Filter Button ========== */
.filter-btn {
    width: 52px;
    height: 52px;
    background: var(--surface);
    border: none;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: 0.2s;
}

.filter-btn svg {
    width: 24px;
    height: 24px;
    fill: var(--text-dark);
}

.filter-btn:active {
    background: var(--bg-light);
}

/* ========== Story-Style Categories ========== */
.categories-story {
    display: flex;
    overflow-x: auto;
    padding: 24px 20px;
    gap: 16px;
    scrollbar-width: none;
}

.categories-story::-webkit-scrollbar {
    display: none;
}

/* ========== Story Item ========== */
.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
}

/* ========== Story Image Wrapper ========== */
.story-img-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    padding: 3px;
    background: transparent;
    transition: all 0.3s;
}

.story-item.active .story-img-wrapper {
    background: linear-gradient(45deg, var(--primary), #FFC107);
}

.story-img-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--surface);
}

/* ========== Story Label ========== */
.story-item span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-gray);
}

.story-item.active span {
    color: var(--text-dark);
    font-weight: 600;
}

/* ========== Main Scroll ========== */
.main-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    padding-bottom: 20px;
}

.main-scroll::-webkit-scrollbar {
    display: none;
}

/* ========== Category Section ========== */
.category-section {
    padding: 0 0px;
    margin-top: 22px;
}

/* ========== Category Header (Ultra Modern) ========== */
.category-ribbon {
    display: flex;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 20px;
    margin-top: 10px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    color: var(--text-dark);
}

.category-ribbon-name {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.8px;
    white-space: nowrap;
}

.category-ribbon-name::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-right: 12px;
    vertical-align: middle;
    margin-top: -4px;
}

.category-ribbon::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, rgba(0,0,0,0.06) 0%, transparent 100%);
    margin-left: 16px;
    border-radius: 2px;
}

.category-ribbon img {
    display: none;
}

/* ========== Menu Grid ========== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 20px;
}

/* ========== Grid Card ========== */
.grid-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: cardFade 0.3s ease backwards;
}

.grid-card:active {
    transform: scale(0.97);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* ========== Card Image ========== */
.card-img-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.grid-card:active img {
    transform: scale(1.04);
}

/* ========== Card Badges ========== */
.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

/* ========== Badge ========== */
.badge {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.badge svg {
    width: 12px;
    height: 12px;
    margin-right: 4px;
    flex-shrink: 0;
}

.badge-cal {
    color: var(--text-dark);
}

.badge-cal svg {
    stroke: var(--primary);
}

.badge-alg {
    color: #D32F2F;
    border: 1px solid rgba(211, 47, 47, 0.2);
}

.badge-alg svg {
}

.badge-icon-only {
    padding: 6px;
    border-radius: 50%;
}

.badge-icon-only svg {
    margin-right: 0;
}

/* ========== Card Content ========== */
.card-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ========== Card Title ========== */
.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== Card Description ========== */
.card-desc {
    font-size: 11px;
    color: var(--text-gray);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== Card Footer ========== */
.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========== Price ========== */
.price {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}


/* ========== Bottom Nav ========== */
.bottom-nav {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 400px;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    padding: 6px;
    gap: 6px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
    z-index: 60;
    border-radius: 999px;
}

/* ========== Nav Item ========== */
.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    font-family: 'Poppins', sans-serif;
    height: 48px;
    border-radius: 999px;
    background: transparent;
}

.nav-item:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.1);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
}

.nav-item span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

/* ========== Nav Waiter / Bill ========== */
#nav-waiter,
#nav-bill {
    flex: 1;
}

/* ========== Animations ========== */
@keyframes cardFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-card:nth-child(1) {
    animation-delay: 0s;
}

.grid-card:nth-child(2) {
    animation-delay: 0.03s;
}

.grid-card:nth-child(3) {
    animation-delay: 0.06s;
}

.grid-card:nth-child(4) {
    animation-delay: 0.09s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes sheetSlide {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ========== Filter / Product Modal ========== */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.product-modal.active {
    display: flex;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    z-index: 101;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    z-index: 102;
    background: var(--surface);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.1);
    animation: sheetSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85%;
    max-width: 480px;
    width: 100%;
    overflow-y: auto;
    scrollbar-width: none;
}

.modal-content::-webkit-scrollbar {
    display: none;
}

.modal-content::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #DDD;
    border-radius: 2px;
    margin: 10px auto 0;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--surface);
    border: 1px solid #eee;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
}

.modal-add-btn {
    background: var(--primary);
    color: #fff;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    font-family: 'Poppins', sans-serif;
    transition: background 0.2s;
}

.modal-add-btn:active {
    background: var(--primary-dark);
}

/* ========== Filter Chips ========== */
.filter-chip {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1.5px solid #eee;
    background: var(--bg-light);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.filter-chip svg {
    width: 16px;
    height: 16px;
}

.filter-chip.active {
    border-color: var(--primary) !important;
    background: var(--primary) !important;
    color: #fff !important;
}

/* ========== Allergen Badges ========== */
.allergen-badge {
    background: var(--bg-light);
    color: var(--text-gray);
    padding: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #eee;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.allergen-badge svg {
    width: 12px;
    height: 12px;
}

.allergen-text {
    display: none;
}

.modal-allergens .allergen-badge {
    width: auto;
    height: auto;
    padding: 5px 12px;
    border-radius: 999px;
}

.modal-allergens .allergen-text {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

/* ========== Calorie Badge Inline ========== */
.calorie-badge-inline {
    font-size: 0.55rem;
    background: #E8F5E9;
    color: #2E7D32;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(46, 125, 50, 0.15);
    font-weight: 700;
}

/* ========== New White Gallery Modal ========== */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 100%;
    z-index: 150;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
}

.gallery-modal.active {
    display: flex;
}

.gm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.gm-content-sheet {
    position: relative;
    z-index: 2;
    background: var(--surface);
    width: 100%;
    height: auto;
    max-height: 94%;
    border-radius: 36px 36px 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    animation: sheetSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sheetSlideUp {
    to { transform: translateY(0); }
}

.gm-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-dark);
    transition: 0.2s;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gm-close-btn:active {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(0.95);
}

.gm-scroll-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px 20px;
    scrollbar-width: none;
}

.gm-scroll-body::-webkit-scrollbar {
    display: none;
}

.gm-image-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    background: #f8f8f8;
}

.gm-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gm-text-center {
    text-align: center;
    margin-bottom: 20px;
}

.gm-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.gm-desc {
    font-size: 0.95rem;
    color: var(--text-gray);
    line-height: 1.6;
    margin: 0 auto;
    max-width: 90%;
}

.gm-details-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.gm-detail-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    background: var(--bg-light);
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid #eee;
}

.gm-detail-item svg {
    stroke: var(--primary);
}

.gm-allergens-section {
    text-align: center;
    margin-top: 10px;
}

.gm-allergens-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.gm-allergens-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.gm-allergen-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-gray);
}

.gm-allergen-badge-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    color: var(--primary);
}

.gm-allergen-badge-icon svg {
    width: 20px;
    height: 20px;
}

.gm-sticky-footer {
    background: var(--text-dark);
    color: #fff;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 20px 20px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.gm-price-label {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.8;
}

.gm-price-value {
    font-size: 1.4rem;
    font-weight: 800;
}

/* ========== Info Footer ========== */
.info-footer-text {
    padding: 24px 16px 12px;
    text-align: center;
    color: #aaa;
    font-size: 0.55rem;
    line-height: 1.7;
}

/* ========== Toast Notification ========== */
.toast-notification {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-dark);
    color: #fff;
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    z-index: 200;
    white-space: nowrap;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== SweetAlert2 Overrides ========== */
.swal2-popup {
    border-radius: 24px !important;
    font-family: 'Poppins', sans-serif !important;
}

.swal2-styled.swal2-confirm {
    background-color: var(--primary) !important;
    border-radius: var(--radius-md) !important;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 600 !important;
}

.swal2-styled.swal2-cancel {
    border-radius: var(--radius-md) !important;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 600 !important;
}

.swal2-title {
    font-family: 'Poppins', sans-serif !important;
    font-weight: 700 !important;
    color: var(--text-dark) !important;
}

.swal2-html-container {
    font-family: 'Poppins', sans-serif !important;
    color: var(--text-gray) !important;
}

/* ========== Legacy / Hidden ========== */
.sidebar {
    display: none !important;
}

.header {
    display: contents;
}

.content-wrapper {
    display: contents;
}

/* ========== Responsive ========== */
@media (max-width: 480px) {
    body {
        align-items: flex-start;
    }

    .app-container {
        box-shadow: none;
    }
}
