/**
 * estimate-restore.css — 見積番号でご注文 画面のスタイル
 *
 * グローバルメニュー (global_menu.php) + サイドメニュー (saide_menu.php) +
 * フッター (foot.php) と併用。共通chrome のスタイル (base.css 等) を
 * 上書きしないよう、すべて .er- 接頭辞のスコープ内で完結させる。
 *
 * デスクトップファースト (max-width:768px でモバイル縮退)。
 * 既存のカラートークン (#1d2988 メインブルー / #f5f5f5 背景) と整合。
 */

/* グローバルchrome内に置かれる前提なので body はリセットしない */

/* ========================================================================
   ページラッパー (with-sidebar に内包される構造)
   ======================================================================== */
.er-page {
    background: #faf7f3;
    min-height: 60vh;
}
.er-page a { color: #1d2988; }
.er-page a:hover { text-decoration: underline; }

/* guide-page__body 内の本文ラッパー */
.guide-page__body { font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', 'Noto Sans JP', sans-serif; color: #333; line-height: 1.7; }

.er-breadcrumb {
    font-size: 12px;
    color: #888;
    margin-bottom: 20px;
}
.er-breadcrumb a { color: #1d2988; }

.er-title {
    font-size: 28px;
    font-weight: 700;
    color: #1d2988;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

.er-lead {
    font-size: 15px;
    color: #555;
    margin-bottom: 28px;
    line-height: 1.8;
}

/* ========================================================================
   カード共通
   ======================================================================== */
.er-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px 28px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ========================================================================
   入力フォーム
   ======================================================================== */
.er-form-card {
    border-left: 4px solid #1d2988;
    padding-left: 24px;
}

.er-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1d2988;
    margin-bottom: 8px;
}

.er-form__row {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 8px;
}

.er-input {
    flex: 1;
    padding: 12px 14px;
    font-size: 16px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fcfcfd;
    color: #333;
    letter-spacing: 0.02em;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.er-input:focus {
    outline: none;
    border-color: #1d2988;
    box-shadow: 0 0 0 3px rgba(29, 41, 136, 0.12);
}

.er-hint {
    font-size: 12px;
    color: #888;
    line-height: 1.6;
}

/* ========================================================================
   ボタン
   ======================================================================== */
.er-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
    transition: background 0.15s, transform 0.05s;
}
.er-btn:hover { text-decoration: none; }
.er-btn:active { transform: translateY(1px); }

.er-btn--primary {
    background: #1d2988;
    color: #fff;
}
.er-btn--primary:hover { background: #2a3aaa; color: #fff; }

.er-btn--secondary {
    background: #fff;
    color: #555;
    border: 1px solid #ccc;
}
.er-btn--secondary:hover { background: #f5f5f5; color: #333; }

.er-btn--cta {
    background: #d6336c;
    color: #fff;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(214, 51, 108, 0.25);
}
.er-btn--cta:hover { background: #e74e84; color: #fff; }

/* ========================================================================
   情報カード (期限OK)
   ======================================================================== */
.er-info-card {
    background: #f0f7ff;
    border-left: 4px solid #1d2988;
    padding: 16px 24px;
    color: #1a3a8a;
    font-size: 14px;
}
.er-info-card p { margin: 0; }
.er-days-left {
    font-weight: 600;
    color: #1d2988;
    margin-left: 4px;
}

/* ========================================================================
   警告カード (期限切れ / 旧バージョン)
   ======================================================================== */
.er-warn-card {
    background: #fff8e1;
    border-left: 4px solid #f59f00;
    padding: 20px 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    color: #6b4d00;
}
.er-warn-card--expired {
    background: #ffe8e8;
    border-left-color: #d63031;
    color: #6e1313;
}
.er-warn-icon {
    font-size: 28px;
    font-weight: 700;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: #f59f00;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.er-warn-card--expired .er-warn-icon { background: #d63031; }
.er-warn-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: inherit;
}
.er-warn-card p { font-size: 13px; line-height: 1.7; margin-bottom: 4px; }

/* ========================================================================
   エラーカード
   ======================================================================== */
.er-error-card {
    background: #fff;
    border-left: 4px solid #d63031;
    padding: 28px;
    text-align: center;
}
.er-error-icon {
    width: 56px;
    height: 56px;
    background: #d63031;
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 14px;
}
.er-error-icon i { display: none; }
.er-error-title {
    font-size: 18px;
    color: #d63031;
    margin-bottom: 10px;
}
.er-error-msg {
    font-size: 14px;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.7;
}

/* ========================================================================
   メタグリッド (見積番号・発行日時など)
   ======================================================================== */
.er-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 24px;
}
.er-meta-grid > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f5;
}
.er-meta-label {
    font-size: 12px;
    color: #888;
}
.er-meta-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    font-family: 'SF Mono', 'Menlo', monospace;
}
.er-meta-value--total {
    color: #1d2988;
    font-size: 18px;
    font-weight: 700;
    font-family: inherit;
}

/* ========================================================================
   商品明細
   ======================================================================== */
.er-item-card {
    padding: 24px 28px;
}
.er-item-title {
    font-size: 17px;
    color: #1d2988;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.er-item-no {
    background: #1d2988;
    color: #fff;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.er-spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.er-spec-table th {
    text-align: left;
    padding: 9px 14px;
    color: #666;
    font-weight: 500;
    width: 130px;
    vertical-align: top;
    background: #fafafc;
    white-space: nowrap;
    border-bottom: 1px solid #f0f0f5;
}
.er-spec-table td {
    padding: 9px 14px;
    color: #333;
    word-break: break-word;
    border-bottom: 1px solid #f0f0f5;
}
.er-spec-table tr:last-child th,
.er-spec-table tr:last-child td { border-bottom: none; }
.er-spec-table__price th { background: #f0f7ff; color: #1d2988; }
.er-spec-table__price td { font-weight: 700; color: #1d2988; }

/* ========================================================================
   合計表
   ======================================================================== */
.er-summary-card {
    padding: 24px 28px;
}
.er-summary-title {
    font-size: 16px;
    color: #1d2988;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8e8f0;
}
.er-totals-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.er-totals-table td {
    padding: 8px 0;
}
.er-totals-table td:first-child { color: #555; }
.er-totals-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: #333;
    font-variant-numeric: tabular-nums;
}
.er-totals-grand td {
    border-top: 2px solid #333;
    padding-top: 14px;
    color: #1d2988;
    font-size: 18px;
    font-weight: 700;
}
.er-totals-grand td:last-child { color: #1d2988; }

/* ========================================================================
   アクション
   ======================================================================== */
.er-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
}
.er-actions--main {
    margin: 36px 0 0;
    flex-direction: row;
}

/* ========================================================================
   ヘルプカード
   ======================================================================== */
.er-help-card {
    background: #f8f9fc;
    border: 1px solid #e8e8f0;
    box-shadow: none;
}
.er-help-card h2 {
    font-size: 15px;
    color: #1d2988;
    margin-bottom: 12px;
}
.er-help-list {
    list-style: none;
    padding: 0;
    margin-bottom: 16px;
}
.er-help-list li {
    font-size: 13px;
    color: #555;
    padding: 8px 0 8px 24px;
    position: relative;
    line-height: 1.7;
}
.er-help-list li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 14px;
    width: 8px;
    height: 8px;
    background: #1d2988;
    border-radius: 50%;
}
.er-help-note {
    font-size: 12px;
    color: #888;
    line-height: 1.7;
    padding-top: 12px;
    border-top: 1px dashed #e0e0e8;
}

/* ========================================================================
   モバイル縮退 (デスクトップが主軸、モバイルは破綻防止)
   ======================================================================== */
@media (max-width: 768px) {
    .er-page { padding: 20px 0 40px; }
    .er-container { padding: 0 16px; }
    .er-title { font-size: 22px; }
    .er-lead { font-size: 14px; }

    .er-card { padding: 18px 18px; }

    .er-form__row { flex-direction: column; gap: 10px; }
    .er-input { font-size: 15px; padding: 11px 12px; }
    .er-btn { padding: 12px 18px; }
    .er-btn--cta { padding: 14px 20px; font-size: 15px; width: 100%; }

    .er-meta-grid { grid-template-columns: 1fr; gap: 6px; }
    .er-meta-grid > div { padding: 6px 0; }

    .er-spec-table th { width: 100px; padding: 8px 10px; font-size: 13px; }
    .er-spec-table td { padding: 8px 10px; font-size: 13px; }
    .er-totals-table { font-size: 13px; }
    .er-totals-grand td { font-size: 16px; }

    .er-actions--main { flex-direction: column; align-items: stretch; }
    .er-actions--main .er-btn { width: 100%; }

    .er-warn-card { flex-direction: column; gap: 10px; padding: 16px; }
    .er-warn-icon { width: 32px; height: 32px; font-size: 22px; }
}
