/* PAPAIS Kiosk - Mobile First Responsive */

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

:root {
    /* Classy Palette */
    --primary-color: #E25822;
    /* Deep Flame Orange */
    --secondary-color: #2D2A26;
    /* Warm Charcoal */
    --light-bg: #FDFBF7;
    /* Cream/Bone White */
    --white: #FFFFFF;
    --text-dark: #2D2A26;
    --text-light: #6B6864;
    --border-color: #EBE5DE;
    --success-color: #2E7D32;
    /* Darker, richer green */
    --danger-color: #D32F2F;
    --accent-color: #F4B400;
    /* Golden Yellow */

    /* Shadows for depth instead of borders */
    --shadow-sm: 0 2px 8px rgba(45, 42, 38, 0.06);
    --shadow-md: 0 4px 20px rgba(45, 42, 38, 0.08);
    --shadow-lg: 0 8px 30px rgba(45, 42, 38, 0.12);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--light-bg);
    color: var(--text-dark);
    margin: 0;
    padding: env(safe-area-inset-top) 0 0 0;
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

min-height: 100vh;
height: auto;

/* Main Content - Full viewport height */
.main-content {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content .container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 8px;
    min-height: 0;
}

display: flex;
flex-direction: column;
}

/* Menu Section */
.menu-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    min-height: 0;
}

/* Category Tabs - Mobile First */
.category-tabs {
    display: flex;
    gap: 8px;
    padding: 12px;
    overflow-x: auto;
    background: var(--white);
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: relative;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

/* Scroll Progress Indicator */
.category-scroll-indicator {
    height: 3px;
    background: var(--border-color);
    position: relative;
    overflow: hidden;
}

.scroll-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #FF8A50);
    width: 40%;
    transition: transform 0.1s ease-out;
    transform: translateX(0);
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.5);
}

.category-tab {
    padding: 10px 20px;
    background: var(--light-bg);
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 15px;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.category-tab.active {
    background: var(--primary-color);
    color: var(--white);
}

.category-tab:active {
    transform: scale(0.95);
}

/* Products Grid - Single Column Mobile */
.products-grid {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    max-height: 60vh;
}

/* Product Cards */
/* Product Cards - Clean layout without height restrictions */
.product-card {
    background: var(--white);
    border: 1px solid transparent;
    /* Reserved for selection */
    border-radius: inherit;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: auto;
    height: auto;
}

.product-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.2);
}

/* Selected product state */
.product-card.selected {
    background: #FFF8F3;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.product-card.selected:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

/* Quantity badge on selected products */
.quantity-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    font-size: 14px;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.4);
    animation: badgePop 0.2s ease-out;
    z-index: 10;
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.product-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.product-description {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.4;
    flex: 1;
}

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

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
}

.dietary-badge {
    padding: 4px 8px;
    background: var(--success-color);
    color: var(--white);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: var(--text-light);
}

/* Cart Section - Compact Mobile */

.cart-title {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-dark);
}


.empty-cart {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
}

.empty-cart p:first-child {
    font-size: 32px;
    margin-bottom: 4px;
}

.empty-cart p {
    font-size: 14px;
}

.cart-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-info h4 {
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 12px;
    color: var(--text-light);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 2px solid var(--primary-color);
    background: var(--white);
    color: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:active {
    background: var(--primary-color);
    color: var(--white);
}

.qty-display {
    min-width: 20px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

.cart-summary {
    border-top: 2px solid var(--border-color);
    padding-top: 10px;
    margin-bottom: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 14px;
}

.summary-row.total {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
}

.checkout-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.checkout-btn:active:not(:disabled) {
    transform: scale(0.98);
    background: var(--secondary-color);
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--light-bg);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}

.modal-body {
    padding: 40px 20px 20px;
}

.modal-body h2 {
    margin-bottom: 20px;
    font-size: 20px;
}

.payment-methods {
    margin: 20px 0;
}

.payment-methods h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

.payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.payment-btn {
    padding: 16px;
    border: 2px solid var(--border-color);
    background: var(--white);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.payment-btn.selected {
    border-color: var(--primary-color);
    background: var(--light-bg);
}

.submit-order-btn {
    width: 100%;
    padding: 14px;
    background: var(--success-color);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--white);
    margin: 0 auto 20px;
}

.modal-content.success {
    text-align: center;
}

.order-number {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-color);
    margin: 12px 0;
}

.back-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
}

/* Tablet & Desktop */
@media (min-width: 768px) {
    .container {
        max-width: 1200px;
        padding: 0 20px;
    }

    .main-content .container {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 8px;
        min-height: 0;
    }

    @media (min-width: 1024px) {
        .container {
            max-width: 1400px;
        }
    }

    /* Swipe-to-delete functionality */


}

box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);

