/* ==========================================================================
   SEONGSU ROASTERS (성수 로스터스) CAFE ORDERING KIOSK
   Hip Industrial Concrete, Warm Terracotta & Specialty Coffee Design System
   ========================================================================== */

:root {
    /* Brand Accent Colors */
    --cafe-terracotta: #C85A32;
    --cafe-terracotta-hover: #B24E28;
    --cafe-terracotta-glow: rgba(200, 90, 50, 0.28);
    --cafe-terracotta-light: rgba(200, 90, 50, 0.08);
    
    /* Industrial Neutrals */
    --cafe-dark: #121316;
    --cafe-dark-surface: #191B20;
    --cafe-card-bg: #FFFFFF;
    --cafe-bg-subtle: #F5F3EF;
    --cafe-bg-oatmeal: #FAF7F2;
    --cafe-border: #E5DFD5;
    --cafe-border-dark: #2B2F38;
    --cafe-text-primary: #121316;
    --cafe-text-secondary: #5C6270;
    --cafe-text-muted: #8E95A5;
    
    /* Status Accents */
    --cafe-ice-blue: #0A84FF;
    --cafe-hot-red: #FF453A;
    --cafe-green: #30D158;
    
    /* Typography */
    --font-display: 'Syne', sans-serif;
    --font-primary: 'Plus Jakarta Sans', 'Noto Sans KR', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Shadows & Elevations */
    --shadow-sm: 0 2px 8px rgba(18, 19, 22, 0.04);
    --shadow-md: 0 8px 24px rgba(18, 19, 22, 0.08);
    --shadow-lg: 0 16px 44px rgba(18, 19, 22, 0.12);
    --shadow-card-hover: 0 16px 36px rgba(200, 90, 50, 0.15);
    --shadow-terracotta: 0 10px 24px var(--cafe-terracotta-glow);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 26px;
    --radius-full: 9999px;
    
    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s var(--ease-out-expo);
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation; /* Prevents double-tap zoom while keeping fast smooth tapping & vertical scrolling */
}

html, body {
    width: 100%;
    min-height: 100%;
    background: #0D0E11;
    font-family: var(--font-primary);
    color: var(--cafe-text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    touch-action: pan-y; /* Lock horizontal pinch and only allow smooth vertical panning */
}

/* Industrial Grid & Ambient Lighting */
.kiosk-bg-grid {
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(200, 90, 50, 0.08) 1px, transparent 0);
    background-size: 30px 30px;
    opacity: 0.85;
    z-index: 0;
    pointer-events: none;
}

.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
}

.glow-terracotta {
    width: 600px;
    height: 600px;
    top: -160px;
    right: -100px;
    background: radial-gradient(circle, rgba(200, 90, 50, 0.22) 0%, transparent 70%);
}

.glow-concrete {
    width: 700px;
    height: 700px;
    bottom: -200px;
    left: -150px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
}

/* Master Kiosk Container */
.kiosk-container {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--cafe-bg-oatmeal);
    overflow: hidden;
    padding-top: max(env(safe-area-inset-top, 0px), 48px); /* Very generous top breathing room */
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.main-header {
    height: 84px;
    padding: 0 40px;
    background: #FAF7F2;
    border-bottom: 1.5px solid var(--cafe-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-shrink: 0;
    z-index: 50;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.header-left {
    display: flex;
    align-items: center;
}

.brand-logo-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.brand-logo-wrap:active {
    transform: scale(0.96);
}

.logo-cube {
    width: 48px;
    height: 48px;
    background: var(--cafe-dark);
    color: #fff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.brand-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--cafe-dark);
}

.brand-sub {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--cafe-text-muted);
    letter-spacing: 0.5px;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--cafe-dark);
    color: #fff;
    border: 1.5px solid var(--cafe-dark);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.header-home-btn:hover {
    background: var(--cafe-terracotta);
    border-color: var(--cafe-terracotta);
}

.header-home-btn:active {
    transform: scale(0.95);
}

.header-home-btn i {
    width: 16px;
    height: 16px;
}

.order-dining-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1.5px solid var(--cafe-border);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--cafe-dark);
    box-shadow: var(--shadow-sm);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--cafe-terracotta);
    border-radius: 50%;
    animation: livePulse 2s infinite ease-in-out;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.85); opacity: 0.4; }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lang-pill-switch {
    display: flex;
    background: var(--cafe-bg-subtle);
    padding: 3px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--cafe-border);
}

