.cart-modal-overlay {
  display: none;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 20000;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cart-modal-overlay.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-modal {
  position: relative;
  box-sizing: border-box;
  background: #fff;
  width: 520px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 10px;
  padding: 28px 24px 24px;
  text-align: left;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cart-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: none;
  background: none;
  font-size: 28px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 4px;
}

.cart-modal-close:hover {
  color: #333;
}

.cart-modal-name {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 16px;
  padding-right: 24px;
}

.cart-modal-label {
  font-size: 15px;
  font-weight: bold;
  color: #a5893f;
  border-left: 4px solid #a5893f;
  padding-left: 8px;
  margin-bottom: 8px;
}

.cart-modal-section {
  margin-bottom: 16px;
}

.cart-modal-var {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 15px;
}

.cart-modal-var:has(input:checked) {
  border-color: #c40000;
  background: #fff5f5;
}

.cart-modal-var-name {
  flex: 1;
  color: #333;
}

.cart-modal-var-price {
  font-weight: bold;
  color: #c40000;
  white-space: nowrap;
}

.cart-modal-price {
  margin: 8px 0 0;
  color: #c40000;
  font-size: 16px;
  font-weight: bold;
  text-align: right;
}

.cart-modal-opt {
  display: block;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
}

.cart-modal-opt:has(input:checked) {
  border-color: #c40000;
  background: #fff5f5;
}

.cart-modal-opt-label {
  font-size: 14px;
  font-weight: bold;
  color: #333;
}

.cart-modal-required {
  color: #c40000;
}

.cart-modal-opt-text {
  font-size: 13px;
  color: #555;
  margin-top: 4px;
  line-height: 1.5;
}

.cart-modal-opt-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: bold;
  color: #c40000;
  cursor: pointer;
}

.cart-modal-select,
.cart-modal-input {
  box-sizing: border-box;
  width: 100%;
  margin-top: 8px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  min-height: 42px;
  padding: 8px;
}

.cart-modal-error {
  color: #c40000;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 8px;
  min-height: 1.2em;
}

.cart-modal-submit {
  display: block;
  width: 100%;
  border: none;
  padding: 12px 0;
  background: #c40000;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  border-radius: 6px;
  cursor: pointer;
}

.cart-modal-submit:hover {
  opacity: 0.85;
}

@media (max-width: 768px) {
  .cart-modal-overlay {
    padding: 12px;
  }

  .cart-modal {
    padding: 24px 16px 16px;
  }

  .cart-modal-var,
  .cart-modal-opt {
    padding: 8px 10px;
  }
}
