/* customer/style.css */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

html { font-size: 16px; }
body, .menu-container { margin: 0; font-family: var(--pv-font); background: var(--pv-bg); color: var(--pv-text); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
body { padding-bottom: 140px; }

.brand-name { margin: 0; font-size: clamp(1.2rem, 3vw, 1.5rem); font-weight: 800; letter-spacing: -0.5px; }
.section-title { font-size: clamp(1.25rem, 3vw, 1.5rem); font-weight: 800; margin: 30px 0 16px 0; color: var(--pv-text); }
.item-name { margin: 0 0 4px 0; font-size: clamp(1rem, 2.5vw, 1.1rem); font-weight: 700; color: var(--pv-text); word-break: break-word; }
.item-price { font-weight: 600; font-size: clamp(0.95rem, 2vw, 1rem); margin-bottom: 6px; color: var(--pv-text); }

.clamp-1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.pv-item-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; width: 100%; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* STRICT HEADER Z-INDEX SYSTEM */
.app-header-container { position: sticky; top: 0; background: var(--pv-secondary); z-index: 1000; box-shadow: 0 4px 20px rgba(0,0,0,0.04); border-bottom: 1px solid var(--pv-border); transform: translateZ(0); }
.app-navbar { padding: 16px 20px 12px; }
.nav-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.table-badge { display: inline-block; margin-top: 4px; font-size: clamp(0.7rem, 1.5vw, 0.75rem); font-weight: 700; color: var(--pv-primary); background: color-mix(in srgb, var(--pv-primary) 15%, transparent); padding: 3px 8px; border-radius: 6px; text-transform: uppercase;}
.nav-cart-btn { background: none; border: none; font-size: clamp(1.4rem, 3vw, 1.6rem); position: relative; color: var(--pv-text); cursor: pointer; display: flex; align-items: center; justify-content: center;}
.nav-cart-badge { position: absolute; top: -4px; right: -6px; background: #ef4444; color: #fff; font-size: 0.65rem; font-weight: 800; height: 18px; min-width: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; z-index: 10;}

.nav-search { position: relative; width: 100%; box-sizing: border-box; z-index: 1001; }
.nav-search input { width: 100%; box-sizing: border-box; background: var(--pv-bg); border: 1px solid var(--pv-border); color: var(--pv-text); padding: 12px 12px 12px 40px; border-radius: 12px; font-family: inherit; font-size: clamp(0.9rem, 2vw, 0.95rem); outline: none; margin: 0; display: block; transition: 0.2s; position: relative; z-index: 1001;}
.nav-search input:focus { border-color: var(--pv-primary); background: var(--pv-secondary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pv-primary) 15%, transparent); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--pv-text-secondary); font-size: 1.2rem; z-index: 1002;}

.category-wrapper { background: transparent; padding: 0 20px 12px 20px; }
.category-scroll { display: flex; overflow-x: auto; gap: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
.category-scroll::-webkit-scrollbar { display: none; }
.cat-pill { white-space: nowrap; text-decoration: none; color: var(--pv-text-secondary); font-weight: 600; font-size: clamp(0.9rem, 2vw, 0.95rem); position: relative; padding-bottom: 6px; cursor:pointer;}
.cat-pill.active { color: var(--pv-text); }
.cat-pill.active::after { content: ''; position: absolute; bottom: -6px; left: 0; width: 100%; height: 3px; background: var(--pv-primary); border-radius: 3px 3px 0 0; }

.menu-container { padding: 0 20px; max-width: 1200px; margin: 0 auto; contain: layout style; transition: opacity 0.25s ease; position: relative; z-index: 1;}
.lazy-section { content-visibility: auto; contain-intrinsic-size: 600px; margin-bottom: 40px; }

.skeleton-loader { background: var(--pv-border); position: relative; overflow: hidden; }
.skeleton-loader::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); animation: shimmer 1.2s infinite; pointer-events: none;}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
img.lazy-image { opacity: 0; transition: opacity 0.3s; width: 100%; height: 100%; object-fit: cover; }
img.lazy-image.loaded { opacity: 1; }

