﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px;
}

.header {
    text-align: center;
    margin-bottom: 16px;
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header h1 {
    color: #333;
    margin-bottom: 4px;
    font-size: 1.25rem;
}

.table-info {
    color: #666;
    font-size: 0.9em;
}

.categories {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    overflow-x: auto;
    padding-bottom: 8px;
}

.category-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 0.9rem;
}

.category-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

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

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

.product-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.product-image {
    width: 100%;
    height: 140px;
    max-height: 140px;
    object-fit: cover;
    background: #f5f5f5;
}

.product-info {
    padding: 8px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-weight: 600;
    margin-bottom: 2px;
    color: #333;
    font-size: 0.95rem;
}

.product-description {
    margin-bottom: 6px;
    line-height: 1.3;
}

.product-description>div {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 2px;
    overflow: hidden;
    transition: max-height 0.2s ease;
}

.product-description .description-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    box-orient: vertical;
    max-height: 2.6em;
}

.product-description .desc-toggle {
    background: none;
    border: none;
    color: #007bff;
    font-size: 0.8rem;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

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

.product-detail {
    text-align: center;
}

.product-detail-image {
    display: block;
    max-width: 100%;
    max-height: 40vh;
    margin: 0 auto 12px auto;
    border-radius: 8px;
    object-fit: contain;
}

.product-detail h2 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.product-detail p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.4;
}

.product-price {
    color: #007bff;
    font-weight: 700;
    font-size: 1rem;
}

.add-btn {
    width: 100%;
    padding: 6px 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0;
    font-weight: 500;
    font-size: 0.9rem;
}

.add-btn:hover {
    background: #218838;
}

.cart-float {
    position: fixed;
    bottom: 12px;
    right: 12px;
    background: #007bff;
    color: white;
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    font-weight: 500;
    font-size: 0.9rem;
    z-index: 1000;
}

.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.cart-content {
    background: white;
    padding: 16px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.cart-total {
    font-size: 1.1rem;
    font-weight: 700;
    text-align: right;
    margin: 12px 0;
    color: #333;
}

.checkout-form {
    margin-top: 12px;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.radio-group {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 0.95rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.checkout-btn {
    width: 100%;
    padding: 10px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
}

.checkout-btn:hover {
    background: #0056b3;
}

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

.close-btn {
    float: right;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #666;
}

.tax-info {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.success-message,
.error-message {
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.success-message {
    background: #d4edda;
    color: #155724;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
}

.delivery-fee-message {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #d4edda;
    color: #155724;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 6px 10px;
    border-radius: 4px;
    margin-top: 6px;
}

.delivery-error-message {
    background: #f8d7da;
    color: #721c24;
    font-size: 0.95rem;
    padding: 6px 10px;
    border-radius: 4px;
    margin-top: 6px;
}

.category-section {
    margin-bottom: 24px;
}

.category-header {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.category-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
}

.category-header h2 {
    color: white;
    margin: 0;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.category-header .category-icon {
    font-size: 1.25rem;
    margin-right: 6px;
}

.category-0 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.category-0::before {
    background: #667eea;
}

.category-1 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.category-1::before {
    background: #f093fb;
}

.category-2 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.category-2::before {
    background: #4facfe;
}

.category-3 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.category-3::before {
    background: #43e97b;
}

.category-4 {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.category-4::before {
    background: #fa709a;
}

.category-5 {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.category-5::before {
    background: #a8edea;
}

.category-6 {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.category-6::before {
    background: #ff9a9e;
}

.category-7 {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.category-7::before {
    background: #ffecd2;
}

.category-8 {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
}

.category-8::before {
    background: #a1c4fd;
}

.category-9 {
    background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);
}

.category-9::before {
    background: #d299c2;
}

.category-default {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.category-default::before {
    background: #667eea;
}