.lang-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--cafe-text-secondary);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-fast);
}

.lang-btn.active {
    background: var(--cafe-dark);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.lang-btn:active:not(.active) {
    background: rgba(0, 0, 0, 0.05);
}

.header-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--cafe-border);
    border-radius: var(--radius-full);
    padding: 0 16px;
    height: 46px;
    width: 280px;
    transition: var(--transition-fast);
}

.header-search-bar:focus-within {
    border-color: var(--cafe-terracotta);
    box-shadow: 0 0 0 4px var(--cafe-terracotta-light);
    width: 320px;
}

.search-icon {
    width: 17px;
    height: 17px;
    color: var(--cafe-text-muted);
    margin-right: 8px;
    flex-shrink: 0;
}

.header-search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--cafe-dark);
    outline: none;
}

.clear-search-btn {
    background: var(--cafe-bg-subtle);
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.clear-search-btn i {
    width: 12px;
    height: 12px;
}

.status-clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 0 4px;
}

.time-text {
    font-size: 1.15rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--cafe-dark);
    line-height: 1.1;
}

.date-text {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--cafe-text-muted);
}

.header-actions {
    display: flex;
    gap: 8px;
}

.header-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: #fff;
    border: 1.5px solid var(--cafe-border);
    color: var(--cafe-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.header-icon-btn.active {
    background: var(--cafe-dark);
    color: #fff;
    border-color: var(--cafe-dark);
}

.header-icon-btn.muted {
    color: var(--cafe-text-muted);
    opacity: 0.65;
}

.header-icon-btn:hover {
    background: var(--cafe-dark);
    color: #fff;
    border-color: var(--cafe-dark);
}

.header-icon-btn:active {
    transform: scale(0.94);
}

.header-icon-btn i {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   VIEWPORT
   ========================================================================== */
.screen-viewport {
    flex: 1;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px 40px;
    display: flex;
    flex-direction: column;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.screen-viewport::-webkit-scrollbar {
    width: 6px;
}
.screen-viewport::-webkit-scrollbar-thumb {
    background: var(--cafe-border);
    border-radius: 10px;
}

.screen-card-panel {
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    animation: screenEnter 0.38s var(--ease-out-expo) forwards;
}

@keyframes screenEnter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   1. WELCOME SCREEN (HERO & DINING SELECTION)
   ========================================================================== */
.welcome-cafe-layout {
    height: 100%;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 32px;
    align-items: stretch;
}

/* Left Hero */
.cafe-hero-poster {
    background: linear-gradient(145deg, #18191E 0%, #0E0F12 100%);
    border-radius: var(--radius-xl);
    padding: 48px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--cafe-border-dark);
}

.cafe-hero-poster::after {
    content: 'SEONGSU';
    position: absolute;
    bottom: -30px;
    right: -20px;
    font-family: var(--font-display);
    font-size: 8rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.03);
    pointer-events: none;
    letter-spacing: -4px;
}

.hero-tag-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.roast-pill {
    background: var(--cafe-terracotta);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
    font-family: var(--font-mono);
}

.hero-sub-meta {
    font-size: 0.8rem;
    color: #9CA3AF;
    font-weight: 600;
}

.hero-cafe-title {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -1.5px;
    margin: 24px 0 16px;
}

.hero-cafe-title span.terracotta {
    color: var(--cafe-terracotta);
}

.hero-cafe-desc {
    font-size: 1.15rem;
    color: #D1D5DB;
    line-height: 1.6;
    max-width: 520px;
    font-weight: 400;
}

.hero-cafe-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.coffee-note-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bean-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cafe-terracotta);
}

.bean-text h4 {
    font-size: 0.95rem;
    font-weight: 800;
}

.bean-text p {
    font-size: 0.78rem;
    color: #9CA3AF;
}

