/*
 * Gri Coffee Mobile-First QR Menu Styling - Upgraded Premium App UX
 */

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

:root {
    --bg-qr: #F9F6F0;           /* Cream */
    --bg-qr-card: #FFFFFF;
    --text-qr: #2D1F18;         /* Espresso */
    --text-qr-muted: #8E7C74;
    --qr-accent: #C5A880;       /* Gold */
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --qr-border: rgba(90, 62, 43, 0.12);
    --tap-height: 48px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --radius-md: 12px;
    --radius-sm: 6px;
}

/* Dark Theme Support */
[data-theme="dark"] {
    --bg-qr: #121212;
    --bg-qr-card: #1C1C1E;
    --text-qr: #F9F6F0;
    --text-qr-muted: #A89C94;
    --qr-border: rgba(249, 246, 240, 0.08);
}

/* Accessibility Large Text Mode */
body.accessibility-mode {
    font-size: 1.15rem;
}
body.accessibility-mode h1 { font-size: 2.2rem; }
body.accessibility-mode h2 { font-size: 1.8rem; }
body.accessibility-mode h3 { font-size: 1.4rem; }

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-qr);
    color: var(--text-qr);
    line-height: 1.5;
    padding-bottom: 95px; /* Space for sticky bottom navigation */
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Top Branding Bar */
.qr-header {
    background-color: var(--bg-qr-card);
    padding: 16px 20px;
    text-align: center;
    border-bottom: 1px solid var(--qr-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.qr-logo {
    text-transform: uppercase;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: 0.05em;
}
.qr-logo span { color: var(--qr-accent); }

/* Table Badge info */
.table-badge {
    background-color: var(--text-qr);
    color: var(--bg-qr);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-block;
    margin-top: 5px;
    text-transform: uppercase;
}

/* Interactive Campaign Slider Banner */
.qr-campaign-slider {
    margin: 15px 20px;
    background: linear-gradient(135deg, #2D1F18 0%, #1A1A1A 100%);
    border-radius: var(--radius-md);
    padding: 20px;
    color: #F9F6F0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(45, 31, 24, 0.15);
}
.qr-campaign-slider::after {
    content: '☕';
    position: absolute;
    right: -10px;
    bottom: -15px;
    font-size: 5rem;
    opacity: 0.08;
    transform: rotate(-15deg);
}
.qr-campaign-slider h3 {
    color: var(--qr-accent);
    font-size: 1.15rem;
    text-transform: uppercase;
    margin-bottom: 5px;
}
.qr-campaign-slider p {
    font-size: 0.8rem;
    opacity: 0.85;
    line-height: 1.4;
}

/* Horizontal scrolling categories */
.qr-category-bar {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    padding: 12px 20px;
    background-color: var(--bg-qr-card);
    border-bottom: 1px solid var(--qr-border);
    position: sticky;
    top: 98px;
    z-index: 99;
    gap: 8px;
    scrollbar-width: none;
}
.qr-category-bar::-webkit-scrollbar { display: none; }

.qr-cat-pill {
    padding: 8px 16px;
    border-radius: 50px;
    background-color: var(--bg-qr);
    border: 1px solid var(--qr-border);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.qr-cat-pill.active {
    background-color: var(--qr-accent);
    color: #1A1A1A;
    border-color: var(--qr-accent);
}

/* Search Box */
.qr-search-wrapper {
    padding: 15px 20px 5px 20px;
}
.qr-search-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--qr-border);
    outline: none;
    font-size: 0.9rem;
    background-color: var(--bg-qr-card);
    color: var(--text-qr);
    transition: var(--transition);
}
.qr-search-input:focus {
    border-color: var(--qr-accent);
    box-shadow: 0 0 0 3px rgba(197, 168, 128, 0.15);
}

/* Menu Items */
.qr-menu-section {
    padding: 20px;
}
.qr-section-title {
    font-size: 1.25rem;
    margin-bottom: 15px;
    border-left: 3px solid var(--qr-accent);
    padding-left: 10px;
    text-transform: uppercase;
    color: var(--text-qr);
}

.qr-item-card {
    background-color: var(--bg-qr-card);
    border: 1px solid var(--qr-border);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.qr-item-card:active {
    transform: scale(0.98);
}

.qr-item-img {
    width: 85px;
    height: 85px;
    object-fit: cover;
    border-radius: 8px;
    background-color: var(--bg-qr);
}

.qr-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.qr-item-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.qr-item-desc {
    font-size: 0.78rem;
    color: var(--text-qr-muted);
    margin-bottom: 8px;
    line-height: 1.4;
}

.qr-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}
.qr-badge {
    font-size: 0.65rem;
    padding: 3px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
}
.qr-badge.allergen { background-color: rgba(231, 76, 60, 0.12); color: #e74c3c; }
.qr-badge.cal { background-color: rgba(90, 62, 43, 0.08); color: var(--text-qr); }

.qr-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.qr-item-price {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
}

/* Stepper Stepping Counters */
.qr-stepper {
    display: flex;
    align-items: center;
    border: 1px solid var(--qr-accent);
    border-radius: 50px;
    overflow: hidden;
    height: 32px;
    background-color: var(--bg-qr-card);
}
.qr-stepper button {
    border: none;
    background: none;
    width: 32px;
    height: 100%;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-qr);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.qr-stepper button:active {
    background-color: rgba(197, 168, 128, 0.15);
}
.qr-stepper span {
    width: 25px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
}
.btn-add-stepper {
    background-color: var(--text-qr);
    color: var(--bg-qr);
    border: none;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-add-stepper:active {
    transform: scale(0.95);
}

/* Bottom App Navigation Bar */
.qr-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background-color: var(--bg-qr-card);
    border-top: 1px solid var(--qr-border);
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
}
.qr-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-qr-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.qr-nav-item.active {
    color: var(--qr-accent);
}
.qr-nav-icon {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

/* Floating Cart Trigger Badge */
.floating-cart-badge {
    position: fixed;
    bottom: 85px;
    left: 20px;
    right: 20px;
    background-color: var(--text-qr);
    color: var(--bg-qr);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    cursor: pointer;
    animation: popUp 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
@keyframes popUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Bottom Drawer Slide-up popup */
.qr-drawer-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1050;
    backdrop-filter: blur(3px);
}
.qr-drawer-overlay.open {
    display: block;
}
.qr-bottom-drawer {
    position: fixed;
    bottom: -100%; left: 0; right: 0;
    background-color: var(--bg-qr-card);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 1060;
    padding: 30px 20px 40px 20px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
    transition: bottom 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-height: 80vh;
    overflow-y: auto;
}
.qr-bottom-drawer.open {
    bottom: 0;
}
.drawer-handle {
    width: 40px; height: 5px;
    background-color: var(--qr-border);
    border-radius: 10px;
    margin: -15px auto 20px auto;
}

/* Wi-Fi & Static Boxes */
.qr-wifi-box {
    margin: 15px 20px;
    padding: 20px;
    background-color: var(--bg-qr-card);
    border: 1px dashed var(--qr-accent);
    border-radius: var(--radius-md);
    text-align: center;
}

.qr-social-btn {
    display: inline-flex;
    width: 44px; height: 44px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-qr-card);
    border: 1px solid var(--qr-border);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}
.qr-social-btn:hover { background-color: var(--qr-accent); color: #1A1A1A; }

/* ========================================== */
/* APPLIKE SPLASH SCREEN */
/* ========================================== */
.app-splash {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-qr);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.app-splash.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.app-splash-logo {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-qr);
    margin-bottom: 20px;
    animation: logoPulse 2s infinite ease-in-out;
}
.app-splash-logo span {
    color: var(--qr-accent);
}
.app-splash-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--qr-border);
    border-top: 3px solid var(--qr-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.05); opacity: 1; }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================== */
/* INSTAGRAM-STYLE STORIES */
/* ========================================== */
.qr-stories-container {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 15px 20px;
    background-color: var(--bg-qr-card);
    border-bottom: 1px solid var(--qr-border);
    scrollbar-width: none;
}
.qr-stories-container::-webkit-scrollbar {
    display: none;
}
.qr-story-ring {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.qr-story-ring:active {
    transform: scale(0.92);
}
.story-ring-img-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qr-story-ring.viewed .story-ring-img-wrapper {
    background: var(--text-qr-muted);
}
.story-ring-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--bg-qr-card);
    overflow: hidden;
}
.story-ring-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.story-ring-title {
    font-size: 0.68rem;
    font-weight: 600;
    margin-top: 6px;
    color: var(--text-qr);
    max-width: 70px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Story Viewer Modal */
.story-viewer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #000;
    z-index: 10000;
    display: none;
    flex-direction: column;
    justify-content: space-between;
}
.story-viewer.active {
    display: flex;
}
.story-progress-container {
    position: absolute;
    top: 15px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 10002;
}
.story-progress-bg {
    flex: 1;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}
