/* ============ Tank config page ============ */

/* Top: 5 tanks (1연식~5연식) with 도금/수세 toggle */
.tank-series {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 28px;
  margin-bottom: 40px;
}
.tank-series__item { text-align: center; }
.sus-series { grid-template-columns: repeat(2, 1fr); max-width: 600px; }
.sus-series .tank-series__img { display: block; position: relative; }
.sus-series .tank-series__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 0; }
.tank-series__label {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
}
.tank-series__img {
  aspect-ratio: 302 / 243;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 14px;
}
.tank-series__img img { width: 100%; height: 100%; object-fit: contain; padding: 26px; }
/* 도금/수세 toggles stacked vertically (Figma node 2-6737) */
.tank-series__toggles { display: flex; flex-direction: column; gap: 8px; }
.tank-series__toggles button {
  padding: 15px 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 5px;
  color: var(--color-text-mute);
  transition: all .12s;
}
.tank-series__toggles button:hover { border-color: var(--color-navy); color: var(--color-navy); }
.tank-series__toggles button.is-active {
  background: var(--color-navy);
  color: #fff;
  border-color: var(--color-navy);
}
@media (max-width: 768px) {
  .tank-series { grid-template-columns: repeat(2, 1fr); }
}

/* Main split: left options / right detail */
.tank-split {
  display: grid;
  grid-template-columns: 560px 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 1200px) { .tank-split { grid-template-columns: 460px 1fr; gap: 24px; } }
@media (max-width: 960px) { .tank-split { grid-template-columns: 1fr; } }

