/* assets/css/option-suggestions.css */
html.rm-option-sheet-open,
body.rm-option-sheet-open {
  overflow: hidden !important;
}

.rm-option-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100500;
  background: rgba(15, 23, 42, .42);
  opacity: 0;
  transition: opacity .24s ease;
}

.rm-option-sheet,
.rm-option-sheet * {
  box-sizing: border-box;
}

.rm-option-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 100510;
  display: flex;
  flex-direction: column;
  width: min(calc(100vw - 16px), 680px);
  max-width: calc(100vw - 16px);
  max-height: min(92dvh, 900px);
  overflow: hidden;
  background: #fff;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -20px 60px rgba(15, 23, 42, .22);
  transform: translate(-50%, 105%);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#rm-option-suggestion-root.is-open .rm-option-sheet-backdrop {
  opacity: 1;
}

#rm-option-suggestion-root.is-open .rm-option-sheet {
  transform: translate(-50%, 0);
}

.rm-option-sheet-header {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 17px 13px;
  border-bottom: 1px solid #e6edf5;
}

.rm-option-sheet-header h2 {
  min-width: 0;
  margin: 0;
  color: #0f172a;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.rm-option-sheet-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #d8e1eb;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.rm-option-sheet-content {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 14px 20px;
  overscroll-behavior: contain;
}

.rm-option-sheet-section + .rm-option-sheet-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #e5edf5;
}

.rm-option-sheet-selected-main {
  margin: 0 0 10px;
  padding: 10px 11px;
  border: 1px solid #cfe2f5;
  border-radius: 12px;
  background: #f5faff;
}

.rm-option-sheet-selected-main small {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}

.rm-option-sheet-selected-main-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.rm-option-sheet-selected-main-row strong {
  min-width: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.rm-option-sheet-selected-main-row span {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f3ff;
  color: #0e8ae6;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.rm-option-sheet-section-title {
  margin: 0 0 10px;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.5;
}

.rm-option-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.rm-option-sheet-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce7f2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(15, 23, 42, .05);
}

.rm-option-sheet-card.is-selected {
  border-color: #0e8ae6;
  box-shadow: 0 0 0 2px rgba(14, 138, 230, .12);
}

.rm-option-sheet-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #eef6fc;
}

.rm-option-sheet-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rm-option-sheet-placeholder {
  font-size: 31px;
}

.rm-option-sheet-card-body {
  min-width: 0;
  padding: 9px 9px 11px;
}

.rm-option-sheet-badge {
  display: inline-flex;
  max-width: 100%;
  margin-bottom: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1.3;
  white-space: nowrap;
}

.rm-option-sheet-badge.is-main {
  background: #f0fdf4;
  color: #15803d;
}

.rm-option-sheet-card h4 {
  min-width: 0;
  margin: 0;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rm-option-sheet-card-body > p {
  margin: 5px 0 9px;
  color: #0e8ae6;
  font-size: 12px;
  font-weight: 900;
}

.rm-option-sheet-qty,
.rm-option-sheet-condition-actions {
  display: grid;
  grid-template-columns: 32px minmax(30px, 1fr) 32px;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.rm-option-sheet-qty button,
.rm-option-sheet-condition-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 1px solid #cbdcf0;
  border-radius: 8px;
  background: #fff;
  color: #0e8ae6;
  font-size: 19px;
  font-weight: 800;
  cursor: pointer;
}

.rm-option-sheet-qty button:disabled,
.rm-option-sheet-condition-actions button:disabled {
  color: #a8b4c0;
  background: #f5f7f9;
  cursor: default;
}

.rm-option-sheet-qty strong,
.rm-option-sheet-condition-actions strong {
  min-width: 0;
  text-align: center;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
}

.rm-option-sheet-condition-box {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed #cbd5e1;
}

.rm-option-sheet-condition-title {
  margin-bottom: 7px;
  color: #92400e;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1.45;
}

.rm-option-sheet-condition-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 94px;
  gap: 6px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid #f1f5f9;
}

.rm-option-sheet-condition-row > span {
  min-width: 0;
  color: #334155;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.rm-option-sheet-condition-actions {
  grid-template-columns: 26px 34px 26px;
  gap: 3px;
}

.rm-option-sheet-condition-actions button {
  height: 27px;
  border-radius: 7px;
  font-size: 16px;
}

.rm-option-sheet-footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px 13px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid #dfe8f1;
  background: rgba(255, 255, 255, .99);
  box-shadow: 0 -8px 22px rgba(15, 23, 42, .06);
}

.rm-option-sheet-price-wrap {
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 9px;
  min-width: 0;
}

.rm-option-sheet-price-wrap.has-change {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}

.rm-option-sheet-original,
.rm-option-sheet-current {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.rm-option-sheet-original {
  display: none;
}

.rm-option-sheet-price-wrap.has-change .rm-option-sheet-original {
  display: flex;
}

.rm-option-sheet-current {
  align-items: flex-end;
  text-align: right;
}

.rm-option-sheet-price-wrap:not(.has-change) .rm-option-sheet-current {
  grid-column: 1;
}

.rm-option-sheet-footer small {
  color: #64748b;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.4;
}

.rm-option-sheet-footer strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.rm-option-sheet-original strong.is-crossed {
  color: #94a3b8;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.rm-option-sheet-current strong {
  color: #0e8ae6;
  font-size: 22px;
}

.rm-option-sheet-delta {
  color: #dc2626;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
}

.rm-option-sheet-apply {
  width: 100%;
  min-height: 47px;
  padding: 10px 13px;
  border: none;
  border-radius: 999px;
  background: #0e8ae6;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.4;
  cursor: pointer;
}

/* Step2: 条件確認と通常オプションを見分ける */
.rm-v2-inline-option-section + .rm-v2-inline-option-section {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid #dce7f2;
}

.rm-v2-inline-option-section.is-condition {
  padding: 10px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: #fffaf3;
}

.rm-v2-inline-option-section.is-condition + .rm-v2-inline-option-section {
  border-top: none;
}

.rm-v2-inline-option-section.is-condition .rm-v2-inline-options-title {
  color: #9a3412;
}

.rm-v2-inline-options-help {
  margin: 3px 0 8px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.rm-v2-inline-option-row.is-condition {
  background: #fff;
}

@media (max-width: 640px) {
  .rm-option-sheet {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    max-height: 94dvh;
    border-radius: 20px 20px 0 0;
  }

  .rm-option-sheet-header {
    padding: 14px 13px 11px;
  }

  .rm-option-sheet-header h2 {
    font-size: 17px;
  }

  .rm-option-sheet-close {
    width: 34px;
    height: 34px;
  }

  .rm-option-sheet-content {
    padding: 12px 10px 17px;
  }

  .rm-option-sheet-grid {
    gap: 8px;
  }

  .rm-option-sheet-selected-main {
    padding: 9px 10px;
  }

  .rm-option-sheet-footer {
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (max-width: 360px) {
  .rm-option-sheet-content {
    padding-left: 8px;
    padding-right: 8px;
  }

  .rm-option-sheet-grid {
    gap: 7px;
  }

  .rm-option-sheet-card-body {
    padding: 8px 7px 9px;
  }

  .rm-option-sheet-card h4 {
    font-size: 11px;
  }

  .rm-option-sheet-qty {
    grid-template-columns: 29px minmax(25px, 1fr) 29px;
  }

  .rm-option-sheet-qty button {
    height: 29px;
  }

  .rm-option-sheet-price-wrap.has-change {
    gap: 6px;
  }

  .rm-option-sheet-current strong {
    font-size: 20px;
  }
}
