/* ========== MENU PAGE STYLES ========== */

/* Cart sticky bar */
.cart-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 200;
    background: rgba(8,10,18,0.97);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(245,166,35,0.2);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

.cart-bar.visible { transform: translateY(0); }

/* ── Mini drawer ── */
.cart-drawer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.38s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
    opacity: 0;
    border-bottom: 1px solid rgba(245,166,35,0.08);
}

.cart-drawer.open {
    max-height: 320px;
    opacity: 1;
}

.cart-drawer__handle {
    width: 36px; height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
    margin: 12px auto 0;
}

.cart-drawer__label {
    font-size: 0.7rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--thai-gold);
    padding: 14px 28px 8px;
    opacity: 0.8;
}

.cart-drawer__list {
    list-style: none;
    padding: 0 28px;
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(245,166,35,0.2) transparent;
}

.cart-drawer__list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    gap: 10px;
    font-size: 0.9rem;
}

.cart-drawer__list li:last-child { border-bottom: none; }

.cart-drawer__item-name { flex: 1; font-weight: 400; }
.cart-drawer__item-qty  { opacity: 0.45; font-size: 0.82rem; font-weight: 300; white-space: nowrap; }
.cart-drawer__item-price { color: var(--thai-gold); font-weight: 700; font-family: 'Playfair Display', serif; white-space: nowrap; }

.cart-drawer__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 28px 16px;
    border-top: 1px solid rgba(245,166,35,0.12);
}

.cart-drawer__total-label { font-size: 0.75rem; letter-spacing: 2px; text-transform: uppercase; opacity: 0.5; }
.cart-drawer__total-val   { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 900; color: var(--thai-gold); }

.cart-drawer__controls {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50px;
    overflow: hidden;
    flex-shrink: 0;
    margin-left: 8px;
}

.cart-drawer__ctrl-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
    font-family: 'Kanit', sans-serif;
}

/* ✕ button (qty=1) turns red on hover, − stays neutral */
.cart-drawer__ctrl-btn:first-child:hover {
    background: rgba(200,16,46,0.2);
    color: #ff6b8a;
}

.cart-drawer__ctrl-btn:last-child:hover {
    background: rgba(245,166,35,0.15);
    color: var(--thai-gold);
}

.cart-drawer__ctrl-qty {
    min-width: 24px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--thai-white);
}

/* ── Bottom row ── */
.cart-bar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    cursor: pointer;
    user-select: none;
    flex: 1;
    /* leave space for the button */
    padding-right: 160px;
    transition: background 0.2s;
}

.cart-bar__row:hover { background: rgba(255,255,255,0.03); }

.cart-bar__info { display: flex; flex-direction: column; gap: 2px; }
.cart-bar__count { font-size: 0.75rem; letter-spacing: 2px; text-transform: uppercase; color: var(--thai-gold); }
.cart-bar__total { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 900; }

.cart-bar__chevron {
    font-size: 1.6rem;
    color: rgba(255,255,255,0.3);
    transition: transform 0.3s ease, color 0.2s;
    line-height: 1;
}

.cart-bar__chevron.up {
    transform: rotate(180deg);
    color: var(--thai-gold);
}

/* Position button absolutely so row click area stays clean */
.cart-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
}

.cart-bar__btn {
    position: absolute;
    right: 10px;
    left: 10px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    background: var(--thai-red);
    color: white;
    border: none;
    padding: 14px 15px;
    border-radius: 50px;
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 20px rgba(200,16,46,0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    z-index: 1;
    max-width: 600px;
}

.cart-bar__btn--open {
    max-width: 200px;
    left: unset;
    right: 200px;
}

.cart-bar__btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(200,16,46,0.55); }

@media (max-width: 480px) {
    .cart-bar__row { padding-right: 130px; }
    .cart-bar__btn {
        padding: 12px 18px;
        font-size: 0.75rem;
        text-wrap: auto;
        text-align: center;
    }

    .cart-bar__btn--open {
        right: 30px;
    }
}