/* Right Dining Choice Buttons */
.dining-choice-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
}

.dining-choice-card {
    background: #fff;
    border: 2px solid var(--cafe-border);
    border-radius: var(--radius-xl);
    padding: 38px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.dining-choice-card:hover {
    border-color: var(--cafe-terracotta);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.dining-choice-card:active {
    transform: scale(0.98);
}

.dining-card-left {
    display: flex;
    align-items: center;
    gap: 22px;
}

.dining-icon-wrap {
    width: 68px;
    height: 68px;
    border-radius: var(--radius-lg);
    background: var(--cafe-bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cafe-dark);
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.dining-choice-card:hover .dining-icon-wrap {
    background: var(--cafe-terracotta);
    color: #fff;
}

.dining-icon-wrap i {
    width: 34px;
    height: 34px;
}

.dining-info h3 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--cafe-dark);
    margin-bottom: 4px;
}

.dining-info p {
    font-size: 0.9rem;
    color: var(--cafe-text-secondary);
    font-weight: 500;
}

.dining-arrow-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--cafe-bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cafe-dark);
}

.dining-choice-card:hover .dining-arrow-btn {
    background: var(--cafe-dark);
    color: #fff;
}

/* ==========================================================================
   2. CAFE ORDERING MENU SCREEN
   ========================================================================== */
.menu-screen-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    min-height: 100%;
}

/* Category Filter Bar */
.category-filter-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-shrink: 0;
}

.cat-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #fff;
    border: 1.5px solid var(--cafe-border);
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--cafe-text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.cat-filter-btn:hover {
    border-color: var(--cafe-dark);
    color: var(--cafe-dark);
}

.cat-filter-btn.active {
    background: var(--cafe-dark);
    color: #fff;
    border-color: var(--cafe-dark);
}

.cat-filter-btn .cat-badge {
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--cafe-bg-subtle);
    color: var(--cafe-dark);
}

.cat-filter-btn.active .cat-badge {
    background: var(--cafe-terracotta);
    color: #fff;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    width: 100%;
    padding-bottom: 140px; /* Ample space for bottom cart drawer bar */
}

.product-card {
    background: #fff;
    border: 1.5px solid var(--cafe-border);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 260px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--cafe-terracotta);
    box-shadow: var(--shadow-card-hover);
}

.product-card:active {
    transform: scale(0.98);
}

.product-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.prod-tag-pill {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 4px;
    background: var(--cafe-bg-subtle);
    color: var(--cafe-dark);
    font-family: var(--font-mono);
}

.prod-tag-pill.signature {
    background: var(--cafe-terracotta-light);
    color: var(--cafe-terracotta);
}

.prod-temp-indicators {
    display: flex;
    gap: 4px;
}

.temp-dot {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}

.temp-dot.ice { background: #E8F2FF; color: var(--cafe-ice-blue); }
.temp-dot.hot { background: #FFEBEA; color: var(--cafe-hot-red); }

.prod-media-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: var(--radius-md);
    background: var(--cafe-bg-subtle);
    margin: 2px 0 10px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cafe-border);
}

.prod-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s var(--ease-out-expo);
}

.product-card:hover .prod-img {
    transform: scale(1.08);
}

.prod-icon-showcase {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cafe-dark);
    transition: var(--transition-fast);
}

.prod-icon-showcase.fallback-icon {
    display: flex;
}

.product-card:hover .prod-icon-showcase {
    background: var(--cafe-terracotta);
    color: #fff;
    transform: scale(1.08);
}

.prod-icon-showcase i {
    width: 24px;
    height: 24px;
}

.product-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-info h3 {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--cafe-dark);
    margin-bottom: 4px;
    line-height: 1.25;
}

.product-card-info p {
    font-size: 0.78rem;
    color: var(--cafe-text-secondary);
    line-height: 1.4;
    font-weight: 500;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1.5px solid var(--cafe-border);
    margin-top: auto;
}

.prod-price {
    font-size: 1.15rem;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--cafe-dark);
}

.prod-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cafe-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.prod-add-btn i {
    width: 18px;
    height: 18px;
}

.product-card:hover .prod-add-btn {
    background: var(--cafe-terracotta);
    transform: scale(1.08);
}

