/* ============================================================
   留言/询价弹窗 - Bootstrap 5 美化样式
   ============================================================ */

/* 悬浮按钮(桌面端) */
.lt-msg-trigger {
    position: fixed;
    right: 24px;
    bottom: 88px;
    z-index: 998;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .25s ease, box-shadow .25s ease;
    /* iOS 安全区 */
    right: max(24px, env(safe-area-inset-right));
    bottom: max(88px, env(safe-area-inset-bottom) + 80px);
}
.lt-msg-trigger:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.55);
}
.lt-msg-trigger:active { transform: scale(0.95); }
.lt-msg-trigger i { font-size: 26px; }
.lt-msg-trigger .pulse {
    position: absolute;
    top: 4px; right: 4px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #fff;
    animation: lt-pulse 1.5s infinite;
}
@keyframes lt-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* 弹窗头部渐变 */
.lt-modal-header {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    color: #fff;
    border-radius: .5rem .5rem 0 0;
    padding: 18px 24px;
}
.lt-modal-header .modal-title { font-weight: 600; }
.lt-modal-header .btn-close { filter: invert(1) brightness(200%); }

/* 类型切换 tab */
.lt-msg-type-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 8px;
}
.lt-msg-type-tab {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    transition: all .2s;
    user-select: none;
}
.lt-msg-type-tab.active {
    background: #fff;
    color: #1e40af;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

/* 标签 */
.lt-msg-label {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
    margin-bottom: 6px;
}
.lt-msg-label .req { color: #ef4444; margin-left: 2px; }

/* 表单 */
.lt-msg-form .form-control,
.lt-msg-form .form-select {
    border: 1.5px solid #e5e7eb;
    transition: border-color .2s, box-shadow .2s;
}
.lt-msg-form .form-control:focus,
.lt-msg-form .form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.lt-msg-form textarea.form-control { resize: vertical; min-height: 100px; }

/* 选中的产品 chip */
.lt-prod-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lt-prod-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    border-radius: 16px;
    font-size: 13px;
}
.lt-prod-chip .x {
    cursor: pointer;
    color: #6b7280;
    font-weight: 600;
}
.lt-prod-chip .x:hover { color: #ef4444; }

/* 提交按钮 */
.lt-msg-submit {
    width: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 12px;
    border-radius: 8px;
    transition: transform .15s, box-shadow .15s;
}
.lt-msg-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37,99,235,.4); }
.lt-msg-submit:disabled { background: #9ca3af; cursor: not-allowed; transform: none; box-shadow: none; }

/* 滑块 */
.lt-slider {
    position: relative;
    width: 100%;
    height: 50px;
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    touch-action: none;            /* 关键:禁止 iOS 滚动接管 */
}
.lt-slider * {
    touch-action: none;            /* 子元素同样禁止 */
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}
.lt-slider-track {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 0;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    transition: width .1s;
}
.lt-slider-text {
    position: absolute;
    inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #6b7280; font-size: 14px;
    pointer-events: none;
}
.lt-slider-handle {
    position: absolute;
    top: 0; left: 0;
    width: 50px; height: 100%;
    background: #fff;
    border-right: 2px solid #2563eb;
    cursor: grab;
    display: flex; align-items: center; justify-content: center;
    color: #2563eb;
    z-index: 2;
}
.lt-slider-handle:active { cursor: grabbing; }
.lt-slider.success .lt-slider-track { background: #10b981; }
.lt-slider.success .lt-slider-handle { border-color: #10b981; color: #10b981; }
.lt-slider.fail .lt-slider-track { background: #ef4444; }
.lt-slider.fail .lt-slider-handle { border-color: #ef4444; color: #ef4444; }

/* Toast */
.lt-msg-toast {
    position: fixed;
    top: 30px; left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 12px 24px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    animation: lt-toast-in .3s ease;
}
.lt-msg-toast.success { background: #10b981; }
.lt-msg-toast.error   { background: #ef4444; }
.lt-msg-toast.info    { background: #3b82f6; }
@keyframes lt-toast-in { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 产品下拉 */
.lt-prod-dropdown {
    position: relative;
}
.lt-prod-dropdown .dropdown-menu {
    max-height: 220px; overflow-y: auto;
    width: 100%;
    padding: 4px;
}
.lt-prod-dropdown .dropdown-item {
    padding: 6px 10px; border-radius: 4px; font-size: 13px;
    cursor: pointer;
    display: flex; align-items: center; gap: 8px;
}
.lt-prod-dropdown .dropdown-item:hover { background: #eff6ff; }
.lt-prod-dropdown .dropdown-item input { margin-right: 4px; }

/* 详情页询价 CTA */
.inquiry-cta {
    text-align: center;
    padding: 40px 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
}
.inquiry-cta__icon {
    font-size: 48px;
    color: #1d4ed8;
    margin-bottom: 8px;
}
.inquiry-cta__title {
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 8px;
}
.inquiry-cta__subtitle {
    color: #475569;
    margin-bottom: 20px;
}
.inquiry-cta .btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    padding: 12px 32px;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}
.inquiry-cta .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.45);
}
.inquiry-cta__tips {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    font-size: 13px;
    color: #475569;
}
.inquiry-cta__tips li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.inquiry-cta__tips i {
    color: #2563eb;
}

/* ============================================================
   移动端适配(<= 576px) - iPhone/Android
   ============================================================ */
@media (max-width: 576px) {

    /* 悬浮按钮:略缩小,留出 iOS 底部安全区 */
    .lt-msg-trigger {
        width: 52px;
        height: 52px;
        right: max(12px, env(safe-area-inset-right));
        bottom: max(72px, env(safe-area-inset-bottom) + 64px);
    }
    .lt-msg-trigger i { font-size: 22px; }

    /* 弹窗内容:全屏化(配合 .modal-fullscreen-sm-down) */
    .lt-modal-header {
        padding: 14px 16px;
        border-radius: 0;
    }
    .lt-modal-header .modal-title { font-size: 1.05rem; }

    /* modal-body 紧凑 padding */
    .lt-msg-form { padding: 16px !important; }
    .modal-body.lt-msg-form { padding: 16px !important; }

    /* 类型切换 tab 紧凑 */
    .lt-msg-type-tabs { gap: 6px; padding: 3px; margin-bottom: 14px; }
    .lt-msg-type-tab  { padding: 7px 6px; font-size: 13px; }

    /* 标签字号 */
    .lt-msg-label { font-size: 12px; margin-bottom: 4px; }

    /* 国家码 select 在窄屏收窄,腾给电话输入框 */
    .lt-msg-form select[name="countryCode"] {
        max-width: 92px !important;
        font-size: 14px;
        padding-left: 6px;
        padding-right: 6px;
    }

    /* 输入框更小高度,触发 iOS 16px 防缩放 */
    .lt-msg-form .form-control,
    .lt-msg-form .form-select,
    .lt-msg-form .form-control:focus {
        font-size: 16px;        /* iOS 关键:>=16 防页面被 Safari 缩放 */
        padding: 10px 12px;
        min-height: 44px;        /* 触屏标准 */
    }
    .lt-msg-form textarea.form-control {
        min-height: 88px;
        font-size: 16px;
    }

    /* 按钮触摸目标 */
    .lt-msg-submit,
    .lt-msg-form .btn { min-height: 44px; }
    .lt-msg-submit   { font-size: 15px; padding: 12px; }

    /* 产品 chip 紧凑 */
    .lt-prod-chip { font-size: 12px; padding: 4px 8px; }

    /* 滑块:高度与字号 */
    .lt-slider { height: 44px; }
    .lt-slider-text { font-size: 13px; }
    .lt-slider-handle { width: 44px; font-size: 14px; }

    /* CTA 卡片 */
    .inquiry-cta { padding: 24px 16px; }
    .inquiry-cta__icon { font-size: 36px; }
    .inquiry-cta__title { font-size: 1.15rem; }
    .inquiry-cta .btn-primary { padding: 10px 24px; font-size: 15px; }
    .inquiry-cta__tips { gap: 10px; font-size: 12px; }

    /* 详情页两个按钮纵向排列 */
    .product-actions {
        flex-direction: column;
        gap: 10px;
    }
    .product-actions .btn { width: 100%; }

    /* 模态底部 footer 紧凑 */
    .lt-msg-form + .modal-footer { padding: 10px 12px; }
}

/* 平板 577-768 区间过渡样式 */
@media (min-width: 577px) and (max-width: 768px) {
    .lt-msg-trigger { width: 56px; height: 56px; right: 18px; bottom: 80px; }
}

/* 桌面端保留 modal-lg,小屏(<576)用 fullscreen */
@media (min-width: 576px) {
    .lt-msg-form { padding: 24px !important; }
}