/* FIX: Prevent product cards from shrinking in flex container */
}


border: 2px solid var(--primary-color);
box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}

/* Category tabs wrapper with cart icon */
/* Category wrapper - FLEX row */
.category-tabs-wrapper {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
}

.category-tabs {
    flex: 1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

/* Cart icon - NEVER shrink */
.cart-icon-btn {
    flex-shrink: 0 !important;
    width: 44px;
    height: 44px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #FF6B35;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
}
}





.cart-header h2 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.cart-close-btn {
    background: var(--light-bg);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    transition: all 0.2s;
}

.cart-close-btn:active {
    background: var(--border-color);
    transform: scale(0.95);
}



.order-btn {
    width: 100%;
    padding: 16px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
    position: relative;
}

.order-btn:active:not(:disabled) {
    transform: scale(0.98);
    background: #43A047;
}

.order-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading state for order button */
.order-btn.loading {
    background: #FFA726;
    cursor: wait;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Mobile responsive */
height: 18px;
}
}

/* Mobile fixes for cart icon and order button visibility */

/* FIXED: Cart icon always visible on mobile */
@media (max-width: 768px) {
    .category-tabs-wrapper {
        padding: 8px 60px 8px 8px;
        gap: 0;
        position: relative;
    }

    .category-tabs {
        flex: 1;
        gap: 6px;
        padding-right: 8px;
    }

    .cart-icon-btn {
        position: fixed !important;
        top: 8px;
        right: 8px;
        width: 48px;
        height: 48px;
        font-size: 22px;
        z-index: 100;
        box-shadow: 0 2px 12px rgba(76, 175, 80, 0.4);
    }

    .cart-badge {
        font-size: 11px;
        min-width: 18px;
        height: 18px;
        top: -3px;
        right: -3px;
    }
}

@media (max-width: 480px) {
    .category-tabs-wrapper {
        padding: 6px 56px 6px 6px;
    }

    .category-tabs {
        gap: 4px;
    }

    .category-tab {
        font-size: 12px;
        padding: 8px 12px;
    }

    .cart-icon-btn {
        top: 6px;
        right: 6px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .cart-badge {
        font-size: 10px;
        min-width: 16px;
        height: 16px;
    }

    .cart-content {
        max-width: 100%;
        max-height: 92vh;
        margin: 0;
        border-radius: 16px 16px 0 0;
        display: flex;
        flex-direction: column;
    }

    .cart-header {
        flex-shrink: 0;
        padding: 16px;
        border-bottom: 2px solid var(--border-color);
        background: var(--light-bg);
    }

    .cart-header h2 {
        font-size: 20px;
    }

    .cart-order-section {
        flex-shrink: 0;
        padding: 16px;
        background: var(--white);
        border-bottom: 2px solid var(--border-color);
    }

    .cart-items {
        flex: 1;
        overflow-y: auto;
        padding: 12px;
        max-height: calc(92vh - 280px);
        min-height: 100px;
    }

    .cart-footer {
        flex-shrink: 0;
        padding: 16px;
        background: var(--light-bg);
        border-top: 2px solid var(--border-color);
    }

    .order-btn {
        padding: 14px;
        font-size: 16px;
        font-weight: bold;
    }

    .cart-summary {
        margin-bottom: 8px;
    }

    .summary-row {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .summary-row.total {
        font-size: 16px;
    }

    .product-card {
        padding: 12px;
    }

    .product-name {
        font-size: 14px;
    }

    .product-description {
        font-size: 12px;
    }

    .product-price {
        font-size: 16px;
    }
}

@media (max-width: 375px) {
    .category-tabs-wrapper {
        padding: 4px 52px 4px 4px;
    }

    .category-tab {
        font-size: 11px;
        padding: 6px 10px;
    }

    .cart-icon-btn {
        top: 4px;
        right: 4px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .cart-items {
        max-height: calc(92vh - 210px);
    }
}

/* Cart Section - Inline below categories */
.cart-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: var(--white);
    border-radius: 0 0 12px 12px;
    margin: 0 0 12px 0;
}

.cart-section.active {
    max-height: 600px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cart-content {
    background: var(--white);
    display: flex;
    flex-direction: column;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    flex-shrink: 0;
    border-bottom: 2px solid var(--border-color);
    background: var(--light-bg);
}

.cart-header h2 {
    font-size: 18px;
    margin: 0;
    color: var(--text-dark);
}

.cart-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.cart-close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
    max-height: 300px;
}

.cart-footer {
    padding: 20px;
    flex-shrink: 0;
    border-top: 2px solid var(--border-color);
    background: var(--light-bg);
}

}

/* Hide elements when cart is open */
.menu-section.cart-open .category-tabs-wrapper,
.menu-section.cart-open .products-grid {
    display: none;
}