/* ==========================================================================
   3. STICKY CART BOTTOM BAR
   ========================================================================== */
.cart-bottom-bar {
    position: fixed;
    bottom: 24px;
    left: 40px;
    right: 40px;
    height: 84px;
    background: #191B20;
    border-radius: var(--radius-xl);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    border: 1.5px solid var(--cafe-border-dark);
    z-index: 80;
    animation: slideUp 0.35s var(--ease-out-expo);
}

@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.cart-left {
    display: flex;
    align-items: center;
    gap: 18px;
    cursor: pointer;
}

.cart-badge-icon {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.cart-badge-icon i {
    width: 24px;
    height: 24px;
}

.cart-count-bubble {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--cafe-terracotta);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #191B20;
}

.cart-summary-text {
    display: flex;
    flex-direction: column;
}

.cart-summary-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
}

.cart-summary-title span {
    color: #F3A07A;
    font-size: 0.9rem;
    margin-left: 6px;
}

.cart-summary-sub {
    font-size: 0.75rem;
    color: #9CA3AF;
}

.cart-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.cart-total-price-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.total-label {
    font-size: 0.72rem;
    color: #9CA3AF;
    font-weight: 700;
}

.total-value {
    font-size: 1.6rem;
    font-weight: 900;
    font-family: var(--font-mono);
    color: #fff;
}

.btn-checkout {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--cafe-terracotta);
    color: #fff;
    border: none;
    padding: 16px 28px;
    border-radius: var(--radius-lg);
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-terracotta);
    transition: var(--transition-fast);
}

.btn-checkout:hover {
    background: var(--cafe-terracotta-hover);
}

.btn-checkout:active {
    transform: scale(0.96);
}

/* ==========================================================================
   4. OPTION CUSTOMIZER MODAL
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(14, 15, 18, 0.75);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.option-sheet-card {
    background: #FAF7F2;
    width: 600px;
    max-height: 85vh;
    border-radius: var(--radius-xl);
    padding: 34px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    border: 1.5px solid var(--cafe-border);
    display: flex;
    flex-direction: column;
    animation: modalPop 0.3s var(--ease-out-expo);
    overflow: hidden;
}

@keyframes modalPop {
    from { transform: scale(0.94); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 20px;
    border-bottom: 1.5px solid var(--cafe-border);
    flex-shrink: 0;
}

.opt-cat-badge {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--cafe-terracotta);
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.opt-product-info h2 {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--cafe-dark);
    margin: 2px 0 4px;
}

.opt-product-info p {
    font-size: 0.88rem;
    color: var(--cafe-text-secondary);
}

.close-sheet-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid var(--cafe-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--cafe-dark);
}

.option-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.option-section-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--cafe-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.option-section-title span.required {
    color: var(--cafe-terracotta);
    font-size: 0.72rem;
}

.option-pill-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.opt-choice-pill {
    background: #fff;
    border: 1.5px solid var(--cafe-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition-fast);
}

.opt-choice-pill:hover {
    border-color: var(--cafe-dark);
}

.opt-choice-pill.selected {
    background: var(--cafe-dark);
    color: #fff;
    border-color: var(--cafe-dark);
}

.opt-choice-pill.selected .opt-add-cost {
    color: #F3A07A;
}

.opt-choice-name {
    font-size: 0.92rem;
    font-weight: 800;
}

.opt-add-cost {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--cafe-text-muted);
    font-family: var(--font-mono);
}

.option-footer {
    padding-top: 20px;
    border-top: 1.5px solid var(--cafe-border);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.quantity-controller {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--cafe-border);
    border-radius: var(--radius-md);
    padding: 4px;
}

.qty-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: transparent;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--cafe-dark);
    cursor: pointer;
}

.qty-btn:active {
    background: var(--cafe-bg-subtle);
}

.qty-display {
    width: 36px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 900;
    font-family: var(--font-mono);
}

.btn-add-cart {
    flex: 1;
    background: var(--cafe-terracotta);
    color: #fff;
    border: none;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-terracotta);
    transition: var(--transition-fast);
}

.btn-add-cart:active {
    transform: scale(0.97);
}

/* ==========================================================================
   5. CART DRAWER SHEET MODAL
   ========================================================================== */
