/* Zulpo Inquiry Form – Frontend Styles v4 */

/* ── Wrapper ── */
.zulpo-form-wrap {
    max-width: 680px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 28px 32px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
    margin: 24px 0;
    box-sizing: border-box;
}
.zulpo-form-header {
    display: flex; align-items: center; gap: 10px;
    font-size: 18px; font-weight: 700; color: #111827; margin-bottom: 20px;
}
.zulpo-form-header svg { color: #2563eb; }
.zulpo-product-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #eff6ff; border: 1px solid #bfdbfe;
    color: #1d4ed8; padding: 5px 12px; border-radius: 20px;
    font-size: 13px; font-weight: 500; margin-bottom: 20px;
}

/* ── Grid layout ── */
.zulpo-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.zulpo-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 600px) {
    .zulpo-row, .zulpo-row-3 { grid-template-columns: 1fr; }
    .zulpo-form-wrap { padding: 20px 16px; }
}

/* ── Field wrapper ── */
.zulpo-field { margin-bottom: 16px; position: relative; }
.zulpo-field label {
    display: block; font-size: 13px; font-weight: 600;
    color: #374151; margin-bottom: 6px;
}
.zulpo-field label .req { color: #ef4444; margin-left: 2px; }
.zulpo-field label .opt { color: #9ca3af; font-weight: 400; margin-left: 4px; font-size: 11px; }

/* ── Common inputs ── */
.zulpo-field input[type=text],
.zulpo-field input[type=email],
.zulpo-field input[type=tel],
.zulpo-field input[type=number],
.zulpo-field input[type=url],
.zulpo-field input[type=date],
.zulpo-field select,
.zulpo-field textarea {
    width: 100%; padding: 10px 13px;
    border: 1.5px solid #d1d5db; border-radius: 8px;
    font-size: 14px; color: #111827; box-sizing: border-box;
    outline: none; transition: border-color .15s, box-shadow .15s;
    background: #fff; font-family: inherit;
}
.zulpo-field input:focus,
.zulpo-field select:focus,
.zulpo-field textarea:focus {
    border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.zulpo-field input.error,
.zulpo-field select.error,
.zulpo-field textarea.error { border-color: #ef4444; }
.zulpo-field-error > label { color: #ef4444; }
.zulpo-field textarea { resize: vertical; min-height: 100px; }
.zulpo-error { display: block; font-size: 11px; color: #ef4444; margin-top: 4px; min-height: 16px; }

/* ── Product auto field (readonly) ── */
.zulpo-product-readonly {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 13px; background: #f9fafb;
    border: 1.5px solid #e5e7eb; border-radius: 8px;
    font-size: 13px; color: #6b7280; font-style: italic;
}
.zulpo-product-readonly a { color: #2563eb; text-decoration: none; font-style: normal; font-weight: 600; }
.zulpo-product-readonly a:hover { text-decoration: underline; }

/* ── Country searchable select ── */
.zulpo-country-wrap { position: relative; }
.zulpo-country-display {
    width: 100%; padding: 10px 36px 10px 13px;
    border: 1.5px solid #d1d5db; border-radius: 8px;
    font-size: 14px; color: #9ca3af; background: #fff;
    cursor: pointer; user-select: none; box-sizing: border-box;
    position: relative; transition: border-color .15s, box-shadow .15s;
    display: flex; align-items: center;
}
.zulpo-country-display.has-value { color: #111827; }
.zulpo-country-display::after {
    content: '▾'; position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%); color: #9ca3af; font-size: 12px;
    pointer-events: none;
}
.zulpo-field-error .zulpo-country-display { border-color: #ef4444; }
.zulpo-country-dropdown {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: #fff; border: 1px solid #d1d5db; border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 9999; overflow: hidden;
}
.zulpo-country-dropdown.open { display: block; }
.zulpo-country-search {
    width: 100%; padding: 10px 12px; border: none; border-bottom: 1px solid #e5e7eb;
    font-size: 13px; outline: none; box-sizing: border-box; background: #f9fafb;
}
.zulpo-country-list {
    max-height: 220px; overflow-y: auto; margin: 0; padding: 4px 0; list-style: none;
}
.zulpo-country-list li {
    padding: 9px 14px; font-size: 13px; color: #374151; cursor: pointer;
    transition: background .1s;
}
.zulpo-country-list li:hover { background: #eff6ff; color: #2563eb; }
.zulpo-no-result { color: #9ca3af !important; cursor: default !important; font-style: italic; }

/* ── WhatsApp field ── */
/* 【修复问题1】：统一 box-sizing，确保区号按钮与号码框等高对齐 */
.zulpo-whatsapp-wrap { display: flex; gap: 0; position: relative; }
.zulpo-wa-dial-btn {
    flex-shrink: 0; min-width: 90px; padding: 10px 10px;
    border: 1.5px solid #d1d5db; border-right: none; border-radius: 8px 0 0 8px;
    background: #f9fafb; cursor: pointer; font-size: 13px; font-weight: 600;
    color: #374151; user-select: none; position: relative;
    display: flex; align-items: center; justify-content: space-between; gap: 4px;
    transition: border-color .15s; box-sizing: border-box;
}
.zulpo-wa-dial-btn::after { content: '▾'; font-size: 11px; color: #9ca3af; }
.zulpo-wa-num {
    flex: 1; padding: 10px 13px;
    border: 1.5px solid #d1d5db; border-radius: 0 8px 8px 0;
    font-size: 14px; color: #111827; outline: none; box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s; background: #fff;
    font-family: inherit; width: 0; min-width: 0;
}
.zulpo-wa-num:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); z-index:1; }
.zulpo-wa-dial-dropdown {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; width: 280px;
    background: #fff; border: 1px solid #d1d5db; border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 9999; overflow: hidden;
}
.zulpo-wa-dial-dropdown.open { display: block; }
.zulpo-wa-dial-search {
    width: 100%; padding: 10px 12px; border: none; border-bottom: 1px solid #e5e7eb;
    font-size: 13px; outline: none; box-sizing: border-box; background: #f9fafb;
}
.zulpo-wa-dial-list {
    max-height: 220px; overflow-y: auto; margin: 0; padding: 4px 0; list-style: none;
}
.zulpo-wa-dial-list li {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; font-size: 13px; color: #374151; cursor: pointer;
    transition: background .1s;
}
.zulpo-wa-dial-list li:hover { background: #eff6ff; color: #2563eb; }
.zulpo-wa-flag { font-weight: 700; color: #2563eb; min-width: 44px; }
.zulpo-wa-cname { color: #6b7280; font-size: 12px; }
.zulpo-field-error .zulpo-wa-dial-btn,
.zulpo-field-error .zulpo-wa-num { border-color: #ef4444; }

/* ── Submit button ── */
.zulpo-btn {
    width: 100%; padding: 12px 24px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff; border: none; border-radius: 9px;
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: opacity .15s, transform .1s; margin-top: 8px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-family: inherit;
}
.zulpo-btn:hover { opacity: .92; transform: translateY(-1px); }
.zulpo-btn:active { transform: translateY(0); }
.zulpo-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.zulpo-btn .btn-loading { display: flex; align-items: center; gap: 8px; }
@keyframes zulpo-spin { to { transform: rotate(360deg); } }
.spin { animation: zulpo-spin .8s linear infinite; }

/* ── Result message ── */
.zulpo-result-msg {
    margin-top: 14px; padding: 12px 16px; border-radius: 8px; font-size: 14px; display: none;
}
.zulpo-result-msg.success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.zulpo-result-msg.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── 【修复问题2】弹窗场景覆盖：去掉外层 wrap 多余边框和间距 ── */
.zulpo-modal-wrap .zulpo-form-wrap,
.zulpo-popup-wrap .zulpo-form-wrap {
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    max-width: 100%;
}
.zulpo-modal-wrap .zulpo-field,
.zulpo-popup-wrap .zulpo-field {
    margin-bottom: 10px;
}
.zulpo-modal-wrap .zulpo-row,
.zulpo-popup-wrap .zulpo-row {
    gap: 10px;
}