/* Menu hero */
.menu-hero {
    padding: calc(90px + env(safe-area-inset-top)) 60px 50px;
    background:
            radial-gradient(ellipse 70% 60% at 50% 0%, rgba(200,16,46,0.15) 0%, transparent 60%),
            linear-gradient(135deg, var(--thai-dark) 0%, #12152a 100%);
    text-align: center;
    border-bottom: 1px solid rgba(245,166,35,0.1);
}

.menu-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 14px;
    animation: fadeUp 0.7s ease both;
}

.menu-hero h1 span { color: var(--thai-gold); }

.menu-hero p {
    opacity: 0.6;
    font-weight: 300;
    font-size: 1rem;
    animation: fadeUp 0.7s 0.1s ease both;
}

/* Category tabs */
.category-nav {
    position: sticky;
    top: calc(80px + env(safe-area-inset-top));
    z-index: 50;
    background: rgba(13,15,26,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(245,166,35,0.1);
    padding: 0 40px;
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-nav::-webkit-scrollbar { display: none; }

.cat-tab {
    padding: 16px 24px;
    font-family: 'Kanit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.cat-tab:hover { color: rgba(255,255,255,0.8); }
.cat-tab.active { color: var(--thai-gold); border-bottom-color: var(--thai-gold); }

/* Menu sections */
.menu-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 40px 140px;
}

.menu-section { margin-bottom: 60px; }

.menu-section__title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-section__title span { font-size: 2rem; }

.menu-section__desc {
    font-size: 0.88rem;
    opacity: 0.5;
    font-weight: 300;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(245,166,35,0.1);
}

.dishes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Dish card */
.dish-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border: 1px solid rgba(245,166,35,0.1);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.dish-card:hover {
    transform: translateY(-4px);
    border-color: rgba(245,166,35,0.3);
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}

.dish-card__img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    background: rgba(255,255,255,0.04);
}

.dish-card__img-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    background: linear-gradient(145deg, rgba(245,166,35,0.06), rgba(200,16,46,0.06));
}

.dish-card__body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dish-card__tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.dish-tag {
    font-size: 0.67rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 2px 9px;
    border-radius: 20px;
    font-weight: 600;
}

.dish-tag--spicy { background: rgba(255,107,53,0.18); border: 1px solid rgba(255,107,53,0.3); color: #ff8c61; }
.dish-tag--vegan { background: rgba(45,122,79,0.18); border: 1px solid rgba(45,122,79,0.35); color: #5dd896; }
.dish-tag--popular { background: rgba(245,166,35,0.15); border: 1px solid rgba(245,166,35,0.3); color: var(--thai-gold); }
.dish-tag--new { background: rgba(200,16,46,0.15); border: 1px solid rgba(200,16,46,0.3); color: #ff6b8a; }
.dish-tag--gluten { background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); color: rgba(255,255,255,0.55); }

.dish-card__name {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.dish-card__desc {
    font-size: 0.85rem;
    opacity: 0.6;
    line-height: 1.6;
    font-weight: 300;
    flex: 1;
    margin-bottom: 18px;
}

.dish-card__allergens {
    font-size: 0.72rem;
    opacity: 0.38;
    margin-bottom: 16px;
    font-weight: 300;
    letter-spacing: 0.3px;
}

.dish-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dish-card__price {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--thai-gold);
}

.dish-card__price span {
    font-size: 0.85rem;
    font-family: 'Kanit', sans-serif;
    font-weight: 300;
    opacity: 0.6;
}

/* Add to cart button */
.add-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--thai-red);
    border: none;
    color: white;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 4px 14px rgba(200,16,46,0.4);
    flex-shrink: 0;
    position: relative;
}

.add-btn:hover { transform: scale(1.12); box-shadow: 0 8px 22px rgba(200,16,46,0.55); }
.add-btn:active { transform: scale(0.95); }

/* Quantity control (replaces + button when item in cart) */
.qty-control {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(245,166,35,0.2);
    border-radius: 50px;
    overflow: hidden;
}

.qty-btn {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    color: var(--thai-white);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover { background: rgba(255,255,255,0.08); }

.qty-num {
    min-width: 28px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--thai-gold);
}

