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

:root {
    --kitchen-amber: #e8892a;
    --kitchen-orange: #d47a24;
    --kitchen-gold: #fbb03b;
    --kitchen-primary: #d47a24;
    --kitchen-accent: #fbb03b;
    --kitchen-dark: #1a0a02;
    --kitchen-brown: #2d1606;
    --kitchen-cream: #fff8ef;
    --kitchen-sand: #f3e4d0;
    --kitchen-copper: #b87333;
}

body {
    font-family: 'Nunito', system-ui, sans-serif;
}

h1, h2, h3, .brand-font {
    font-family: 'Cormorant Garamond', Georgia, serif;
}

body.admin-body {
    background: var(--kitchen-sand);
    min-height: 100vh;
}

body.customer-body {
    background:
        radial-gradient(ellipse at top, rgba(251, 176, 59, 0.18), transparent 55%),
        linear-gradient(165deg, #fff8ef 0%, #f6e6d2 42%, #edd4b4 100%);
    min-height: 100vh;
}

.brand-logo,
.brand-logo-lg,
.brand-logo-xl,
.brand-logo-sidebar,
.brand-logo-footer {
    display: block;
    aspect-ratio: 1 / 1;
    max-width: 100%;
    object-fit: contain;
    border-radius: 50%;
    flex: 0 0 auto;
}

.brand-logo {
    width: 80px;
    height: 80px;
    box-shadow: 0 2px 6px rgba(26, 10, 2, 0.22);
}

.brand-logo-lg {
    width: 64px;
    height: 64px;
    box-shadow: 0 4px 12px rgba(26, 10, 2, 0.25);
}

.brand-logo-xl {
    width: clamp(56px, 10vw, 72px);
    height: auto;
    box-shadow: 0 4px 14px rgba(26, 10, 2, 0.25);
}

.brand-logo-sidebar {
    width: 48px;
    height: 48px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.brand-logo-footer {
    width: 1000px;
    height: 100px;
    opacity: .95;
}

.kitchen-nav .navbar-brand {
    min-width: 0;
    max-width: calc(100% - 360px);
    margin-right: .5rem;
}

.customer-nav-actions {
    flex: 0 0 auto;
}

.lookup-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    color: var(--kitchen-brown);
    background: rgba(251, 176, 59, .24);
    font-size: 1.45rem;
}

.brand-copy {
    min-width: 0;
}

.brand-title,
.brand-tagline {
    white-space: nowrap;
}

.sidebar {
    width: 250px;
    min-height: 100vh;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--kitchen-dark) 0%, var(--kitchen-brown) 100%) !important;
}

.sidebar .nav-link { border-radius: .5rem; }
.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background: rgba(251, 176, 59, 0.18);
    color: var(--kitchen-gold) !important;
}

.kitchen-nav {
    background: linear-gradient(90deg, var(--kitchen-dark) 0%, var(--kitchen-brown) 55%, #4a2a12 100%);
    border-bottom: 3px solid var(--kitchen-gold);
}

.stat-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 4px 16px rgba(26, 10, 2, 0.08);
    background: #fff;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--kitchen-orange);
}

.menu-card {
    border: 1px solid #ead7bf;
    border-radius: 1rem;
    background: #fff;
    transition: box-shadow .2s, transform .2s;
}

.menu-card:hover {
    box-shadow: 0 10px 28px rgba(212, 122, 36, 0.18);
    transform: translateY(-2px);
}

.menu-card .price-tag {
    color: var(--kitchen-orange);
    font-weight: 700;
}

.btn-kitchen {
    background: linear-gradient(135deg, var(--kitchen-gold), var(--kitchen-orange));
    border: none;
    color: #1a0a02;
    font-weight: 700;
}