.price { color: var(--pv-text); font-weight: 800; margin: 0; font-size: 0.95rem; }
.desc { color: var(--pv-text-secondary); font-size: 0.75rem; line-height: 1.4; margin: 0; }
.pv-card { background: var(--pv-secondary); border-radius: var(--pv-radius); border: 1px solid var(--pv-border); box-shadow: 0 2px 8px rgba(0,0,0,0.02); overflow: hidden; position: relative; transition: transform 0.2s;}
.pv-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.06); }
.pv-meta-veg { width: 14px; height: 14px; border: 2px solid; border-radius: 3px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; flex-shrink:0;}
.pv-meta-veg::after { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.pv-meta-veg.veg { border-color: #0f8a65; }
.pv-meta-veg.veg::after { background: #0f8a65; }
.pv-meta-veg.nonveg { border-color: #e9634b; }
.pv-meta-veg.nonveg::after { background: #e9634b; }

.pv-btn { background: var(--pv-secondary); color: var(--pv-primary); border: 1px solid var(--pv-border); font-weight: 800; width: 100%; height: 30px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); cursor:pointer;}
.pv-badge-inline { font-size:0.7rem; font-weight:800; padding:3px 8px; border-radius:12px; display:inline-flex; align-items:center; gap:4px; box-shadow:0 2px 4px rgba(0,0,0,0.1); width:max-content; margin-top:4px; margin-bottom:4px; }
.pv-discount-tag { font-size:0.7rem; color:#fff; background:var(--ruby, #ef4444); padding:2px 6px; border-radius:4px; font-weight:800; vertical-align:middle; display:inline-block; margin-left:6px; }

.add-btn-wrapper { transition: all 0.2s ease; display: flex; justify-content: center; align-items: center; z-index:10; position:relative;}
.add-btn-wrapper:has(.qty-controls) { min-width: 90px; }
.qty-controls { width: 100%; height: 30px; background: var(--pv-primary); border: 1px solid var(--pv-primary); border-radius: 6px; display: flex; justify-content: space-between; align-items: center; overflow: hidden; box-shadow: 0 2px 8px color-mix(in srgb, var(--pv-primary) 30%, transparent);}
.qty-controls button { background: transparent; border: none; color: #fff; width: 28px; height: 100%; font-size: 1rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qty-val { font-weight: 800; color: #fff; flex: 1; text-align: center; font-size: 0.85rem; }

/* STRICT CAROUSEL SIZING: Forces 1 display strictly per row on mobile */
.pv-carousel-section { width: 100%; margin-bottom: 35px; display: block; overflow: hidden; margin-left: -20px; width: calc(100% + 40px); padding-left: 20px; position: relative; z-index: 1;}
.pv-carousel-viewport { 
    width: 100%; 
    overflow-x: auto; 
    overflow-y: hidden; 
    display: flex; 
    scrollbar-width: none; 
    -ms-overflow-style: none; 
    padding-bottom: 20px; 
    margin-bottom: -20px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.pv-carousel-viewport::-webkit-scrollbar { display: none; }
.pv-carousel-track { display: flex; gap: 16px; width: max-content; }
.pv-carousel-item { box-sizing: border-box; scroll-snap-align: center; flex-shrink: 0; }
.carousel-stretch-false .pv-carousel-item { width: calc(100vw - 40px); max-width: 400px; }
.carousel-stretch-true .pv-carousel-item { width: calc(100vw - 40px); max-width: 800px; padding-right: 20px;}

@media (min-width: 768px) {
    .carousel-stretch-false .pv-carousel-item { width: calc(33.333% - 11px); max-width: none; }
    .pv-carousel-track { width: 100%; } 
}

.glass-dots { display: flex; justify-content: center; gap: 8px; margin-top: 20px;}
.glass-dots .dot { width: 6px; height: 6px; background: var(--pv-border); border-radius: 50%; transition: 0.3s; }
.glass-dots .dot.active { background: var(--pv-primary); transform: scale(1.3); }

.floating-cart { position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 400px; background: var(--pv-primary); color: white; border-radius: 30px; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 10px 30px color-mix(in srgb, var(--pv-primary) 50%, transparent); transition: bottom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); z-index: 1000; cursor: pointer; }
.floating-cart.visible { bottom: 25px; }
.cart-summary { display: flex; flex-direction: column; }
.item-count { font-size: 0.75rem; font-weight: 600; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.5px; }
.item-total { font-size: 1.15rem; font-weight: 800; }
.cart-action { display: flex; align-items: center; gap: 5px; font-weight: 800; font-size: 0.95rem; background: rgba(255,255,255,0.2); padding: 8px 16px; border-radius: 20px;}

.bottom-sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2000; opacity: 0; pointer-events: none; transition: 0.3s; backdrop-filter: blur(4px); }
.bottom-sheet-overlay.active { opacity: 1; pointer-events: auto; }
.bottom-sheet { position: absolute; bottom: 0; left: 0; width: 100%; background: var(--pv-secondary); border-radius: 24px 24px 0 0; padding: 25px 20px; transform: translateY(100%); transition: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); max-height: 95dvh; box-sizing: border-box; display: flex; flex-direction: column;}
.bottom-sheet-overlay.active .bottom-sheet { transform: translateY(0); }
@media (min-width: 768px) {
    .bottom-sheet { width: 500px; left: 50%; transform: translate(-50%, 100%); border-radius: 24px; bottom: 20px; }
    .bottom-sheet-overlay.active .bottom-sheet { transform: translate(-50%, 0); }
}

.sheet-handle { width: 40px; height: 5px; background: var(--pv-border); border-radius: 3px; margin: 0 auto 20px auto; flex-shrink: 0;}
.sheet-title { margin: 0 0 20px 0; font-size: 1.3rem; font-weight: 800; color: var(--pv-text); flex-shrink: 0;}

.cart-items-container { overflow-y: auto; max-height: 50vh; padding-right: 5px; flex: 1;}
.cart-items-container::-webkit-scrollbar { width: 4px; }
.cart-items-container::-webkit-scrollbar-thumb { background: var(--pv-border); border-radius: 10px; }

.btn-primary { width: 100%; background: var(--pv-primary); color: white; border: none; padding: 16px; border-radius: 12px; font-size: 1.05rem; font-weight: 700; font-family: inherit; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 15px color-mix(in srgb, var(--pv-primary) 30%, transparent); flex-shrink: 0;}
.btn-primary:active { transform: scale(0.98); }
.btn-secondary { width: 100%; background: var(--pv-bg); color: var(--pv-text); border: 1px solid var(--pv-border); padding: 14px; border-radius: 12px; font-size: 1rem; font-weight: 700; font-family: inherit; cursor: pointer; transition: 0.2s; margin-top: 10px; display: flex; justify-content: center; align-items: center; gap: 8px;}

.active-order-widget { 
    position: fixed; 
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 1500;
    background: #1f2937; 
    color: white; 
    border-radius: 16px; 
    padding: 20px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.15); 
    border: 1px solid #374151; 
}
.tracker-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.tracker-title { font-weight: 800; font-size: 1.1rem; display: block; }
.tracker-eta { font-size: 0.85rem; color: #9ca3af; font-weight: 500; }
.progress-bar { width: 100%; height: 8px; background: #374151; border-radius: 4px; overflow: hidden; margin-bottom: 10px; }
.progress-fill { height: 100%; background: #10b981; border-radius: 4px; transition: width 0.5s ease; width: 0%; }
.progress-status { font-size: 0.85rem; font-weight: 600; color: #10b981; text-align: right; }

.loyalty-card { background: linear-gradient(135deg, rgba(212,175,55,0.1) 0%, rgba(212,175,55,0.05) 100%); border: 1px solid rgba(212,175,55,0.3); border-radius: var(--pv-radius); padding: 16px; margin: 10px 0; flex-shrink: 0;}
.crm-header { display: flex; justify-content: space-between; align-items: center; color: #d4af37; font-weight: 800; font-size: 1.1rem; margin-bottom: 12px; letter-spacing: -0.5px; }
.crm-reward-item { background: var(--pv-bg); border: 1px solid var(--pv-border); border-radius: 8px; padding: 12px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.crm-reward-desc { font-size: 0.9rem; font-weight: 700; color: var(--pv-text); }
.crm-reward-cost { font-size: 0.8rem; color: #d4af37; font-family: 'JetBrains Mono', monospace; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.btn-crm-action { background: transparent; border: 1px solid #d4af37; color: #d4af37; padding: 6px 12px; border-radius: 6px; font-weight: 700; font-size: 0.8rem; cursor: pointer; transition: 0.2s;}

.cart-drawer-item { background: var(--pv-bg); padding: 16px; border-radius: 12px; margin-bottom: 12px; border: 1px solid var(--pv-border); display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
.item-meta { flex: 1; }
.item-meta .item-name { font-size: 1.05rem; margin-bottom: 6px; font-weight: 800; color: var(--pv-text); }
.item-meta .item-price { color: var(--pv-text-secondary); font-size: 0.95rem; font-weight: 700; }
.qty-controls.small { min-width: 80px; height: 32px; box-shadow: none; margin: 0 16px; background: var(--pv-bg); width: auto; border-color: var(--pv-border);}
.qty-controls.small button { color: var(--pv-text); }
.qty-controls.small .qty-val { color: var(--pv-text); }
.item-total-price { font-weight: 800; min-width: 60px; text-align: right; color: var(--pv-text); }

.order-type-container { margin: 15px 0; flex-shrink: 0;}
.order-type-container .type-label { font-size: 0.85rem; font-weight: 800; color: var(--pv-text-secondary); text-transform: uppercase; margin-bottom: 10px; display: block; }
.order-type-toggle { display: flex; background: color-mix(in srgb, var(--pv-border) 40%, var(--pv-bg)); border-radius: 12px; padding: 6px; gap: 6px; border: 1px solid var(--pv-border); }
.order-type-toggle .type-btn { flex: 1; padding: 12px; text-align: center; font-weight: 800; font-size: 0.95rem; color: var(--pv-text-secondary); cursor: pointer; border-radius: 8px; transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.order-type-toggle .type-btn.active { background: var(--pv-primary); color: #ffffff; box-shadow: 0 4px 12px color-mix(in srgb, var(--pv-primary) 30%, transparent); }

.bill-details-card { background: color-mix(in srgb, var(--pv-primary) 6%, var(--pv-bg)); padding: 20px; border-radius: 12px; margin-top: 15px; border: 1px dashed color-mix(in srgb, var(--pv-primary) 30%, transparent); flex-shrink: 0;}
.bill-details-card .bill-row { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--pv-text-secondary); font-weight: 600; font-size: 0.95rem; }
.bill-details-card .bill-row.grand-total { color: var(--pv-text); font-weight: 800; font-size: 1.3rem; margin-bottom: 0; padding-top: 12px; border-top: 2px dashed color-mix(in srgb, var(--pv-primary) 30%, transparent); }

.order-notes-container { margin: 15px 0; flex-shrink: 0;}
.order-notes-input { width: 100%; background: var(--pv-bg); border: 1px solid var(--pv-border); color: var(--pv-text); padding: 12px; border-radius: 12px; font-family: inherit; font-size: 0.95rem; resize: none; box-sizing: border-box; outline: none; transition: 0.2s;}
.order-notes-input:focus { border-color: var(--pv-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pv-primary) 15%, transparent); }

/* --- REALISTIC INVOICE THEMES (Unified across POS & App) --- */
.thermal-receipt { background: #fff; color: #000; padding: 25px; width: 100%; max-width: 380px; margin: 0 auto; box-shadow: 0 0 15px rgba(0,0,0,0.1); user-select: text; text-align:left; border-radius: 8px; border: 1px solid #e5e7eb;}
.receipt-table { width: 100%; text-align: left; border-collapse: collapse; margin: 10px 0;}
.receipt-table th, .receipt-table td { padding: 6px 0; }

.theme-standard { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.85rem; }
.theme-standard h2 { text-align: center; margin: 0 0 5px 0; font-size: 1.2rem; text-transform:uppercase; font-weight:bold;}
.theme-standard .divider { border-top: 1px dashed #000; margin: 12px 0; }
.theme-standard .receipt-table th { border-bottom: 1px dashed #000; padding-bottom:5px; }

.theme-modern { font-family: 'Inter', sans-serif; font-size: 0.85rem; }
.theme-modern h2 { text-align:center; font-weight: 800; font-size:1.4rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px;}
.theme-modern .divider { border-top: 1px solid #d4d4d8; margin: 15px 0; }
.theme-modern .receipt-table th { color:#71717a; text-transform:uppercase; font-size:0.75rem; border-bottom:1px solid #d4d4d8;}

.theme-finedine { font-family: 'Georgia', serif; font-size: 0.9rem; text-align: center; }
.theme-finedine h2 { font-weight: normal; font-size: 1.6rem; margin-bottom: 10px; }
.theme-finedine .divider { border-top: 3px double #000; margin: 20px 0; }
.theme-finedine .receipt-table th { text-align: center; font-style: italic; font-weight:normal; border-bottom: 1px solid #000;}

.theme-qsr { font-family: 'Arial', sans-serif; font-size: 0.9rem; font-weight: 700; text-transform: uppercase; }
.theme-qsr h2 { text-align:center; font-size: 1.8rem; font-weight:900; transform: scaleY(1.2); margin-bottom: 15px; }
.theme-qsr .divider { border-top: 2px solid #000; margin: 10px 0; }
.theme-qsr .receipt-table th { border-bottom: 2px solid #000; }
.theme-qsr .receipt-table tr:nth-child(even) { background-color: #f4f4f5; }
.theme-qsr .grand-total-row { font-size:1.3rem; font-weight:900; background:#000; color:#fff; padding:10px; display:flex; justify-content:space-between; margin-top:10px;}