:root {
    --primary: #1e3a5f;
    --primary-dark: #152a45;
    --primary-light: #2c5282;
    --yellow: #ffd300;
    --bg: #f5f5f5;
    --white: #ffffff;
    --text-dark: #191919;
    --text-gray: #697488;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --success: #4ade80;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text-dark);
    line-height: 1.4;
    min-height: 100vh;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    background: var(--white);
    min-height: 100vh;
    position: relative;
    box-shadow: var(--shadow-lg);
}

/* Header */
.header {
    background: var(--primary);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

.back-btn.show {
    display: flex;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--white);
    overflow: hidden;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-title {
    color: var(--white);
}

.header-title h1 {
    font-size: 18px;
    font-weight: 700;
}

.header-title span {
    font-size: 13px;
    opacity: 0.9;
}

.table-badge {
    background: var(--yellow);
    color: var(--text-dark);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Slider */
.slider-wrapper {
    position: relative;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
}

.slider {
    display: flex;
    transition: transform 0.4s ease;
    will-change: transform;
}

.slide {
    min-width: 100%;
    position: relative;
}

.slide img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    pointer-events: none;
    -webkit-user-drag: none;
}

.slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: var(--white);
    width: 24px;
    border-radius: 4px;
}

/* Category Grid (Home Page) */
.home-section {
    padding: 20px 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.category-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.category-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.category-card:active {
    transform: scale(0.98);
}

.category-card-img {
    height: 100px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.category-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card-info {
    padding: 12px;
    text-align: center;
}

.category-card-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.category-card-info p {
    font-size: 11px;
    color: var(--text-gray);
}

/* Products Page */
.products-page {
    display: none;
}

.products-page.active {
    display: block;
}

.home-page.hidden {
    display: none;
}

/* Category Nav (Products Page) */
.category-nav {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 68px;
    z-index: 98;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.cat-chip {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg);
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--text-gray);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cat-chip.active {
    background: var(--primary);
    color: var(--white);
}

/* Search */
.search-wrapper {
    padding: 12px 16px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.search-box {
    background: var(--bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 10px;
}

.search-box svg {
    width: 20px;
    height: 20px;
    color: var(--text-gray);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    padding: 12px 0;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-dark);
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-light);
}

/* Menu Section */
.menu-section {
    padding: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Product Card */
.product-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-card:active {
    transform: scale(0.98);
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 1;
}

.product-img {
    width: 100%;
    aspect-ratio: 1;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.product-info {
    padding: 12px;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.current-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.old-price {
    font-size: 11px;
    color: var(--text-light);
    text-decoration: line-through;
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-desc {
    font-size: 11px;
    color: var(--text-gray);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.add-btn {
    position: absolute;
    bottom: 55px;
    right: 8px;
    width: 30px;
    height: 30px;
    background: var(--white);
    border: 1px solid var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.add-btn svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.add-btn:hover {
    background: var(--primary);
}

.add-btn:hover svg {
    color: var(--white);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: flex-end;
    z-index: 200;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--white);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-header {
    position: relative;
}

.modal-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--bg);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: var(--white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

.modal-desc {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.5;
    margin-bottom: 20px;
}

.modal-add-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-add-btn:hover {
    background: var(--primary-dark);
}

::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Floating Cart Button */
.cart-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(30, 58, 95, 0.4);
    cursor: pointer;
    z-index: 150;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cart-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(30, 58, 95, 0.5);
}

.cart-fab svg {
    width: 26px;
    height: 26px;
    color: white;
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--yellow);
    color: var(--text-dark);
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.cart-fab.empty {
    display: none;
}

/* Cart Drawer */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: flex-end;
    z-index: 300;
    backdrop-filter: blur(4px);
}

.cart-overlay.open {
    display: flex;
}

.cart-drawer {
    background: var(--white);
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-header h2 span {
    background: var(--bg);
    font-size: 13px;
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--text-gray);
}

.cart-close {
    width: 36px;
    height: 36px;
    background: var(--bg);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cart-close svg {
    width: 20px;
    height: 20px;
    color: var(--text-dark);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg);
    flex-shrink: 0;
}

.cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.qty-btn.delete {
    color: #ef4444;
    border-color: #fecaca;
}

.qty-btn.delete:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.qty-value {
    font-size: 15px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-gray);
}

.cart-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.cart-empty p {
    font-size: 15px;
}

.cart-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--white);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cart-total-label {
    font-size: 15px;
    color: var(--text-gray);
}

.cart-total-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.checkout-btn:hover {
    background: var(--primary-dark);
}

.checkout-btn:disabled {
    background: var(--border);
    color: var(--text-light);
    cursor: not-allowed;
}

/* Orders FAB Button */
.orders-fab {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    z-index: 149;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.orders-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.5);
}

.orders-fab svg {
    width: 26px;
    height: 26px;
    color: white;
}

.orders-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    background: var(--primary);
    color: white;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* Orders Overlay & Drawer */
.orders-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.orders-overlay.open {
    opacity: 1;
    visibility: visible;
}

.orders-drawer {
    background: var(--white);
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

.orders-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.orders-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.orders-close {
    width: 36px;
    height: 36px;
    background: var(--bg);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.orders-close svg {
    width: 20px;
    height: 20px;
    color: var(--text-gray);
}

.orders-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.orders-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-gray);
}

.order-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-card-header strong {
    font-size: 15px;
}

.order-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.order-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.order-status.sent {
    background: #dbeafe;
    color: #1e40af;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-gray);
}

.order-item-row span:first-child {
    color: var(--text-dark);
}

.order-card-total {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}

.orders-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 0 0 0 0;
}

.orders-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.orders-total span:first-child {
    font-size: 14px;
    opacity: 0.9;
}

.orders-total-value {
    font-size: 24px;
    font-weight: 700;
}