/* ========== ORDER MODAL ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    z-index: 500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: #13162a;
    border: 1px solid rgba(245,166,35,0.15);
    border-radius: 28px 28px 0 0;
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 32px 36px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
    transform: translateY(40px);
    transition: transform 0.35s cubic-bezier(0.34,1.2,0.64,1);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal__handle {
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    margin: 0 auto 28px;
}

.modal__title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 6px;
}

.modal__subtitle { font-size: 0.85rem; opacity: 0.5; font-weight: 300; margin-bottom: 28px; }

/* Cart items in modal */
.cart-items { margin-bottom: 24px; }

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    gap: 12px;
}

.cart-item__name { font-size: 0.95rem; font-weight: 600; flex: 1; }
.cart-item__qty { font-size: 0.85rem; opacity: 0.5; font-weight: 300; }
.cart-item__price { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; color: var(--thai-gold); }

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-top: 1px solid rgba(245,166,35,0.15);
    margin-bottom: 28px;
}

.cart-total__label { font-size: 0.85rem; letter-spacing: 2px; text-transform: uppercase; opacity: 0.6; }
.cart-total__value { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 900; color: var(--thai-gold); }

/* Form fields */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--thai-gold);
    margin-bottom: 8px;
    font-weight: 600;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 13px 16px;
    color: var(--thai-white);
    font-family: 'Kanit', sans-serif;
    font-size: 0.95rem;
    font-weight: 300;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    -webkit-appearance: none;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: rgba(245,166,35,0.5);
    background: rgba(255,255,255,0.07);
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-select option { background: #13162a; color: var(--thai-white); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-submit {
    width: 100%;
    background: var(--thai-red);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 50px;
    font-family: 'Kanit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 24px rgba(200,16,46,0.4);
    margin-top: 8px;
}

.form-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(200,16,46,0.55); }
.form-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.modal__close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255,255,255,0.08);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal__close:hover { background: rgba(255,255,255,0.14); }

/* Success state */
.order-success {
    text-align: center;
    padding: 20px 0;
    display: none;
}

.order-success.show { display: block; }
.order-success__icon { font-size: 4rem; margin-bottom: 20px; animation: float 3s ease-in-out infinite; }
.order-success__title { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 900; margin-bottom: 12px; }
.order-success__msg { opacity: 0.6; font-weight: 300; line-height: 1.7; }

/* QR section */
.qr-section {
    background: rgba(255,255,255,0.025);
    border-top: 1px solid rgba(245,166,35,0.1);
    padding: 60px 40px;
    text-align: center;
}

.qr-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 10px;
}

.qr-section p { opacity: 0.55; font-weight: 300; font-size: 0.9rem; margin-bottom: 30px; }

#qr-canvas, #qr-canvas img {
    display: inline-block;
    padding: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.qr-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    color: var(--thai-gold);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.8;
    transition: opacity 0.2s;
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'Kanit', sans-serif;
}

.qr-download:hover { opacity: 1; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .menu-hero { padding: calc(80px + env(safe-area-inset-top)) 24px 40px; }
    .category-nav { padding: 0 16px; }
    .menu-page { padding: 30px 20px 120px; }
    .dishes-grid { grid-template-columns: 1fr; }
    .cart-bar { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
    .modal { padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; }
    .form-row { grid-template-columns: 1fr; }
    .qr-section { padding: 40px 20px; }
}

/* ── Extra dish tags ── */
.dish-tag--hot        { background: rgba(220,60,0,0.18);  border: 1px solid rgba(220,60,0,0.35);  color: #ff7043; }
.dish-tag--veryhot    { background: rgba(180,0,0,0.2);    border: 1px solid rgba(180,0,0,0.4);    color: #ff3d3d; }
.dish-tag--vegetarian { background: rgba(80,160,60,0.18); border: 1px solid rgba(80,160,60,0.35); color: #81c784; }

/* ── Ingredients line ── */
.dish-card__ingredients {
    font-size: 0.78rem;
    line-height: 1.55;
    opacity: 0.55;
    font-weight: 300;
    margin-bottom: 8px;
    font-style: italic;
}

.dish-card__ingredients span {
    font-style: normal;
    font-weight: 600;
    opacity: 0.8;
    color: var(--thai-gold);
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}