/* ============================================================
   WhatsApp Order Button – Frontend Styles
   ============================================================ */

/* ----- Trigger Button ----- */
.wob-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    margin: 8px 4px;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
    vertical-align: middle;
    line-height: 1;
    font-family: inherit;
}

.wob-button:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
}

.wob-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(37, 211, 102, 0.3);
}

.wob-button:focus-visible {
    outline: 3px solid rgba(37, 211, 102, 0.5);
    outline-offset: 2px;
}

.wob-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ----- Overlay ----- */
.wob-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.wob-overlay[hidden] {
    display: none !important;
}

.wob-overlay.wob-visible {
    opacity: 1;
}

/* ----- Modal Box ----- */
.wob-modal {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: -apple-system, "Segoe UI", Tahoma, "Helvetica Neue", sans-serif;
    direction: rtl;
}

.wob-overlay.wob-visible .wob-modal {
    transform: translateY(0) scale(1);
}

/* ----- Header ----- */
.wob-modal-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    padding: 20px 22px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    color: #fff;
    position: relative;
}

.wob-modal-header-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wob-modal-header-icon svg {
    width: 26px;
    height: 26px;
    fill: #fff;
}

.wob-modal-header-text {
    flex: 1;
    min-width: 0;
}

.wob-modal-header-text h2 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.wob-modal-header-text p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}

.wob-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
    margin-right: auto;
    margin-left: 0;
}

.wob-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.wob-close svg {
    width: 18px;
    height: 18px;
}

/* ----- Body / Form ----- */
.wob-modal-body {
    padding: 22px 22px 18px;
}

.wob-field {
    margin-bottom: 16px;
}

.wob-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    cursor: default;
}

.wob-label-icon {
    font-size: 15px;
    line-height: 1;
}

.wob-required-star {
    color: #ef4444;
    font-size: 14px;
    line-height: 1;
}

.wob-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #f9fafb;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    outline: none;
}

.wob-field input:focus {
    border-color: #25D366;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.wob-field input.wob-input-error {
    border-color: #ef4444;
    background: #fef2f2;
}

.wob-field input.wob-input-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.wob-error {
    display: block;
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
    font-weight: 500;
}

/* ----- Actions ----- */
.wob-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-direction: row-reverse;  /* submit button on the left (RTL context) */
}

.wob-submit-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    font-family: inherit;
}

.wob-submit-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.wob-submit-btn:active { transform: translateY(0); }

.wob-cancel-btn {
    padding: 12px 18px;
    background: #f3f4f6;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.wob-cancel-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* ----- Footer ----- */
.wob-modal-footer {
    padding: 10px 22px 14px;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-top: 1px solid #f3f4f6;
}

/* ----- Responsive ----- */
@media (max-width: 480px) {
    .wob-modal {
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
    }

    .wob-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .wob-overlay.wob-visible .wob-modal {
        transform: translateY(0) scale(1);
    }

    .wob-overlay .wob-modal {
        transform: translateY(100%);
    }

    .wob-actions {
        flex-direction: column-reverse;
    }
}