.cart-drawer-sheet {
    background: #FAF7F2;
    width: 580px;
    max-height: 85vh;
    border-radius: var(--radius-xl);
    padding: 34px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    border: 1.5px solid var(--cafe-border);
    display: flex;
    flex-direction: column;
    animation: modalPop 0.3s var(--ease-out-expo);
}

.cart-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1.5px solid var(--cafe-border);
}

.drawer-title-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.drawer-title-wrap h3 {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--cafe-dark);
}

.cart-clear-all {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cafe-terracotta);
    cursor: pointer;
    text-decoration: underline;
}

.cart-drawer-items {
    flex: 1;
    overflow-y: auto;
    padding: 18px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item-card {
    background: #fff;
    border: 1.5px solid var(--cafe-border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-item-meta h4 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--cafe-dark);
}

.cart-item-options-text {
    font-size: 0.78rem;
    color: var(--cafe-text-secondary);
    margin-top: 2px;
}

.cart-item-price {
    font-size: 1.05rem;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--cafe-terracotta);
    margin-top: 4px;
}

.cart-item-right-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cart-drawer-footer {
    padding-top: 20px;
    border-top: 1.5px solid var(--cafe-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.drawer-price-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--cafe-text-secondary);
    font-weight: 600;
}

.drawer-price-row.discount {
    color: var(--cafe-green);
}

.drawer-price-row.final {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--cafe-dark);
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed var(--cafe-border);
}

.btn-primary-large {
    background: var(--cafe-terracotta);
    color: #fff;
    border: none;
    padding: 18px;
    border-radius: var(--radius-md);
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-terracotta);
    margin-top: 6px;
}

.btn-primary-large:active {
    transform: scale(0.97);
}

/* ==========================================================================
   6. CHECKOUT & PAYMENT MODAL
   ========================================================================== */
.checkout-card {
    background: #FAF7F2;
    width: 620px;
    max-width: 95vw;
    border-radius: var(--radius-xl);
    padding: 36px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    border: 1.5px solid var(--cafe-border);
    display: flex;
    flex-direction: column;
    animation: modalPop 0.3s var(--ease-out-expo);
}

.checkout-header {
    text-align: center;
    margin-bottom: 24px;
}

.pay-chip-badge {
    display: inline-block;
    background: var(--cafe-dark);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    margin-bottom: 8px;
    font-family: var(--font-mono);
}

.checkout-header h2 {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--cafe-dark);
}

.checkout-header p {
    font-size: 0.95rem;
    color: var(--cafe-text-secondary);
    margin-top: 4px;
}

.checkout-header p strong {
    color: var(--cafe-terracotta);
    font-size: 1.25rem;
    font-family: var(--font-mono);
}

.payment-methods-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.pay-method-card {
    background: #fff;
    border: 1.5px solid var(--cafe-border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-fast);
}

.pay-method-card:hover {
    border-color: var(--cafe-terracotta);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pay-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--cafe-bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cafe-dark);
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.pay-method-card:hover .pay-icon {
    background: var(--cafe-dark);
    color: #fff;
}

.pay-name {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--cafe-dark);
    white-space: nowrap;
}

.pay-sub {
    font-size: 0.8rem;
    color: var(--cafe-text-secondary);
    margin-top: 3px;
    font-weight: 500;
}

/* Card Animation */
.card-terminal-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 16px 0 24px;
}

.terminal-body {
    position: relative;
    width: 100px;
    height: 100px;
    background: var(--cafe-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.terminal-card-icon {
    width: 44px;
    height: 44px;
    color: #FAF7F2;
    animation: cardPulse 1.8s infinite ease-in-out;
}

@keyframes cardPulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.15) translateY(-4px); opacity: 1; }
}

.nfc-pulse-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid var(--cafe-terracotta);
    animation: ringGlow 2s infinite ease-out;
}

@keyframes ringGlow {
    0% { transform: scale(0.9); opacity: 0.8; }
    100% { transform: scale(1.35); opacity: 0; }
}

