
/* ===== HERMES QR MENU — Mobile-First Frontend ===== */

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

#hqm-menu-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 12px;
    background: #f8f9fa;
    min-height: 100vh;
    padding-bottom: 90px;
    -webkit-overflow-scrolling: touch;
}

/* Header */
.hqm-logo { text-align: center; margin-bottom: 12px; }
.hqm-logo img { max-height: 60px; max-width: 180px; object-fit: contain; }

.hqm-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px;
}
.hqm-title span { color: #d63638; font-weight: 800; }

/* Category */
.hqm-cat {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 20px 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #2271b1;
}

/* Product Grid - Mobile: 1 column, Desktop: 2 */
.hqm-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.hqm-item {
    display: flex;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #e8e8e8;
    min-height: 100px;
}

.hqm-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    flex-shrink: 0;
}

.hqm-info {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hqm-info h3 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

.hqm-desc {
    margin: 0 0 8px;
    font-size: 12px;
    color: #888;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hqm-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hqm-price {
    font-size: 14px;
    font-weight: 700;
    color: #d63638;
}

.hqm-btn-add {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    background: #2271b1;
    color: #fff;
    border: none;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}
.hqm-btn-add:active { transform: scale(0.92); background: #1a5a8e; }

/* Cart Bar - Fixed Bottom */
#hqm-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 2px solid #d63638;
    padding: 10px 14px;
    display: none;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    cursor: pointer;
    min-height: 60px;
}

#hqm-cart-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#hqm-cart-count {
    font-size: 13px;
    color: #666;
}

#hqm-cart-total {
    font-size: 16px;
    font-weight: 700;
    color: #d63638;
}

#hqm-btn-view-cart {
    background: #d63638;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
}
#hqm-btn-view-cart:active { background: #b52a2c; }

/* Modals */
.hqm-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    cursor: pointer;
}

.hqm-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto auto 0 auto;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.hqm-modal-content h2 {
    margin: 0 0 16px;
    font-size: 18px;
    padding-right: 40px;
}

.hqm-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f0f0f0;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.hqm-modal-close:active { background: #e0e0e0; }

/* Cart Modal */
#hqm-cart-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

#hqm-cart-items-list {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.hqm-cart-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    min-height: 60px;
}

.hqm-cart-item-info { flex: 1; min-width: 0; }
.hqm-cart-item-info h4 {
    margin: 0 0 3px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hqm-cart-item-info p { margin: 0; color: #888; font-size: 13px; }

.hqm-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.hqm-cart-item-qty button {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}
.hqm-cart-item-qty button:active { background: #f0f0f0; }
.hqm-cart-item-qty button:disabled { opacity: 0.3; cursor: not-allowed; }
.hqm-cart-item-qty span {
    min-width: 28px;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
}

.hqm-cart-item-delete {
    background: none;
    border: none;
    color: #d63638;
    cursor: pointer;
    font-size: 20px;
    padding: 8px;
    touch-action: manipulation;
}

/* Cart Footer */
.hqm-cart-footer {
    border-top: 2px solid #eee;
    padding-top: 14px;
    display: none;
}

.hqm-cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 15px;
}
.hqm-cart-total-row strong {
    font-size: 18px;
    color: #d63638;
}

.hqm-btn-primary {
    width: 100%;
    background: #4caf50;
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 8px;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}
.hqm-btn-primary:active { background: #388e3c; }

.hqm-btn-secondary {
    width: 100%;
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
}
.hqm-btn-secondary:active { background: #e0e0e0; }

/* Empty Cart */
#hqm-cart-empty-msg {
    text-align: center;
    padding: 30px;
    color: #999;
}
#hqm-cart-empty-msg p { font-size: 16px; margin-bottom: 16px; }

/* Checkout Modal */
#hqm-checkout-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.hqm-checkout-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.hqm-total-row {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    margin: 8px 0;
    border-top: 2px solid #eee;
    font-size: 15px;
}
.hqm-total-row strong:last-child {
    color: #d63638;
    font-size: 18px;
}

/* Form Inputs */
.hqm-form-group {
    margin-bottom: 14px;
}
.hqm-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
}
.hqm-form-group input,
.hqm-form-group textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
.hqm-form-group input:focus,
.hqm-form-group textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34,113,177,0.1);
}

/* Payment Info */
.hqm-payment-info {
    background: #f8f9fa;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}
.hqm-payment-info h4 { margin: 0 0 8px; font-size: 15px; }
.hqm-bank-info {
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    margin-top: 8px;
    border: 1px solid #eee;
}
.hqm-qris-placeholder {
    background: #eee;
    padding: 20px;
    text-align: center;
    color: #999;
    border-radius: 8px;
    margin-top: 8px;
}

/* Buttons */
#hqm-btn-place {
    width: 100%;
    background: #4caf50;
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}
#hqm-btn-place:active { background: #388e3c; }

#hqm-btn-place:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Desktop Responsive */
@media (min-width: 480px) {
    #hqm-menu-app {
        max-width: 480px;
        padding: 16px;
        padding-bottom: 100px;
    }
    .hqm-grid {
        grid-template-columns: 1fr 1fr;
    }
    .hqm-item {
        flex-direction: column;
        min-height: auto;
    }
    .hqm-img {
        width: 100%;
        height: 130px;
    }
    .hqm-modal-content {
        border-radius: 16px;
        max-width: 440px;
        margin: auto;
        animation: fadeIn 0.2s ease;
    }
    @keyframes fadeIn {
        from { opacity: 0; transform: scale(0.95); }
        to { opacity: 1; transform: scale(1); }
    }
}

/* Status Messages */
.hqm-status-success {
    background: #d1f7d1;
    color: #040;
    padding: 14px;
    border-radius: 10px;
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.hqm-status-error {
    background: #fce8e6;
    color: #d63638;
    padding: 14px;
    border-radius: 10px;
    margin-top: 12px;
    font-size: 14px;
}

/* Order Success Screen */
.hqm-success-screen {
    text-align: center;
    padding: 20px 0;
}
.hqm-success-screen .hqm-success-icon {
    font-size: 64px;
    margin-bottom: 16px;
}
.hqm-success-screen h3 {
    font-size: 20px;
    color: #4caf50;
    margin: 0 0 8px;
}
.hqm-success-screen p {
    color: #666;
    font-size: 14px;
    margin: 0 0 16px;
}
.hqm-success-screen .hqm-instruction {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 14px;
    border-radius: 10px;
    text-align: left;
    font-size: 14px;
    color: #333;
}
.hqm-success-screen .hqm-instruction strong {
    color: #d63638;
}