.story-progress-fill {
    height: 100%;
    width: 0%;
    background-color: #FFFFFF;
}
.story-viewer-header {
    position: absolute;
    top: 25px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10002;
}
.story-viewer-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #FFFFFF;
}
.story-viewer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--qr-accent);
}
.story-viewer-name {
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.story-close-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 1.8rem;
    cursor: pointer;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    line-height: 1;
}
.story-content-body {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.story-content-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.story-overlay-card {
    position: absolute;
    bottom: 40px;
    left: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    color: #FFFFFF;
    text-align: center;
    animation: slideUp 0.3s ease-out;
}
.story-overlay-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--qr-accent);
    margin-bottom: 8px;
}
.story-overlay-desc {
    font-size: 0.85rem;
    line-height: 1.4;
    opacity: 0.9;
}
.story-cta-btn {
    display: inline-flex;
    margin-top: 15px;
    background-color: var(--qr-accent);
    color: #121212 !important;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    transition: transform 0.2s;
    border: none;
    cursor: pointer;
}
.story-cta-btn:active {
    transform: scale(0.95);
}
.story-nav-tap {
    position: absolute;
    top: 60px;
    bottom: 120px;
    width: 40%;
    z-index: 10001;
}
.story-nav-tap.left {
    left: 0;
}
.story-nav-tap.right {
    right: 0;
}

/* ========================================== */
/* STARBUCKS-STYLE PRODUCT DETAIL DRAWER */
/* ========================================== */
.detail-drawer-img-container {
    width: 100%;
    height: 220px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
    background-color: var(--bg-qr);
}
.detail-drawer-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.detail-drawer-price-tag {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: var(--text-qr);
    color: var(--bg-qr);
    padding: 6px 14px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* ========================================== */
/* ACTIVE WAITER SERVICE BANNER */
/* ========================================== */
.active-waiter-banner {
    background: linear-gradient(135deg, #C5A880 0%, #A3865D 100%);
    color: #121212;
    padding: 10px 20px;
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--qr-border);
    animation: slideDown 0.3s ease-out;
}
.active-waiter-banner button {
    background: rgba(18, 18, 18, 0.1);
    border: 1px solid rgba(18, 18, 18, 0.3);
    color: #121212;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.active-waiter-banner button:active {
    background: rgba(18, 18, 18, 0.2);
}

/* Keyframes & Bounce Animations */
@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}
@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.bounce-animation {
    animation: bounce 0.4s ease-in-out;
}