.btn-kitchen:hover {
    background: linear-gradient(135deg, #ffc857, #c86a1a);
    color: #1a0a02;
}

.btn-outline-kitchen {
    border: 2px solid var(--kitchen-orange);
    color: var(--kitchen-brown);
    font-weight: 600;
}

.btn-outline-kitchen:hover {
    background: var(--kitchen-orange);
    color: #fff;
}

.table thead {
    background: #f3e0c8;
    color: var(--kitchen-brown);
}

.badge-pending { background: #f0ad4e; }
.badge-accepted { background: #5bc0de; }
.badge-confirmed { background: #0275d8; }
.badge-delivered { background: #5cb85c; }
.badge-cancelled { background: #d9534f; }

.qr-box {
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    border: 2px dashed var(--kitchen-orange);
}

.page-hero-title {
    color: var(--kitchen-brown);
    font-weight: 700;
}

.page-hero-sub {
    color: #6b4a30;
}

.card {
    border-color: #ead7bf !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--kitchen-gold);
    box-shadow: 0 0 0 0.2rem rgba(251, 176, 59, 0.25);
}

.admin-topbar {
    background: #fffdf9;
    border-bottom: 1px solid #ead7bf !important;
}

.footer-brand {
    color: #6b4a30;
}

@media (max-width: 768px) {
    .sidebar { width: 100%; min-height: auto; }
    #wrapper { flex-direction: column; }
    .brand-logo { width: 32px; height: 32px; }
    .brand-logo-lg { width: 56px; height: 56px; }
    .brand-logo-sidebar { width: 42px; height: 42px; }

    .kitchen-nav .navbar-brand {
        max-width: calc(100% - 170px);
    }

    .customer-nav-actions {
        gap: .3rem !important;
    }

    .customer-nav-actions .form-select {
        width: 54px !important;
        padding-right: 1.5rem;
    }

    .customer-nav-btn {
        display: inline-grid;
        place-items: center;
        width: 32px;
        height: 32px;
        padding: 0;
    }

    .customer-nav-btn span {
        display: none;
    }
}

@media (max-width: 390px) {
    .kitchen-nav .container {
        flex-wrap: nowrap;
        padding-inline: .75rem;
    }

    .kitchen-nav .navbar-brand {
        gap: .4rem !important;
    }

    .brand-logo {
        width: 30px;
        height: 30px;
    }

    .brand-title {
        font-size: 1.05rem !important;
    }

    .brand-tagline {
        display: none !important;
    }

    .brand-logo-xl {
        width: 52px;
    }
}

@media (max-height: 480px) and (orientation: landscape) {
    .brand-logo-xl {
        width: 52px;
    }

    .brand-logo-lg {
        width: 48px;
        height: 48px;
    }
}

/* Two-way order chat */
.chat-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1080;
    font-family: "Nunito", system-ui, sans-serif;
}

.chat-launcher {
    position: relative;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-left: auto;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, var(--kitchen-orange), var(--kitchen-brown));
    box-shadow: 0 8px 25px rgba(74, 41, 20, .3);
    font-size: 1.55rem;
    transition: transform .2s ease, box-shadow .2s ease;
}

.chat-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(74, 41, 20, .4);
}

.chat-launcher:focus-visible,
.chat-close:focus-visible,
.chat-back:focus-visible,
.chat-send:focus-visible {
    outline: 3px solid rgba(251, 176, 59, .45);
    outline-offset: 2px;
}

.chat-unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    border: 2px solid #fff;
    border-radius: 12px;
    color: #fff;
    background: #dc3545;
    font-size: .72rem;
    font-weight: 800;
    line-height: 19px;
}

.chat-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    display: flex;
    flex-direction: column;
    width: min(380px, calc(100vw - 28px));
    height: min(590px, calc(100vh - 120px));
    overflow: hidden;
    border: 1px solid #ead7bf;
    border-radius: 18px;
    background: #fffdf9;
    box-shadow: 0 14px 45px rgba(57, 31, 15, .25);
}

.chat-panel-admin {
    width: min(410px, calc(100vw - 28px));
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    padding: 12px 14px;
    color: #fff;
    background: linear-gradient(120deg, var(--kitchen-brown), #7a421f);
}

.chat-header > div,
.chat-heading {
    flex: 1;
    min-width: 0;
}

.chat-header strong,
.chat-header small {
    display: block;
}

.chat-header small {
    overflow: hidden;
    color: #f5debf;
    font-size: .76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-close,
.chat-back {
    display: grid;
    flex: 0 0 34px;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.chat-list-view,
.chat-thread-view {
    min-height: 0;
    flex: 1;
}

.chat-thread-view {
    display: flex;
    flex-direction: column;
}

.chat-search-wrap {
    padding: 10px;
    border-bottom: 1px solid #f0dfca;
}

.chat-search {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #dcc4a7;
    border-radius: 10px;
    outline: none;
}

.chat-search:focus {
    border-color: var(--kitchen-gold);
    box-shadow: 0 0 0 3px rgba(251, 176, 59, .18);
}

.chat-conversations {
    height: calc(100% - 59px);
    overflow-y: auto;
}

.chat-conversation {
    display: block;
    width: 100%;
    padding: 11px 13px;
    border: 0;
    border-bottom: 1px solid #f2e4d3;
    color: #3f2a1d;
    background: transparent;
    text-align: left;
}

.chat-conversation:hover {
    background: #fff5e7;
}

.chat-conversation-top,
.chat-conversation-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-conversation-top span,
.chat-conversation-bottom {
    color: #8a6b55;
    font-size: .72rem;
}

.chat-conversation-preview {
    overflow: hidden;
    margin: 3px 0;
    color: #6d5545;
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-list-unread {
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 11px;
    color: #fff;
    background: var(--kitchen-orange);
    font-weight: 700;
    line-height: 21px;
    text-align: center;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 12px;
    background:
        radial-gradient(circle at 10% 20%, rgba(251, 176, 59, .07), transparent 30%),
        #fffaf3;
}

.chat-message-row {
    display: flex;
    margin-bottom: 9px;
}

.chat-message-own {
    justify-content: flex-end;
}

.chat-message-bubble {
    max-width: 82%;
    padding: 8px 10px 6px;
    border-radius: 13px;
    box-shadow: 0 1px 2px rgba(54, 32, 18, .08);
}

.chat-message-own .chat-message-bubble {
    border-bottom-right-radius: 4px;
    color: #fff;
    background: var(--kitchen-brown);
}

.chat-message-other .chat-message-bubble {
    border: 1px solid #ead7bf;
    border-bottom-left-radius: 4px;
    color: #3d2b20;
    background: #fff;
}

.chat-message-sender {
    margin-bottom: 2px;
    color: var(--kitchen-gold);
    font-size: .68rem;
    font-weight: 800;
}

.chat-message-other .chat-message-sender {
    color: var(--kitchen-orange);
}

.chat-message-body {
    overflow-wrap: anywhere;
    font-size: .88rem;
    line-height: 1.35;
    white-space: pre-wrap;
}

.chat-message-meta {
    margin-top: 3px;
    color: rgba(255, 255, 255, .68);
    font-size: .62rem;
    text-align: right;
}

.chat-message-other .chat-message-meta {
    color: #9a806f;
}

.chat-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #ead7bf;
    background: #fff;
}

.chat-input {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    resize: none;
    padding: 9px 11px;
    border: 1px solid #dcc4a7;
    border-radius: 12px;
    font-size: .88rem;
    outline: none;
}

.chat-input:focus {
    border-color: var(--kitchen-gold);
    box-shadow: 0 0 0 3px rgba(251, 176, 59, .16);
}

.chat-send {
    display: grid;
    flex: 0 0 40px;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--kitchen-orange);
}

.chat-send:disabled {
    opacity: .55;
}

.chat-hint,
.chat-closed,
.chat-connection-status,
.chat-loading,
.chat-empty-list {
    padding: 6px 10px;
    color: #856c5b;
    background: #fff;
    font-size: .68rem;
    text-align: center;
}

.chat-closed {
    padding: 10px;
    color: #6c521e;
    background: #fff3cd;
}

.chat-connection-status {
    color: #0c5460;
    background: #d1ecf1;
}

.chat-status-error {
    color: #842029;
    background: #f8d7da;
}

.chat-empty {
    display: grid;
    min-height: 100%;
    place-content: center;
    color: #9a806f;
    text-align: center;
}

.chat-empty i {
    color: var(--kitchen-gold);
    font-size: 2rem;
}

.chat-empty p {
    max-width: 230px;
    margin: 8px 0 0;
    font-size: .82rem;
}

@media (max-width: 575.98px) {
    .chat-widget {
        right: 12px;
        bottom: 12px;
    }

    .chat-panel {
        position: fixed;
        inset: 8px 8px 80px;
        width: auto;
        height: auto;
        border-radius: 15px;
    }

    .chat-launcher {
        width: 54px;
        height: 54px;
    }
}

/* Order form: sticky cart total (mobile) */
.order-sticky-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1020;
    display: none;
    gap: .75rem;
    align-items: center;
    padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 248, 239, 0.97);
    border-top: 1px solid rgba(45, 22, 6, 0.12);
    box-shadow: 0 -8px 24px rgba(26, 10, 2, 0.12);
}

@media (max-width: 767.98px) {
    .order-sticky-bar {
        display: flex;
    }

    body.customer-body:has(.order-sticky-bar) {
        padding-bottom: 5.5rem;
    }

    body.customer-body:has(.order-sticky-bar) .chat-widget {
        bottom: 88px;
    }
}

/* Coupons / festival promo strip */
.promo-banner {
    display: grid;
    gap: .75rem;
}

@media (min-width: 768px) {
    .promo-banner {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

.promo-banner-item {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe8c7 55%, #f7d9a8 100%);
    border: 1px solid rgba(212, 122, 36, 0.28);
    border-radius: 1rem;
    padding: .9rem 1rem;
}

.promo-banner-kicker {
    font-size: .72rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--kitchen-copper);
    font-weight: 700;
    margin-bottom: .2rem;
}

.landing-hero {
    padding: 1.5rem 0 0.5rem;
}

.landing-about {
    padding: 1rem 0 2rem;
}
