@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700&display=swap');
/**
 * 模态窗口样式
 * 整页镜片配置器：铺满整个屏幕，包含头部标题/价格栏、左右分栏（产品图 + 步骤区）。
 */

.ep-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--ep-bg);
    overflow: hidden;
}

.ep-modal-content {
    display: flex;
    flex-direction: column;
    background-color: var(--ep-surface);
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* 模态头部 */
.ep-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ep-border);
    background: var(--ep-surface);
    flex: 0 0 auto;
}

.ep-modal-header-info {
    min-width: 0;
}

.ep-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--ep-ink);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ep-modal-price {
    margin-top: 2px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ep-brand);
}

.ep-modal-price .amount {
    color: inherit;
}

.ep-close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    color: var(--ep-text);
    background: var(--ep-bg);
    cursor: pointer;
    transition: all var(--ep-transition);
    user-select: none;
}

.ep-close:hover {
    background: var(--ep-danger-soft);
    color: var(--ep-danger);
}

/* 主体容器：左产品图 + 右步骤区 */
.ep-modal-container {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
}

.ep-product-info {
    width: 44%;
    min-width: 280px;
    height: 100%;
    border-right: 1px solid var(--ep-border);
    background: var(--ep-bg);
    overflow: hidden;
    padding: 0;
}

.ep-product-image {
    width: 100%;
    height: 100%;
    background: var(--ep-bg);
    overflow: hidden;
}

.ep-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ep-select-lenses-steps {
    flex: 1;
    min-width: 0;
    height: 100%;
    background: var(--ep-surface);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 顶部条：左上角回退箭头 */
.ep-steps-topbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--ep-border);
    background: var(--ep-surface);
}

.ep-back-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--ep-ink);
    cursor: pointer;
    border-radius: var(--ep-radius-sm);
    transition: background var(--ep-transition), color var(--ep-transition);
    padding: 0;
}

.ep-back-arrow svg {
    width: 22px;
    height: 22px;
}

.ep-back-arrow:hover {
    background: var(--ep-bg);
    color: var(--ep-brand-dark);
}

/* 步骤容器 */
.ep-step {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* 进度条区域（底部留出足够空间，容纳下方的步骤文字标签） */
.ep-step-progress {
    flex: 0 0 auto;
    padding: 20px 24px 40px;
}

/* 步骤标题 */
.ep-step h3 {
    flex: 0 0 auto;
    margin: 0;
    padding: 12px 24px 20px;
    font-size: 20px;
    font-weight: 700;
    color: var(--ep-ink);
    text-align: center;
    letter-spacing: 0.2px;
}

/* 内容区域 */
.ep-step-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 24px 24px;
    -webkit-overflow-scrolling: touch;
}

/* 滚动条 */
.ep-select-lenses-steps::-webkit-scrollbar {
    width: 8px;
}

.ep-select-lenses-steps::-webkit-scrollbar-track {
    background: var(--ep-bg);
}

.ep-select-lenses-steps::-webkit-scrollbar-thumb {
    background: var(--ep-border-strong);
    border-radius: 4px;
}

.ep-select-lenses-steps::-webkit-scrollbar-thumb:hover {
    background: var(--ep-muted);
}


/* =========================================
   左侧实时配置摘要卡片样式
   ========================================= */
.ep-product-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 18px;
    padding: 24px;
    overflow-y: auto;
}

.ep-product-image {
    width: 100%;
    max-width: 480px; /* 摘要卡片已移到右侧，左栏只放图片，恢复较大尺寸 */
    aspect-ratio: 1 / 1;
}

.ep-order-summary-card {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius);
    padding: 16px;
    box-shadow: var(--ep-shadow-sm);
    box-sizing: border-box;
}

/* 摘要卡片位于导航栏内部（与主操作按钮同行）时的样式 */
.ep-navigation > .ep-order-summary-card {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 16px;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    max-height: 160px;
    overflow-y: auto;
}

.ep-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--ep-border-strong);
    margin-bottom: 10px;
}

.ep-summary-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--ep-ink);
}

.ep-summary-total {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.ep-total-label {
    color: var(--ep-text);
}

.ep-total-amount {
    color: var(--ep-brand-dark);
    font-size: 20px;
    font-weight: 800;
}

.ep-summary-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ep-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.4;
}

.ep-summary-item .ep-item-label {
    color: var(--ep-muted);
    font-weight: 500;
    flex: 0 0 90px;
}

.ep-summary-item .ep-item-value {
    color: var(--ep-ink);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
    flex: 1;
}

/* 动效：新项出现时的微淡入 */
.ep-summary-item.updated .ep-item-value {
    animation: ep-highlight 0.5s ease;
}

@keyframes ep-highlight {
    0% { color: var(--ep-accent); transform: scale(1.05); }
    100% { color: var(--ep-ink); transform: scale(1); }
}

/* ==========================================================
   顶部标题栏：左侧优雅返回箭头 + 标题居中
   ========================================================== */
.ep-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--ep-border);
    background: #ffffff;
    box-sizing: border-box;
}

/* 左侧返回小箭头按钮 */
.ep-header-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--ep-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--ep-radius-sm);
    transition: all 0.2s ease;
    user-select: none;
}

.ep-header-back-btn:hover {
    color: var(--ep-brand);
    background-color: var(--ep-brand-softer);
    transform: translateX(-2px); /* 鼠标放上去时小箭头往左微动，有动态交互感 */
}

.ep-header-back-btn svg {
    display: block;
}

/* 中间标题 */
.ep-step-header h3 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    color: var(--ep-ink) !important;
    text-align: center;
    flex: 1;
}

/* 右侧隐形占位块（宽度和左侧按钮一样大，保证标题绝对水平居中） */
.ep-header-placeholder {
    width: 75px;
    flex-shrink: 0;
}

/* 修复返回箭头被主题按钮样式覆盖 */
#ep-lens-modal button.ep-back-arrow,
#ep-lens-modal button.ep-back-arrow:hover,
#ep-lens-modal button.ep-back-arrow:focus,
#ep-lens-modal button.ep-back-arrow:active {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--ep-ink) !important;
    border: none !important;
    box-shadow: none !important;
    outline: none;
}

/* 键盘操作时仍保留可见焦点 */
#ep-lens-modal button.ep-back-arrow:focus-visible {
    outline: 2px solid var(--ep-brand) !important;
    outline-offset: 2px;
}

/* Optical boutique typography V2 — softer sea-glass heading */
#ep-lens-modal .ep-step > h3,
#ep-lens-modal .ep-step-header > h3 {
    font-family: 'Manrope', 'Avenir Next', 'Segoe UI', Arial, sans-serif !important;
    font-size: clamp(20px, 2.3vw, 24px) !important;
    font-weight: 500 !important;
    letter-spacing: 0.15px !important;
    line-height: 1.55 !important;
    color: #477784 !important;
}
