/* ─── JetEngine WhatsApp Order — v3.0 ─── */

/* ── Overlay & Modal ── */
.jwao-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; box-sizing: border-box;
}
.jwao-modal {
    background: #fff; border-radius: 20px;
    width: 100%; max-width: 520px; max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 64px rgba(0,0,0,0.22);
    overflow: hidden; position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Header ── */
.jwao-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid #f0f0f0;
    background: #fff; flex-shrink: 0;
}
.jwao-modal-header h2 { margin: 0; font-size: 1.1rem; font-weight: 700; color: #111; }
.jwao-close {
    background: #f5f5f5; border: none; width: 32px; height: 32px;
    border-radius: 50%; font-size: 1.2rem; cursor: pointer; color: #555;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.jwao-close:hover { background: #e8e8e8; color: #111; }

/* ── Modal body ── */
.jwao-modal-body { overflow-y: auto; flex: 1; padding: 16px 20px; }

/* ── Step label ── */
.jwao-step-label {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: #25D366; margin: 0 0 14px;
}

/* ── Menu list ── */
.jwao-menu-list { display: flex; flex-direction: column; gap: 10px; }
.jwao-loading { color: #aaa; text-align: center; padding: 32px 0; font-size: .9rem; }
.jwao-error   { color: #e74c3c; font-size: .88rem; padding: 8px 0; }

/* Menu item row */
.jwao-menu-item {
    display: flex; align-items: center; gap: 12px;
    border: 1.5px solid #eee; border-radius: 14px;
    padding: 10px 12px; transition: border-color .2s;
    background: #fff;
}
.jwao-menu-item.jwao-in-cart { border-color: #25D366; background: #f9fffc; }

.jwao-item-img {
    width: 64px; height: 64px; border-radius: 10px;
    object-fit: cover; flex-shrink: 0; background: #f5f5f5;
}
.jwao-item-img-placeholder {
    width: 64px; height: 64px; border-radius: 10px;
    background: #f5f5f5; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
}
.jwao-item-info { flex: 1; min-width: 0; }
.jwao-item-name {
    font-weight: 700; font-size: .95rem; color: #111;
    margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.jwao-item-desc { font-size: .75rem; color: #aaa; margin: 0 0 3px; }
.jwao-item-price { font-size: .9rem; font-weight: 700; color: #25D366; margin: 0; }

/* Add button */
.jwao-add-btn {
    flex-shrink: 0; background: #128C7E; color: #fff;
    border: none; border-radius: 10px; padding: 8px 16px;
    font-size: .85rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    transition: background .15s; white-space: nowrap;
}
.jwao-add-btn:hover { background: #0e6b5e; }
.jwao-add-badge {
    background: #fff; color: #128C7E; border-radius: 50%;
    width: 20px; height: 20px; font-size: .75rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ── Item Card overlay (mini modal) ── */
.jwao-card-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 100001; display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; transition: opacity .25s;
}
.jwao-card-overlay.jwao-card-visible { opacity: 1; }

.jwao-item-card {
    background: #fff; border-radius: 24px 24px 0 0;
    width: 100%; max-width: 520px; max-height: 85vh;
    overflow-y: auto; padding: 20px 20px 32px;
    transform: translateY(60px); transition: transform .25s ease;
    position: relative;
}
.jwao-card-overlay.jwao-card-visible .jwao-item-card { transform: translateY(0); }

.jwao-card-close {
    position: absolute; top: 16px; right: 16px;
    background: #f5f5f5; border: none; width: 32px; height: 32px;
    border-radius: 50%; font-size: 1.1rem; cursor: pointer; color: #555;
    display: flex; align-items: center; justify-content: center;
}
.jwao-card-close:hover { background: #e8e8e8; }

.jwao-card-img {
    width: 100%; height: 180px; object-fit: cover;
    border-radius: 14px; margin-bottom: 14px;
}
.jwao-card-img-placeholder {
    width: 100%; height: 120px; background: #f5f5f5;
    border-radius: 14px; margin-bottom: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem;
}

.jwao-card-body {}
.jwao-card-title { font-size: 1.15rem; font-weight: 800; color: #111; margin: 0 0 4px; }
.jwao-card-desc  { font-size: .85rem; color: #888; margin: 0 0 8px; }
.jwao-card-base-price { font-size: 1rem; font-weight: 700; color: #25D366; margin: 0 0 16px; }

/* Addons inside card */
.jwao-card-addons { margin-bottom: 16px; }
.jwao-card-addon-title {
    font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #999; margin: 0 0 10px;
}
.jwao-card-addon-list { display: flex; flex-direction: column; gap: 0; }
.jwao-card-addon-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid #f5f5f5; cursor: pointer;
}
.jwao-card-addon-row:last-child { border-bottom: none; }
.jwao-card-addon-row input[type=checkbox] {
    width: 20px; height: 20px; border-radius: 6px; cursor: pointer;
    accent-color: #25D366; flex-shrink: 0;
}
.jwao-card-addon-name { flex: 1; font-size: .92rem; color: #222; }
.jwao-card-addon-price {
    font-size: .82rem; font-weight: 700; color: #128C7E;
    background: #e8f5e9; padding: 2px 8px; border-radius: 10px;
}
.jwao-card-addon-free { font-size: .8rem; color: #aaa; }

/* Qty row inside card */
.jwao-card-qty-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 0; border-top: 1px solid #f5f5f5; border-bottom: 1px solid #f5f5f5;
    margin-bottom: 12px;
}
.jwao-card-qty-label { font-weight: 700; font-size: .95rem; color: #111; }
.jwao-card-qty-ctrl  { display: flex; align-items: center; gap: 14px; }
.jwao-qty-btn {
    width: 36px; height: 36px; border-radius: 50%;
    border: 2px solid #25D366; background: #fff; color: #25D366;
    font-size: 1.3rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.jwao-qty-btn:hover { background: #25D366; color: #fff; }
.jwao-card-qty-num { font-size: 1.2rem; font-weight: 800; color: #111; min-width: 28px; text-align: center; }

/* Subtotal row */
.jwao-card-subtotal-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; font-size: .95rem; color: #555;
}
.jwao-card-subtotal { font-size: 1.15rem; font-weight: 800; color: #128C7E; }

/* Confirm button */
.jwao-card-confirm {
    width: 100%; background: #25D366; color: #fff; border: none;
    border-radius: 14px; padding: 15px; font-size: 1rem;
    font-weight: 700; cursor: pointer; transition: background .15s;
}
.jwao-card-confirm:hover { background: #1ead55; }

/* ── Cart review ── */
.jwao-cart-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.jwao-cart-row {
    display: flex; align-items: flex-start; justify-content: space-between;
    background: #f9f9f9; border-radius: 12px; padding: 12px 14px; gap: 8px;
}
.jwao-cart-row-name { font-weight: 700; font-size: .93rem; color: #111; margin-bottom: 2px; }
.jwao-cart-row-meta { font-size: .78rem; color: #aaa; }
.jwao-cart-row-addons { font-size: .78rem; color: #128C7E; margin-top: 3px; }
.jwao-cart-row-price { font-weight: 800; font-size: .95rem; color: #128C7E; white-space: nowrap; }
.jwao-cart-remove {
    background: none; border: none; color: #ccc; font-size: .9rem;
    cursor: pointer; padding: 0; line-height: 1; flex-shrink: 0;
    transition: color .15s;
}
.jwao-cart-remove:hover { color: #e74c3c; }

/* ── Customer details form ── */
.jwao-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.jwao-field label { font-size: .85rem; font-weight: 700; color: #333; }
.jwao-field input, .jwao-field textarea {
    border: 1.5px solid #e5e5e5; border-radius: 10px; padding: 10px 13px;
    font-size: .95rem; font-family: inherit; outline: none; transition: border-color .2s;
    resize: vertical;
}
.jwao-field input:focus, .jwao-field textarea:focus { border-color: #25D366; }

/* ── Modal Footer ── */
.jwao-modal-footer {
    border-top: 1px solid #f0f0f0; padding: 14px 20px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; background: #fff; flex-shrink: 0; flex-wrap: wrap;
}
.jwao-total { font-size: .95rem; color: #333; display: flex; align-items: center; gap: 8px; }
.jwao-total strong { font-size: 1.1rem; font-weight: 800; color: #128C7E; }
.jwao-badge {
    background: #25D366; color: #fff; border-radius: 20px;
    padding: 1px 8px; font-size: .72rem; font-weight: 800;
}
.jwao-footer-actions { display: flex; gap: 8px; }

/* Buttons */
.jwao-btn-primary {
    background: #128C7E; color: #fff; border: none;
    border-radius: 10px; padding: 10px 20px; font-size: .92rem;
    font-weight: 700; cursor: pointer; transition: background .15s;
}
.jwao-btn-primary:hover { background: #0e6b5e; }
.jwao-btn-secondary {
    background: #fff; color: #333; border: 1.5px solid #e5e5e5;
    border-radius: 10px; padding: 10px 16px; font-size: .88rem;
    font-weight: 700; cursor: pointer; transition: border-color .15s;
}
.jwao-btn-secondary:hover { border-color: #999; }
.jwao-btn-whatsapp {
    background: #25D366; color: #fff; border: none;
    border-radius: 10px; padding: 10px 20px; font-size: .92rem;
    font-weight: 700; cursor: pointer; transition: background .15s;
}
.jwao-btn-whatsapp:hover { background: #1ead55; }

/* Open button */
#jwao-open-btn { font-size: 1rem; padding: 13px 30px; border-radius: 12px; margin: 12px 0; }

/* ── Toast notification ── */
.jwao-toast {
    position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(10px);
    background: #111; color: #fff; border-radius: 20px; padding: 8px 18px;
    font-size: .82rem; font-weight: 600; opacity: 0; transition: all .25s;
    white-space: nowrap; pointer-events: none; z-index: 10;
}
.jwao-toast.jwao-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ── */
@media (max-width: 500px) {
    .jwao-modal { border-radius: 20px 20px 0 0; max-height: 95vh; }
    .jwao-modal-footer { flex-direction: column; align-items: stretch; }
    .jwao-footer-actions { width: 100%; }
    .jwao-btn-primary, .jwao-btn-secondary, .jwao-btn-whatsapp { flex: 1; text-align: center; }
}

/* ─── Coupon ─── */
.jwao-coupon-section {
    margin-top: 12px;
}
.jwao-coupon-row {
    padding: 14px 12px;
    border: 1.5px dashed #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    margin-top: 4px;
}
.jwao-coupon-input-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.jwao-coupon-input {
    flex: 1;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: .9rem;
    font-family: monospace;
    text-transform: uppercase;
    outline: none;
    transition: border-color .2s;
}
.jwao-coupon-input:focus { border-color: #25D366; }
.jwao-coupon-btn {
    background: #f5f5f5;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    font-family: inherit;
}
.jwao-coupon-btn:hover { background: #e8e8e8; }
.jwao-coupon-btn:disabled { opacity: .5; cursor: not-allowed; }
.jwao-coupon-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0fff4;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: .85rem;
    color: #2e7d32;
    margin-bottom: 4px;
}
.jwao-coupon-discount {
    font-weight: 800;
    color: #128C7E;
}
.jwao-coupon-msg {
    font-size: .8rem;
    padding: 2px 0;
    min-height: 18px;
}
.jwao-coupon-ok  { color: #2e7d32; font-weight: 600; }
.jwao-coupon-err { color: #c62828; font-weight: 600; }
