/* Kampus Cafe - Customer Interface Styles */
/* Mobile-First Responsive Design */

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --text-dark: #2d3748;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
    padding-top: 60px;
    padding-bottom: 70px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    min-height: 56px;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    text-align: center;
}

.btn-back, .btn-cart {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-back:active, .btn-cart:active {
    background: rgba(255,255,255,0.3);
}

.btn-cart {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger-color);
    color: white;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.table-info {
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

/* Main Content */
.main-content {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.page {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome Message */
.welcome-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.welcome-message h2 {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: 600;
}

.welcome-message p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    opacity: 0.95;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.category-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    min-height: 100px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.category-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    flex-shrink: 0;
}

.category-info {
    padding: 16px;
    flex: 1;
}

.category-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

/* Products List */
.products-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.product-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.product-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    flex-shrink: 0;
}

.product-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 4px 0;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

/* Product Detail */
.product-detail {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.product-gallery {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.product-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-content {
    padding: 20px;
}

.product-detail .product-name {
    font-size: 24px;
    margin: 0 0 8px 0;
}

.product-detail .product-price {
    font-size: 28px;
    margin: 0 0 16px 0;
}

.product-description {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.btn-add-to-cart {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s;
}

.btn-add-to-cart:active {
    transform: scale(0.98);
}

/* Cart */
.cart-container {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.cart-info-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.cart-info-box svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #2196f3;
}

.cart-info-box p {
    margin: 0;
    color: #1565c0;
    font-size: 14px;
    line-height: 1.5;
}

.cart-timer {
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 16px;
    font-size: 14px;
}

.cart-items {
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.cart-item-price {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-quantity {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-dark);
}

.btn-quantity:active {
    background: var(--bg-light);
}

.quantity-value {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
}

.btn-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--danger-color);
    color: white;
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-footer {
    border-top: 2px solid var(--border-color);
    padding-top: 16px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 18px;
}

.total-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.btn-clear-cart {
    width: 100%;
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-dark);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.nav-item:active {
    background: var(--bg-light);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
}

.nav-cart-icon {
    position: relative;
}

.nav-cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Responsive */
@media (min-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bottom-nav {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 12px 12px 0 0;
    }
}