.payment-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1.5px solid var(--cafe-border);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--cafe-dark);
    margin-top: 18px;
}

/* Camera Scanner */
.camera-viewport-wrap {
    position: relative;
    width: 100%;
    height: 260px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #121316;
    margin-bottom: 14px;
    border: 2px solid var(--cafe-border);
}

.camera-viewport-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror view for front camera */
}

.scanner-aim-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border: 2px dashed rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-md);
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.laser-scanner-line {
    width: 100%;
    height: 3px;
    background: var(--cafe-terracotta);
    box-shadow: 0 0 12px var(--cafe-terracotta);
    animation: laserScan 2s infinite linear;
}

@keyframes laserScan {
    0% { transform: translateY(0); }
    50% { transform: translateY(180px); }
    100% { transform: translateY(0); }
}

.camera-status-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cafe-text-secondary);
}

.btn-secondary {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--cafe-bg-subtle);
    border: 1.5px solid var(--cafe-border);
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
}

/* ==========================================================================
   7. RECEIPT TICKET MODAL
   ========================================================================== */
.receipt-card {
    background: #fff;
    width: 480px;
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    border: 1.5px solid var(--cafe-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    animation: modalPop 0.35s var(--ease-out-expo);
}

.receipt-stamp {
    position: absolute;
    top: 20px;
    right: 20px;
    border: 1.5px solid var(--cafe-border);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--cafe-text-muted);
}

.success-check-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(48, 209, 88, 0.15);
    color: var(--cafe-green);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.receipt-header h2 {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--cafe-dark);
}

.receipt-header p {
    font-size: 0.88rem;
    color: var(--cafe-text-secondary);
    margin-top: 4px;
}

.receipt-ticket-box {
    background: var(--cafe-bg-subtle);
    border: 2px dashed var(--cafe-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    margin: 20px 0;
}

.ticket-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--cafe-text-muted);
    letter-spacing: 1px;
    font-family: var(--font-mono);
}

.ticket-number {
    font-size: 3.5rem;
    font-weight: 900;
    font-family: var(--font-display);
    color: var(--cafe-terracotta);
    line-height: 1;
    margin: 6px 0;
}

.ticket-dining {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--cafe-dark);
}

.receipt-items-summary {
    width: 100%;
    font-size: 0.82rem;
    color: var(--cafe-text-secondary);
    text-align: left;
    max-height: 120px;
    overflow-y: auto;
    border-top: 1px solid var(--cafe-border);
    border-bottom: 1px solid var(--cafe-border);
    padding: 12px 0;
    margin-bottom: 18px;
}

.receipt-notice {
    font-size: 0.82rem;
    color: var(--cafe-text-muted);
    line-height: 1.4;
    margin-bottom: 16px;
}

.btn-done {
    width: 100%;
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--cafe-dark);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
}

/* ==========================================================================
   ADMIN SECURITY MODAL
   ========================================================================== */
.modal-card {
    background: #FAF7F2;
    width: 440px;
    border-radius: var(--radius-xl);
    padding: 36px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1.5px solid var(--cafe-border);
    animation: modalPop 0.3s var(--ease-out-expo);
}

.lock-icon-wrap {
    width: 54px;
    height: 54px;
    background: var(--cafe-terracotta-light);
    color: var(--cafe-terracotta);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

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

.modal-header h3 {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--cafe-dark);
}

.modal-header p {
    font-size: 0.85rem;
    color: var(--cafe-text-secondary);
    margin-top: 4px;
}

.pin-display {
    display: flex;
    gap: 14px;
    margin-bottom: 12px;
    height: 36px;
    align-items: center;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--cafe-border);
    background: #fff;
    transition: all 0.2s ease;
}

.pin-dot.filled {
    background: var(--cafe-terracotta);
    border-color: var(--cafe-terracotta);
    transform: scale(1.15);
}

.error-msg {
    color: #FF453A;
    font-size: 0.82rem;
    font-weight: 700;
    height: 20px;
    margin-bottom: 14px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s;
}

.error-msg.visible {
    opacity: 1;
    transform: translateY(0);
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    margin-bottom: 24px;
}

