/* ============================================================
   見積シミュレーター (page-estimate.php)
   デザイン軸: ファッションポップ
   libars.css の :root トークンを継承（ここで再定義しない）
   影は基本ベタの Npx Npx 0、ぼかしshadow・パステル・pill多用は禁止
   ============================================================ */

.estimate-page {
  padding-bottom: 140px; /* sticky バー分の余白 */
}

.est-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== イントロ ===== */
.est-intro {
  padding: 150px 0 40px;
  text-align: center;
}

.est-intro h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 900;
  color: var(--ink);
}

.est-lead {
  margin: 0;
  font-size: 15px;
  line-height: 2;
  color: #555;
}

/* ===== ステップ共通 ===== */
.est-step {
  margin-bottom: 56px;
}

.est-step-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
}

.est-step-num {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  transform: rotate(-4deg);
}

/* ===== STEP1: メニューカード ===== */
.est-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.est-menu-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.est-menu-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--ink);
}

.est-menu-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.est-menu-image {
  display: block;
  height: 130px;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
}

.est-menu-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.est-menu-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px 16px;
}

.est-menu-en {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
}

.est-menu-ja {
  font-size: 16px;
  font-weight: 900;
  color: var(--ink);
}

.est-menu-price {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--red);
}

.est-menu-price small {
  margin-left: 4px;
  font-family: Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #888;
}

.est-menu-badge {
  font-size: 11px;
  color: #555;
}

.est-menu-check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--white);
  color: transparent;
  font-weight: 900;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.est-menu-card:has(input:checked) {
  border-color: var(--blue);
  box-shadow: 6px 6px 0 var(--blue);
}

.est-menu-card:has(input:checked) .est-menu-check {
  background: var(--blue);
  color: #fff;
  transform: rotate(6deg);
}

/* ===== STEP2: オプション ===== */
.est-option-group {
  margin: 0 0 18px;
  padding: 26px 20px 14px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
}

.est-option-group legend {
  padding: 4px 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
  transform: rotate(-2deg);
}

.est-option-list {
  display: flex;
  flex-direction: column;
}

.est-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 6px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.25);
}

.est-option:last-child {
  border-bottom: 0;
}

.est-option-label {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.6;
}

.est-option-label em {
  display: block;
  font-style: normal;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}

/* check */
.est-option-check {
  cursor: pointer;
}

.est-option-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.est-option-mark {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--white);
  color: transparent;
  font-weight: 900;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.est-option-check:has(input:checked) .est-option-mark {
  background: var(--red);
  color: #fff;
  transform: rotate(6deg);
}

/* qty */
.est-qty-control {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.est-qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--white);
  font-size: 18px;
  font-weight: 900;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.est-qty-btn:hover {
  background: var(--yellow);
  transform: translate(-1px, -1px);
}

.est-qty-value {
  min-width: 26px;
  text-align: center;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.est-option-qty.is-active .est-qty-value {
  color: var(--blue);
}

/* ===== STEP3: フォーム ===== */
.est-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  padding: 26px 24px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
}

.est-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
}

.est-field-wide {
  grid-column: 1 / -1;
}

.est-field label {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
}

.est-req {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  border-radius: 6px;
  background: var(--red);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  vertical-align: 1px;
}

.est-req-either {
  background: var(--blue);
}

.est-field input,
.est-field select,
.est-field textarea {
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--white);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.est-field input:focus,
.est-field select:focus,
.est-field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 3px 3px 0 var(--blue);
}

.est-date-row {
  display: flex;
  gap: 10px;
}

.est-date-row input {
  flex: 1 1 55%;
}

.est-date-row select {
  flex: 1 1 45%;
}

.est-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ===== STEP4: サマリー + 送信 ===== */
.est-summary {
  margin-bottom: 22px;
  padding: 26px 26px 20px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
}

.est-summary h3 {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 900;
  color: var(--ink);
}

.est-summary dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  margin: 0 0 14px;
  padding-bottom: 14px;
  border-bottom: 2px dashed var(--ink);
}

.est-summary dt {
  font-size: 14px;
  color: #555;
}

.est-summary dd {
  margin: 0;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  color: var(--ink);
}

.est-summary-total {
  margin: 0;
  text-align: right;
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
}

.est-summary-total strong {
  margin: 0 4px;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: var(--red);
}

.est-error {
  margin: 0 0 18px;
  padding: 14px 18px;
  border: 2px solid var(--red);
  border-radius: 10px;
  background: var(--white);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.9;
  color: var(--red);
}

.est-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.est-line-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  max-width: 440px;
  padding: 18px 30px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #06C755;
  font-family: inherit;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.est-line-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.est-line-btn.is-sending {
  opacity: 0.7;
  pointer-events: none;
}

.est-line-btn small {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.est-copy-btn {
  padding: 12px 26px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--white);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 900;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease;
}

.est-copy-btn:hover {
  background: var(--yellow);
}

.est-qr {
  margin-top: 26px;
  text-align: center;
}

.est-qr p {
  margin: 0 0 12px;
  font-size: 13px;
  color: #555;
}

.est-qr-canvas {
  display: inline-block;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
}

.est-qr-canvas svg,
.est-qr-canvas img,
.est-qr-canvas canvas {
  display: block;
}

.est-friend {
  margin: 26px 0 0;
  text-align: center;
  font-size: 13.5px;
  color: #555;
}

.est-friend a {
  font-weight: 900;
  color: var(--blue);
  text-decoration: underline;
}

.est-note {
  margin: 22px 0 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.9;
  color: #888;
}

/* ===== sticky 合計バー ===== */
.est-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-top: 2px solid var(--ink);
}

.est-sticky-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 880px;
  margin: 0 auto;
}

.est-sticky-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.est-sticky-menu {
  font-size: 12px;
  font-weight: 700;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.est-sticky-total {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
}

.est-sticky-total strong {
  margin: 0 2px;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--red);
}

.est-sticky-cta {
  flex: 0 0 auto;
  padding: 13px 26px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--yellow);
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.est-sticky-cta:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
  .est-intro {
    padding: 120px 0 30px;
  }

  .est-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .est-form-grid {
    grid-template-columns: 1fr;
    padding: 20px 16px;
  }

  .est-qr {
    display: none; /* モバイルは直接LINE遷移するのでQR不要 */
  }
}

@media (max-width: 480px) {
  .est-menu-grid {
    grid-template-columns: 1fr;
  }

  .est-menu-image {
    height: 150px;
  }

  .est-sticky-cta {
    padding: 12px 18px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .est-menu-card,
  .est-menu-check,
  .est-option-mark,
  .est-qty-btn,
  .est-line-btn,
  .est-copy-btn,
  .est-sticky-cta {
    transition: none;
  }
}

/* libars.css の main h2 !important への counter
   libars.css 1304/1322/1328/1414/1444/1458 行の
   `main h2 { font-size: ... !important }` が .est-step-title (h2) を
   92px 級に肥大させるため、specificity (0,2,1) + !important で上書き。
   main h1 / main h3 には font-size !important が無いため counter 不要
   (.est-intro h1 / .est-summary h3 は既存ルールがそのまま有効)。 */
main.estimate-page .est-step-title {
  font-size: 22px !important;
}

@media (max-width: 640px) {
  main.estimate-page .est-step-title {
    font-size: 19px !important;
  }
}
