/* SDP easy estimate modern redesign.
   Load after estimate.css. Keeps the current JS and changes only the visual layer. */

:root {
  --sdp-estimate-brand: #a34f4d;
  --sdp-estimate-brand-dark: #803d3c;
  --sdp-estimate-ink: #222326;
  --sdp-estimate-muted: #5d6269;
  --sdp-estimate-soft: #f7f6f4;
  --sdp-estimate-line: #e2e1df;
  --sdp-estimate-paper: #fffdfb;
  --sdp-estimate-dark: #2d3034;
}

.estimate-dock,
.estimate-dock *,
.estimate-overlay,
.estimate-overlay * {
  box-sizing: border-box;
  letter-spacing: 0;
}

.estimate-dock {
  bottom: 20px;
  width: min(780px, calc(100% - 48px));
  grid-template-columns: 1.16fr 1fr 1fr;
  overflow: hidden;
  border: 1px solid rgb(34 35 38 / 0.12);
  border-radius: 8px;
  background: rgb(255 253 251 / 0.98);
  box-shadow: 0 16px 42px rgb(34 35 38 / 0.18);
  backdrop-filter: blur(12px);
}

.estimate-dock-item {
  min-height: 72px;
  gap: 12px;
  padding: 12px 18px;
  border-right: 1px solid var(--sdp-estimate-line);
  color: var(--sdp-estimate-ink);
  background: #fff;
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.estimate-dock-item:hover,
.estimate-dock-item:focus-visible {
  color: var(--sdp-estimate-brand-dark);
  background: #fbf8f6;
  transform: translateY(-1px);
}

.estimate-dock-item svg {
  width: 32px;
  height: 32px;
  stroke-width: 2.4;
}

.estimate-dock-item small {
  color: var(--sdp-estimate-muted);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 900;
  letter-spacing: 0;
}

.estimate-dock-item strong {
  margin-top: 2px;
  color: inherit;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 900;
}

.estimate-dock-price {
  color: #fff;
  border-color: var(--sdp-estimate-brand);
  background: var(--sdp-estimate-brand);
}

.estimate-dock-price:hover,
.estimate-dock-price:focus-visible {
  color: #fff;
  background: var(--sdp-estimate-brand-dark);
}

.estimate-dock-price small,
.estimate-dock-mail small,
.estimate-dock-contact small {
  color: rgb(255 255 255 / 0.84);
}

.estimate-dock-mail {
  color: #fff;
  background: #6e7175;
}

.estimate-dock-mail:hover,
.estimate-dock-mail:focus-visible {
  color: #fff;
  background: #62656a;
}

.estimate-dock-contact {
  color: #fff;
  background: var(--sdp-estimate-dark);
}

.estimate-dock-contact:hover,
.estimate-dock-contact:focus-visible {
  color: #fff;
  background: #202226;
}

.estimate-overlay {
  padding: 24px;
  background: rgb(22 21 22 / 0.68);
  backdrop-filter: blur(6px);
}

.estimate-modal {
  width: min(900px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  padding: 34px;
  border: 1px solid rgb(255 255 255 / 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fff 0%, #fbfaf8 100%);
  box-shadow: 0 26px 84px rgb(0 0 0 / 0.30);
}

.estimate-close {
  top: 18px;
  right: 18px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--sdp-estimate-line);
  border-radius: 8px;
  color: var(--sdp-estimate-ink);
  background: #fff;
  font-size: 26px;
  line-height: 1;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.estimate-close:hover,
.estimate-close:focus-visible {
  border-color: var(--sdp-estimate-brand);
  color: var(--sdp-estimate-brand-dark);
  background: #fff8f5;
}

.estimate-progress {
  justify-content: flex-start;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto 18px;
}

.estimate-progress i {
  flex: 1 1 0;
  width: auto;
  max-width: 120px;
  height: 5px;
  border-radius: 8px;
  background: #e9e3df;
}

.estimate-progress i.active {
  background: var(--sdp-estimate-brand);
}

.estimate-back {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  margin-left: max(0px, calc((100% - 760px) / 2));
  padding: 0;
  color: var(--sdp-estimate-brand-dark);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 900;
}

.estimate-back[hidden] {
  display: none;
}

.estimate-content {
  max-width: 760px;
  margin: 18px auto 0;
  text-align: left;
}

.estimate-kicker {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  margin: 0;
  padding: 4px 9px;
  border: 1px solid rgb(163 79 77 / 0.28);
  border-radius: 6px;
  color: var(--sdp-estimate-brand-dark);
  background: #fff8f5;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 900;
  letter-spacing: 0;
}

.estimate-content h2 {
  margin: 14px 0 8px;
  color: var(--sdp-estimate-ink);
  font-size: 32px;
  line-height: 1.32;
  font-weight: 900;
}

.estimate-content > p:not(.estimate-kicker),
.estimate-note {
  max-width: 660px;
  color: var(--sdp-estimate-muted);
  font-size: 15px;
  line-height: 1.8;
}

.estimate-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.estimate-option {
  position: relative;
  min-height: 72px;
  padding: 16px 42px 16px 16px;
  border: 1px solid var(--sdp-estimate-line);
  border-radius: 8px;
  color: var(--sdp-estimate-ink);
  background: #fff;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 900;
  text-align: left;
  box-shadow: 0 8px 22px rgb(34 35 38 / 0.04);
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease;
}

.estimate-option::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
  opacity: .45;
}

.estimate-option:hover,
.estimate-option:focus-visible {
  border-color: var(--sdp-estimate-brand);
  color: var(--sdp-estimate-brand-dark);
  background: #fff8f5;
  transform: translateY(-1px);
}

.estimate-selection {
  margin: 24px 0;
  overflow: hidden;
  border: 1px solid var(--sdp-estimate-line);
  border-radius: 8px;
  background: #fff;
}

.estimate-selection div {
  grid-template-columns: 120px minmax(0, 1fr);
  padding: 14px 16px;
  border-bottom: 1px solid var(--sdp-estimate-line);
}

.estimate-selection div:last-child {
  border-bottom: 0;
}

.estimate-selection dt {
  color: var(--sdp-estimate-muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 900;
}

.estimate-selection dd {
  color: var(--sdp-estimate-ink);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 900;
}

.estimate-result-actions {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.estimate-result-actions a {
  min-height: 58px;
  border: 1px solid var(--sdp-estimate-brand);
  border-radius: 6px;
  color: #fff;
  background: var(--sdp-estimate-brand);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 900;
  text-decoration: none;
}

.estimate-result-actions a:last-child {
  border-color: var(--sdp-estimate-dark);
  background: var(--sdp-estimate-dark);
}

.estimate-result-actions a:hover,
.estimate-result-actions a:focus-visible {
  background: var(--sdp-estimate-brand-dark);
}

.estimate-result-actions a:last-child:hover,
.estimate-result-actions a:last-child:focus-visible {
  background: #202226;
}

@media (prefers-reduced-motion: reduce) {
  .estimate-dock-item,
  .estimate-close,
  .estimate-option {
    transition: none;
  }
}

@media (max-width: 820px) {
  /* SP: 以前から好評の「丸」デザイン（円形アイコンボタン・中央=修理料金を強調） */
  .estimate-dock {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
    overflow: visible;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--sdp-estimate-line);
    border-radius: 0;
    background: rgb(255 255 255 / 0.96);
    box-shadow: 0 -8px 28px rgb(32 26 28 / 0.12);
    transform: none;
  }

  .estimate-dock-item {
    width: 92px;
    min-height: 92px;
    justify-self: center;
    flex-direction: column;
    gap: 3px;
    padding: 6px 3px;
    border: 1px solid var(--sdp-estimate-line);
    border-radius: 50%;
    background: #fff;
    text-align: center;
  }

  .estimate-dock-item:last-child {
    border: 1px solid var(--sdp-estimate-line);
  }

  .estimate-dock-item svg {
    width: 30px;
    height: 30px;
  }

  .estimate-dock-item small {
    display: none;
  }

  .estimate-dock-item strong {
    margin: 0;
    font-size: 13px;
  }

  .estimate-dock-price {
    width: 104px;
    min-height: 104px;
    margin-top: -19px;
    border-color: var(--sdp-estimate-brand);
    border-radius: 50%;
    background: var(--sdp-estimate-brand);
    box-shadow: 0 7px 18px rgb(167 61 73 / 0.24);
  }

  .estimate-dock-mail {
    border-color: #6e7175;
    color: #fff;
    background: #6e7175;
  }

  .estimate-dock-contact {
    border-color: var(--sdp-estimate-dark);
    color: #fff;
    background: var(--sdp-estimate-dark);
  }

  .estimate-modal {
    max-height: calc(100vh - 26px);
    padding: 26px 16px 20px;
    border-radius: 8px;
  }

  .estimate-close {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
  }

  .estimate-content {
    margin-top: 16px;
  }

  .estimate-content h2 {
    padding-right: 44px;
    font-size: 24px;
  }

  .estimate-content > p:not(.estimate-kicker),
  .estimate-note {
    font-size: 14px;
  }

  .estimate-options {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .estimate-option {
    min-height: 60px;
    padding: 13px 34px 13px 13px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .estimate-overlay {
    padding: 12px;
    align-items: end;
  }

  .estimate-modal {
    width: 100%;
    max-height: calc(100vh - 22px);
  }

  .estimate-progress i {
    max-width: none;
  }

  .estimate-content h2 {
    font-size: 22px;
  }

  .estimate-options,
  .estimate-result-actions {
    grid-template-columns: 1fr;
  }

  .estimate-selection div {
    grid-template-columns: 86px minmax(0, 1fr);
  }
}