.key-btn {
    height: 64px;
    border-radius: var(--radius-md);
    background: #fff;
    border: 1.5px solid var(--cafe-border);
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--cafe-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.key-btn:active {
    background: var(--cafe-dark);
    color: #fff;
}

.key-btn.key-utility {
    font-size: 0.85rem;
    font-weight: 800;
}

.key-btn.key-utility.clear {
    color: var(--cafe-terracotta);
}

.modal-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

.btn-primary {
    background: var(--cafe-terracotta);
    color: #fff;
    flex: 1;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    border: none;
}

.hidden {
    display: none !important;
}

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

/* ==========================================================================
   TABLET & IPAD RESPONSIVE SYSTEM (1280px / 1024px / 768px)
   ========================================================================== */

/* iPad Pro / Standard Landscape (max-width: 1200px) */
@media (max-width: 1200px) {
    .kiosk-container {
        padding-top: max(env(safe-area-inset-top, 0px), 50px);
    }

    .main-header {
        height: 78px;
        padding: 0 24px;
        gap: 14px;
    }

    .brand-name {
        font-size: 1.05rem;
    }

    .brand-sub {
        display: none; /* Hide subaddress for tighter iPad width */
    }

    .header-search-bar {
        width: 190px;
    }

    .header-search-bar:focus-within {
        width: 230px;
    }

    .screen-viewport {
        padding: 24px 24px 40px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 14px;
    }

    .welcome-cafe-layout {
        gap: 20px;
    }
}

/* iPad Landscape & Portrait Breakpoint (max-width: 1024px) */
@media (max-width: 1024px) {
    .kiosk-container {
        height: 100vh;
        overflow: hidden;
        padding-top: max(env(safe-area-inset-top, 0px), 56px); /* Very deep clearance for iPad Status Bar */
    }

    .main-header {
        height: 74px;
        padding: 0 20px;
        background: #FAF7F2;
    }

    .header-search-bar {
        width: 160px;
    }

    .status-clock {
        display: none; /* Clock optional on tablets to conserve space */
    }

    .lang-pill-switch {
        padding: 3px;
        gap: 2px;
    }

    .lang-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .screen-viewport {
        padding: 28px 28px 48px;
        flex: 1;
        overflow-y: auto;
    }

    .welcome-cafe-layout {
        grid-template-columns: 1.15fr 0.85fr;
        gap: 20px;
        height: 100%;
    }

    .cafe-hero-poster {
        padding: 28px 24px;
    }

    .hero-cafe-title {
        font-size: 2.4rem;
        margin: 12px 0;
    }

    .hero-cafe-desc {
        font-size: 0.88rem;
        line-height: 1.45;
    }

    .dining-choice-column {
        flex-direction: column;
        gap: 16px;
    }

    .dining-choice-card {
        padding: 24px 20px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
        gap: 12px;
        padding-bottom: 130px;
    }

    .product-card {
        padding: 12px;
        min-height: 240px;
    }

    .product-card-info h3 {
        font-size: 1rem;
    }

    .product-card-info p {
        font-size: 0.74rem;
        margin-bottom: 8px;
    }

    .prod-price {
        font-size: 1.05rem;
    }

    .cart-bottom-bar {
        left: 20px;
        right: 20px;
        bottom: 20px;
        padding: 14px 20px;
    }

    .option-sheet-card {
        width: 90vw;
        max-width: 540px;
        padding: 24px;
    }

    .cart-drawer-sheet {
        width: 440px;
    }
}

/* iPad Portrait / Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .main-header {
        height: auto;
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .header-left {
        width: 100%;
        justify-content: space-between;
    }

    .header-center {
        width: 100%;
        justify-content: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .header-search-bar {
        flex: 1;
        width: auto;
    }

    .dining-choice-column {
        flex-direction: column;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .cart-drawer-sheet {
        width: 100vw;
    }

    .cart-summary-sub {
        display: none;
    }

    .cart-right {
        gap: 12px;
    }

    .total-value {
        font-size: 1.3rem;
    }

    .btn-checkout {
        padding: 12px 18px;
        font-size: 0.95rem;
    }
}