/* Right panel: tank diagram image */
.tank-detail { position: sticky; top: 80px; }
.detail__img {
  aspect-ratio: 5/3;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 사양 오버레이 다이어그램 */
.tank-diagram {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tank-diagram__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.tank-lbl {
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  line-height: 1.5;
  transition: opacity .2s;
}
.tank-lbl--size {
  color: var(--color-red);
  background: rgba(255,255,255,.9);
  border: 1.5px solid var(--color-red);
  font-weight: 700;
}
.tank-lbl--opt {
  color: var(--color-navy);
  background: rgba(255,255,255,.9);
  border: 1.5px solid var(--color-navy);
}
/* 위치 — 이미지 비율 기준 % */
.tank-lbl-group {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}

/* Options panel (left) */
.options {
  padding: 40px 30px 30px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
}
.options__reset {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 400;
  color: #333;
  letter-spacing: -0.02em;
  cursor: pointer;
  padding-bottom: 0;
  margin-bottom: 38px;
  border-bottom: none;
}
.options__reset input[type="checkbox"] {
  width: 27px; height: 27px;
  flex-shrink: 0;
  accent-color: var(--color-navy);
  margin: 0;
}

.opt-row {
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}
.opt-row:last-of-type { border-bottom: none; padding-bottom: 0; }

/* Row label */
.opt-row__label {
  display: block;
  font-size: 20px;
  font-weight: 500;
  color: #000;
  letter-spacing: -0.02em;
  margin-bottom: 25px;
}

/* Select rows (카테고리, 텍스트검색): label left, select right */
.opt-row--select {
  display: flex;
  align-items: center;
}
.opt-row--select .opt-row__label {
  flex: 1;
  margin-bottom: 0;
}
.opt-group-name {
  font-size: 13px;
  font-weight: 600;
  color: #003087;
}
.opt-row--sub {
  padding-top: 12px;
  justify-content: flex-start;
}
.opt-row--sub .opt-select {
  width: auto;
  text-align: left !important;
  text-align-last: left !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23333' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.opt-select {
  width: 260px;
  height: 50px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  font-size: 18px;
  font-family: inherit;
  color: #333;
  letter-spacing: -0.02em;
  background: #fff;
  flex-shrink: 0;
  outline: none;
  cursor: pointer;
  text-align: right;
  text-align-last: right;
}
.opt-select:focus { border-color: var(--color-navy); }

/* Size row (제품사이즈): label+subtext left, WDH inputs right */
.opt-row--size {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 20px;
}
.opt-row--size .opt-row__label { margin-bottom: 10px; }
.opt-row__sub {
  font-size: 20px;
  font-weight: 400;
  color: #333;
  letter-spacing: -0.02em;
  line-height: 1.6;
  margin: 0;
}
.opt-row__right { display: flex; flex-direction: column; gap: 14px; }
.opt-row__inline {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 0;
}
.opt-row__inline label {
  font-size: 20px;
  font-weight: 400;
  color: #333;
  letter-spacing: -0.02em;
  min-width: 60px;
  flex-shrink: 0;
}
.opt-row__inline input {
  width: 140px;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  font-size: 18px;
  font-family: inherit;
  color: #333;
  letter-spacing: -0.02em;
  text-align: right;
  outline: none;
  transition: border-color .15s;
}
.opt-row__inline input:focus { border-color: var(--color-navy); }

/* Material (재질/색상): label stacked above chips */
.opt-material {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.opt-material:last-child { margin-bottom: 0; }
.opt-material__label {
  font-size: 20px;
  font-weight: 400;
  color: #333;
  letter-spacing: -0.02em;
}

/* Chips within options panel */
.options .chips { gap: 20px; }
.options .chip {
  min-width: 110px;
  height: 50px;
  padding: 0 12px;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.02em;
  border-radius: 6px;
  border: 1px solid var(--color-border-strong);
  background: #fff;
  color: #333;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .12s;
  line-height: 1;
}
.options .chip:hover {
  border-color: var(--color-red);
  color: var(--color-red);
}
.options .chip.is-active {
  background: #fff;
  border: 2px solid var(--color-red);
  color: var(--color-red);
  font-weight: 500;
}
.options .chip.is-disabled {
  background: #f5f5f5;
  border-color: #ddd;
  color: #bbb;
  cursor: not-allowed;
  pointer-events: none;
}
.options .chip--wide { min-width: 130px; }

/* 출하일 date input (242×70px with label) */
.opt-date-wrap {
  margin-top: 14px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: min(242px, 100%);
  height: 70px;
  padding: 10px 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
}
.opt-date-wrap span {
  font-size: 18px;
  font-weight: 400;
  color: #333;
  letter-spacing: -0.02em;
  line-height: 1;
}
.opt-date-wrap input[type="date"] {
  border: none;
  outline: none;
  font-size: 18px;
  color: #999;
  letter-spacing: -0.02em;
  padding: 0;
  background: transparent;
  font-family: inherit;
  line-height: 1;
  width: 100%;
}

/* 수량 input (navy border, same size as active chip) */
.opt-qty-input {
  width: 110px;
  height: 50px;
  border: 1.5px solid var(--color-navy);
  border-radius: 6px;
  padding: 0 12px;
  font-size: 18px;
  font-family: inherit;
  color: var(--color-navy);
  letter-spacing: -0.02em;
  text-align: center;
  outline: none;
  background: #fff;
}
.opt-qty-input:focus { border-color: var(--color-navy-dark); }

/* TOTAL */
.options__total {
  margin-top: 38px;
  padding-top: 0;
  border-top: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.options__total-label {
  font-size: 20px;
  font-weight: 500;
  color: #000;
  letter-spacing: -0.02em;
}
.options__total-value {
  font-size: 20px;
  font-weight: 500;
  color: #333;
  letter-spacing: -0.02em;
}

/* Popup trigger buttons below total */
.options__popup-btns {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  position: relative;
  z-index: 5;
}
.options__popup-btns .btn {
  flex: 1;
  padding: 14px 12px;
  font-size: 15px;
  border-radius: 6px;
}


/* Quote panel (Figma node 2-6540) */
.quote {
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 12px rgba(65, 65, 66, 0.14);
  padding: 32px 40px 40px;
}
.quote__head { padding: 8px 0 28px; display: flex; justify-content: center; }
.quote__head h3 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }

/* 공급받는자 / 공급자 — two key/value tables, label centered, value left */
.quote__parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 0 0 28px;
  border-bottom: 1px solid #ccc;
}
.quote__party th { width: 40%; }
.quote__party td { text-align: left; }
/* Figma 2-6425: horizontal separators only, no vertical divider
   between label/value — columns are distinguished by fill only */
.quote__party th, .quote__party td { border-top: none; border-left: none; border-right: none; }
.quote__party-head { font-size: 15px; font-weight: 700; letter-spacing: .06em; }

.quote__spec { padding: 28px 0 0; }
/* tables use the shared .tbl class (base.css) */
/* ── 견적서 모달 (quote_preview.php 와 동일 스타일) ── */
.q-parties { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 12.5px; }
.q-parties th, .q-parties td { border: 1px solid #bbb; padding: 6px 10px; }
.q-parties .party-head { background: #e8e8e8; font-weight: 700; text-align: center; font-size: 13px; }
.q-parties .lbl { background: #f5f5f5; font-weight: 600; text-align: center; width: 72px; white-space: nowrap; }

.price-tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 18px; }
.price-tbl th, .price-tbl td { border: 1px solid #bbb; padding: 7px 10px; text-align: center; }
.price-tbl .price-head th { background: #003277; color: #fff; font-weight: 700; }
.price-tbl td.text-left { text-align: left; vertical-align: top; }
.price-tbl .total-lbl { font-weight: 700; background: #f5f8f0; }
.price-tbl .total-amt { font-weight: 700; font-size: 14px; color: #3a5a10; background: #f5f8f0; }
.price-tbl .nego-row td { color: #666; font-size: 12px; }

.section-head { background: #003277; color: #fff; font-weight: 700; font-size: 13px; padding: 6px 14px; text-align: center; }
.spec-layout { display: flex; border: 1px solid #bbb; border-top: none; margin-bottom: 24px; }
.spec-photo { width: 38%; min-width: 140px; flex-shrink: 0; background: #fafafa; display: flex; align-items: center; justify-content: center; padding: 10px; }
.spec-photo img { max-width: 100%; max-height: 150px; width: auto; height: auto; display: block; object-fit: contain; }
.spec-tbl-wrap { flex: 1; min-width: 0; overflow: auto; }
.spec-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.spec-tbl th, .spec-tbl td { border: 1px solid #bbb; padding: 6px 10px; }
.spec-tbl tr > :first-child { border-left: none; }
.spec-tbl thead th { background: #003277; color: #fff; font-weight: 700; text-align: center; border-color: #002455; }
.spec-tbl tbody th { background: #f5f5f5; font-weight: 600; text-align: left; color: #333; width: 30%; }
.spec-tbl td { background: #fff; text-align: center; }
.spec-dim-val td { font-weight: 600; }

.q-memo { border: 1px solid #bbb; padding: 10px 14px; font-size: 12px; line-height: 2; margin-bottom: 18px; color: #c00; }
.q-memo strong { font-weight: 700; }

.quote__price { padding: 20px 0 0; }

.quote__memo { padding: 24px 0 0; font-size: 14px; color: var(--color-red); line-height: 1.8; letter-spacing: -0.01em; }
.quote__memo-title { display: block; font-size: 16px; color: var(--color-red); font-weight: 600; margin-bottom: 8px; }
/* Figma 2-6539: 주문하기 navy fill, 견적 다운로드 #f7f7f7 fill + #ccc border, radius 5px */
.quote__actions { padding: 32px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quote__actions .btn { min-width: 0; width: 100%; padding: 17px 12px; border-radius: 5px; }
.quote__actions .btn--outline { background: #f7f7f7; border-color: #ccc; color: var(--color-text); }
.quote__actions .btn--outline:hover { border-color: var(--color-navy); color: var(--color-navy); }

/* Request form panel */
.request { border: 1px solid var(--color-border); border-radius: 10px; padding: 32px; background: #fff; }
.request h3 { font-size: 22px; text-align: center; margin-bottom: 28px; }
.request__row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  align-items: start;
}
.request__row > label { font-size: 14px; font-weight: 500; padding-top: 12px; color: var(--color-text-mute); }
.request__row > label b { color: var(--color-red); margin-left: 4px; }
.request__row input:not([type="checkbox"]):not([type="radio"]),
.request__row textarea,
.request__row select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  font-size: 14px;
}
.request__row input[type="checkbox"],
.request__row input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--color-navy);
  flex-shrink: 0;
}
.request__row textarea { min-height: 130px; resize: vertical; }
.request__file {
  display: flex;
  gap: 10px;
  align-items: center;
}
.request__file button {
  padding: 10px 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  white-space: nowrap;
}
.request__file input[type="text"] { flex: 1; }
.request__agree {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 16px 0 0;
  font-size: 13px;
  color: var(--color-text-mute);
  cursor: pointer;
}
.request__agree:hover { color: var(--color-text); }
.request__actions { display: flex; gap: 10px; justify-content: center; padding-top: 20px; }
.request__actions .btn { min-width: 160px; }

/* Modal backdrop + dialog */
.ik-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ik-modal-backdrop.is-open { display: flex; }
.ik-modal {
  background: #fff;
  border-radius: 10px;
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.ik-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.ik-modal__header h3 { font-size: 20px; font-weight: 700; margin: 0; }
.ik-modal__close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--color-text-mute);
  cursor: pointer;
  padding: 0 4px;
}
.ik-modal__close:hover { color: var(--color-text); }
.ik-modal__body {
  overflow-y: auto;
  padding: 28px;
  flex: 1;
}
/* Override quote card shadow inside modal */
.ik-modal__body .quote { box-shadow: none; padding: 0; border-radius: 0; }

@media (max-width: 640px) {
  /* 탱크 시리즈 카드 */
  .tank-series { gap: 10px; margin-bottom: 24px; }
  .tank-series__label { font-size: 13px; margin-bottom: 8px; }
  .tank-series__toggles button { padding: 8px 4px; font-size: 12px; }

  /* 옵션 폼 */
  .options { padding: 20px 16px 20px; }
  .options__reset { font-size: 14px; margin-bottom: 20px; }
  .options__reset input[type="checkbox"] { width: 20px; height: 20px; }

  .opt-row { padding: 14px 0; }
  .opt-row__label { font-size: 15px; margin-bottom: 12px; }

  /* 카테고리·검색 select 행 */
  .opt-row--select { flex-wrap: wrap; gap: 8px; }
  .opt-select { width: 100%; height: 40px; font-size: 14px; }

  /* 제품사이즈 행 */
  .opt-row--size { grid-template-columns: 1fr; gap: 10px; }
  .opt-row__sub { font-size: 14px; }
  .opt-row__inline { gap: 10px; }
  .opt-row__inline label { font-size: 14px; min-width: 50px; }
  .opt-row__inline input { height: 40px; font-size: 14px; width: 120px; }

  /* 칩 */
  .options .chips { gap: 8px; flex-wrap: wrap; }
  .options .chip { height: 38px; min-width: 72px; font-size: 14px; padding: 0 10px; }
  .options .chip--wide { min-width: 100px; }

  /* 출하일 date */
  .opt-date-wrap span { font-size: 14px; }
  .opt-date-wrap input[type="date"] { font-size: 14px; }

  /* 수량 */
  .opt-qty-input { height: 40px; font-size: 14px; }

  /* 합계 */
  .options__total { margin-top: 20px; }
  .options__total-label, .options__total-value { font-size: 16px; }

  /* 팝업 버튼 */
  .options__popup-btns { flex-direction: column; gap: 8px; margin-top: 14px; }
  .options__popup-btns .btn { padding: 12px; font-size: 14px; }

  /* 모달 */
  .ik-modal { border-radius: 0; max-height: 100vh; }
  .ik-modal-backdrop { padding: 0; align-items: flex-end; }
  .ik-modal__body { padding: 16px; }
  .ik-modal__header { padding: 16px 20px; }

  /* 고객요청 폼 */
  .request { padding: 0; }
  .request__row { grid-template-columns: 1fr; }
  .request__row > label { padding-top: 0; }

  /* 견적서 */
  .quote { padding: 16px; }
  .quote__head h3 { font-size: 18px; }
  .quote__parties { grid-template-columns: 1fr; gap: 12px; }
  .quote__actions { grid-template-columns: 1fr; gap: 8px; }

  /* 모달 내 테이블: base.css display:block 오버라이드 → 전체 너비 */
  .ik-modal__body .tbl {
    display: table;
    width: 100%;
    white-space: normal;
    overflow-x: auto;
  }
  .ik-modal__body .tbl th,
  .ik-modal__body .tbl td {
    white-space: normal;
    word-break: keep-all;
  }

  /* 출하일 */
  .opt-date-wrap { width: 100%; height: auto; min-height: 60px; }

}
